Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:rhomann:nagiosQL-2
nagios
rcnagios
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rcnagios of Package nagios
#! /bin/sh # Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany. # 2002 SuSE Linux AG Nuernberg, Germany. # # Author: Wolfgang Rosenauer <feedback@suse.de> # # /etc/init.d/nagios # # and symbolic its link # # /usr/sbin/rcnagios # # System startup script for nagios # ### BEGIN INIT INFO # Provides: nagios # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: network monitor nagios ### END INIT INFO . /etc/rc.status USR=nagios NAGIOS_PID=/var/run/nagios.pid NAGIOS_BIN=/usr/sbin/nagios NAGIOS_CFG=/etc/nagios/nagios.cfg NAGIOS_SAV=/var/log/nagios/status.sav NAGIOS_LOG=/var/log/nagios/nagios.log NAGIOS_TMP=/var/log/nagios/nagios.tmp test -x $NAGIOS_BIN || exit 5 function config_check () { $NAGIOS_BIN -v $NAGIOS_CFG > /dev/null 2>&1 if [ $? -eq 0 ]; then return 0 else $NAGIOS_BIN -v $NAGIOS_CFG > /var/log/nagios/config.err 2>&1 return 1 fi } rc_reset case "$1" in start) echo -n "Starting nagios " config_check if [ $? -eq 0 ]; then su $USR -c "touch $NAGIOS_LOG $NAGIOS_SAV" echo -n '' >> $NAGIOS_PID chown $USR $NAGIOS_PID startproc -p $NAGIOS_PID $NAGIOS_BIN -d $NAGIOS_CFG else echo "- Error in configuration files" echo -n "- please read /var/log/nagios/config.err" rc_failed fi rc_status -v ;; stop) echo -n "Shutting down nagios " killproc -TERM -p $NAGIOS_PID $NAGIOS_BIN rm -f /var/lock/subsys/nagios $NAGIOS_TMP $NAGIOS_PID rc_status -v ;; try-restart) ## Do a restart only if the service was active before. ## Note: try-restart is now part of LSB (as of 1.9). ## RH has a similar command named condrestart. $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi # Remember status and be quiet rc_status ;; restart) $0 stop $0 start rc_status ;; reload|force-reload) echo -n "Reload service nagios " config_check if [ $? -eq 0 ]; then echo -n "Passed configuration check - reloading..." killproc -HUP -p $NAGIOS_PID $NAGIOS_BIN else echo "- Error in configuration files" echo -n "- aborting reload - please read /var/log/nagios/config.err" rc_failed fi rc_status -v ;; status) echo -n "Checking for nagios " checkproc -p $NAGIOS_PID $NAGIOS_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|reload}" exit 1 ;; esac rc_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