####Node Exporter systemctl
[root@Centos7-Dev linux]# cat /usr/lib/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=prometheus
Group=prometheus
ExecStart=/data/www/node_exporter/bin/node_exporter --web.listen-address=192.168.91.11:9100 --web.disable-exporter-metrics --collector.tcpstat --collector.logind --collector.processes --collector.textfile.directory=/data/www/node_exporter/data
ExecReload=/bin/kill -HUP
KillMode=process
TimeoutStopSec=20s
Restart=always
SyslogIdentifier=node_exporter
StandardInput=syslog
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=default.target
####Rsyslog日志
[root@Centos7-Dev linux]# cat /etc/rsyslog.d/node_exporter.conf
if $programname == "node_exporter" then /data/www/node_exporter/logs/node_exporter.logs
& stop