PrometheusモニタLinux

1345 ワード

環境


システム:CentOS 7.5ソフトウェア:node_exporter-0.16.0.linux-amd64.tar.gz

クライアント

  • ダウンロードnode_exporterアドレス:https://prometheus.io/download/
  • 取付
    # tar -xzvf node_exporter-0.16.0.linux-amd64.tar.gz
    # mkdir /usr/local/prometheus
    # mv node_exporter-0.16.0.linux-amd64 /usr/local/prometheus/node_exporter
    
  • ユーザーを作成し、
    # useradd prometheus
    # chown -R prometheus:prometheus /usr/local/prometheus
    
  • を承認します.
  • 追加起動サービス
    # vim /usr/lib/systemd/system/node_exporter.service
    [Unit]
    Description=node_exporter
    After=network.target
    
    [Service]
    Type=simple
    User=prometheus
    ExecStart=/usr/local/prometheus/node_exporter/node_exporter
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
  • 起動
    # systemctl enable node_exporter.service
    # systemctl start node_exporter.service
    
  • Prometheusエンド

  • Prometheus
    # vim /usr/local/prometheus/prometheus.yml
    scrape_configs:
      - job_name: 'linux'
      static_configs:
        - targets: ['10.10.10.1:9100']
    
  • の構成
  • Prometheus
    # systemctl restart prometheus
    
  • を再起動

    Grafanaエンド

  • dashboardsを追加Create-Importをクリックし、dashboards id( 1860)
  • を入力.