Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:Uyuni:Master:CentOS6-Uyuni-Client-Tools
golang-github-prometheus-node_exporter
prometheus-node_exporter.initd
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File prometheus-node_exporter.initd of Package golang-github-prometheus-node_exporter
#!/bin/bash # prometheus-node_exporter Prometheus exporter for machine metrics # # Author: Joao Cavalheiro <jcavalheiro@suse.com> # # chkconfig: 2345 20 80 Read # # description: Prometheus exporter for hardware and OS metrics # processname: node_exporter ### BEGIN INIT INFO # Provides: node_exporter # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Prometheus exporter for machine metrics # Description: Prometheus exporter for hardware and OS metrics exposed by \ # *NIX kernels, written in Go with pluggable metric collectors. ### END INIT INFO SERVICE_NAME="prometheus-node_exporter" PROCESS_NAME="node_exporter" BINARY="/usr/bin/node_exporter" USER="prometheus" LOGFILE=/var/log/prometheus/$SERVICE_NAME.log LOCKFILE=/var/lock/subsys/$SERVICE_NAME ARGS="" [ -e /etc/sysconfig/$SERVICE_NAME ] && . /etc/sysconfig/$SERVICE_NAME if [ -f /etc/redhat-release ]; then . /etc/rc.d/init.d/functions start() { mkdir -p `dirname $LOGFILE` || true chown -R $USER: `dirname $LOGFILE` echo -n $"Starting $SERVICE_NAME: " daemon --user $USER --pidfile="$LOCKFILE" "$BINARY $ARGS &>$LOGFILE &" retval=$? echo [ $retval -eq 0 ] && echo $(pidofproc $PROCESS_NAME) >$LOCKFILE } stop() { echo -n $"Stopping $PROCESS_NAME: " killproc $PROCESS_NAME retval=$? echo [ $retval -eq 0 ] && rm -f $LOCKFILE } status_p() { status $PROCESS_NAME } elif [ -f /etc/SuSE-release ] ; then . /etc/rc.status start() { mkdir -p `dirname $LOGFILE` || true chown -R $USER: `dirname $LOGFILE` echo -n $"Starting $SERVICE_NAME: " startproc -u $USER -p $LOCKFILE -l $LOGFILE $BINARY $ARGS [ $? -eq 0 ] && echo $(pidofproc $PROCESS_NAME) >$LOCKFILE rc_status -v } stop() { echo -n $"Stopping $PROCESS_NAME: " killproc -p $LOCKFILE -TERM $PROCESS_NAME rc_status -v rm -f $LOCKFILE } status_p() { echo -n $"Checking for service $PROCESS_NAME: " checkproc -k -p $LOCKFILE $PROCESS_NAME if [ $? -eq 7 ]; then rc_failed 3 fi; rc_status -v } fi restart() { stop start } reload() { restart } force_reload() { restart } status_q() { status_p >/dev/null 2>&1 } case "$1" in start) status_q && exit 0 $1 ;; stop) status_q || exit 0 $1 ;; restart) $1 ;; reload) status_q || exit 7 $1 ;; force-reload) force_reload ;; status) status_p ;; condrestart|try-restart) status_q || exit 0 restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $?
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor