wok-stable diff nagios/stuff/nagios @ rev 11386
Compat: ensure that pam WGET_URL is non-https. Otherwise tazwok can't download it at cook-toolchain time
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sat Dec 10 04:42:49 2011 +0100 (2011-12-10) |
parents | |
children | 20ec44b61ab6 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nagios/stuff/nagios Sat Dec 10 04:42:49 2011 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/nagios : Start, stop and restart SSH server on SliTaz, at 1.6 +# boot time or with the command line. 1.7 +# 1.8 +# To start SSH server at boot time, just put nagios in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 +. /etc/daemons.conf 1.13 + 1.14 +NAME=Nagios 1.15 +DESC="Network Monitoring Server" 1.16 +DAEMON=/usr/bin/nagios 1.17 +CONFIG_FILE="/etc/nagios/nagios.cfg" 1.18 +OPTIONS="-d $CONFIG_FILE" 1.19 +PIDFILE=/var/run/nagios/nagios.pid 1.20 + 1.21 +configtest() 1.22 +{ 1.23 + $DAEMON -v $CONFIG_FILE 1.24 +} 1.25 + 1.26 +case "$1" in 1.27 + start) 1.28 + if active_pidfile $PIDFILE nagios ; then 1.29 + echo "$NAME already running." 1.30 + exit 1 1.31 + fi 1.32 + echo -n "Starting $DESC: $NAME... " 1.33 + $DAEMON $OPTIONS 1.34 + #/usr/bin/nagios -d /etc/nagios/nagios.cfg 1.35 + status 1.36 + ;; 1.37 + stop) 1.38 + if ! active_pidfile $PIDFILE nagios ; then 1.39 + echo "$NAME is not running." 1.40 + exit 1 1.41 + fi 1.42 + echo -n "Stopping $DESC: $NAME... " 1.43 + kill `cat $PIDFILE` 1.44 + status 1.45 + ;; 1.46 + restart|reload) 1.47 + if ! active_pidfile $PIDFILE nagios ; then 1.48 + echo "$NAME is not running." 1.49 + exit 1 1.50 + fi 1.51 + echo -n "Restarting $DESC: $NAME... " 1.52 + kill `cat $PIDFILE` 1.53 + sleep 2 1.54 + $DAEMON $OPTIONS 1.55 + status 1.56 + ;; 1.57 + test) 1.58 + configtest ;; 1.59 + *) 1.60 + echo "" 1.61 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]" 1.62 + echo "" 1.63 + exit 1 1.64 + ;; 1.65 +esac 1.66 + 1.67 +exit 0