node_exporter install

wget https://github.com/prometheus/node_exporter/releases/download/v1.6.0/node_exporter-1.6.0.linux-amd64.tar.gzcat /usr/lib/systemd/system/node_export.service[Unit]Description=node_exporterDocumentation=https://prometheus.io/After=network.target [Service]Type=simpleUser=rootExecStart=/usr/local/bin/node_exporter --web.listen-address=0.0.0.0:39100 --collector.systemd --collector.systemd.unit-whitelist=(docker|sshd).service --collector.textfile.directory /var/lib/node_exporter/textfile_collector/Restart=on-failure [Install]WantedBy=multi-user.targetmv /usr/lib/systemd/system/node_export.service /usr/lib/systemd/system/node_exporter.servicesystemctl daemon-reloadsystemctl enable node_exporterCreated symlink from /etc/systemd/system/multi-user.target.wants/node_exporter.service to /usr/lib/systemd/system/node_exporter.service.systemctl start node_exporternetstat -tnplActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1079/sshd           tcp6       0      0 :::22                   :::*                    LISTEN      1079/sshd           tcp6       0      0 ::1:25                  :::*                    LISTEN      1399/master         tcp6       0      0 :::39100                :::*                    LISTEN      6735/node_exporter  tcp6       0      0 :::39104                :::*                    LISTEN      4456/mysqld_exporte 

cadvisor

[root@vm5 ~]# docker run --publish=38081:8080 --detach=true --name=cadvisor google/cadvisorUnable to find image 'google/cadvisor:latest' locallylatest: Pulling from google/cadvisorff3a5c916c92: Pull complete 44a45bb65cdf: Pull complete 0bbe1a2fe2a6: Pull complete Digest: sha256:815386ebbe9a3490f38785ab11bda34ec8dacf4634af77b8912832d4f85dca04Status: Downloaded newer image for google/cadvisor:latest6765d0b66bab4fceb43c8b9ca4f4ab4a681981cee56534692c616e8ce24ee51b[root@vm5 ~]# netstat -tnlpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      957/sshd            tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1469/master                tcp6       0      0 :::38080                :::*                    LISTEN      30961/docker-proxy  tcp6       0      0 :::38081                :::*                    LISTEN      3147/docker-proxy 
[root@server01 ~]# vi /opt/prometheus/prometheus.yml    - job_name: 'docker'    static_configs:    - targets: ['10.xx.x.1:38081']