summaryrefslogtreecommitdiff
path: root/prometheus-node-exporter/prometheus-node-exporter.service
blob: 43edfce4e215a71f3b7051541b18df71337db4ac (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/prometheus-node-exporter: start/stop prometheus-node-exporter daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/bin/node_exporter
    8 PORT=9100
    9 OPTS="--collector.processes --web.listen-address=":${PORT}" --web.config=/etc/node-exporter/config.yml"
   10 
   11 case $1 in
   12   start)
   13     $SSD --start -b --exec $PROG -- $OPTS ;;
   14   stop)
   15     $SSD --stop --retry 10 --exec $PROG ;;
   16   restart)
   17     $0 stop
   18     $0 start
   19     ;;
   20   status)
   21     $SSD --status --exec $PROG
   22     case $? in
   23       0) echo "$PROG is running with pid $(pidof $PROG)" ;;
   24       1) echo "$PROG is not running but the pid file $PID exists" ;;
   25       3) echo "$PROG is not running" ;;
   26       4) echo "Unable to determine the program status" ;;
   27       esac
   28     ;;
   29   *)
   30     echo "usage: $0 [start|stop|restart|status]" ;;
   31 esac
   32 
   33 # End of file

Generated by cgit