[Pkg-nagios-devel] nagios changelog,1.40,1.41 nagios-common.nagios.init,1.6,1.7
seanius@haydn.debian.org
seanius@haydn.debian.org
Update of /cvsroot/pkg-nagios/nagios
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv11275
Modified Files:
changelog nagios-common.nagios.init
Log Message:
tags 296562 pending
thanks
made init script more robust for the db variants of nagios.
sean
Index: changelog
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/changelog,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- changelog 23 Feb 2005 00:27:19 -0000 1.40
+++ changelog 24 Feb 2005 01:18:38 -0000 1.41
@@ -8,6 +8,11 @@
Marcus Better <marcus@better.se> (closes: #296100, #296306).
- nagios installs now include /var/log/nagios/archives, thanks
to Heno Ivanov <heno@siil.net> (closes: #290003).
+ - check_nagios in the init script is a little more robust by
+ running both the check_nagios_db script *and* looking for the
+ pid. thanks to Ryszard Lach <rla@debian.org> (closes: #296562).
+ - removed old, obsolete, probably unused support for check_netsaint.
+ if it breaks anything we can always add it back :)
-- Sean Finney <seanius@debian.org> Mon, 21 Feb 2005 23:21:29 -0500
Index: nagios-common.nagios.init
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.nagios.init,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- nagios-common.nagios.init 9 Feb 2005 04:48:21 -0000 1.6
+++ nagios-common.nagios.init 24 Feb 2005 01:18:38 -0000 1.7
@@ -30,37 +30,23 @@
# start-stop-daemon should handle this work!
#
check_started () {
- if [ -f /etc/nagios/check_nagios_db ]; then
- if /etc/nagios/check_nagios_db > /dev/null; then
- return 0 # Is started
- else
- return 1 # Isn't started
- fi
- elif [ -f /usr/lib/nagios/plugins/check_nagios ]; then
- if /usr/lib/nagios/plugins/check_nagios -e 15 -F /var/log/nagios/status.log -C 'nagios' > /dev/null; then
- return 0 # Is started
- else
- return 1 # Isn't started
+ if [ -f /etc/nagios/check_nagios_db ]; then
+ if ! /etc/nagios/check_nagios_db > /dev/null; then
+ return 1 # isn't started
+ fi
fi
- elif [ -f /usr/lib/netsaint/plugins/check_netsaint ]; then
- if /usr/lib/netsaint/plugins/check_netsaint -F /var/log/nagios/status.log -e 5 -C 'nagios' > /dev/null; then
- return 0 # Is started
- else
- return 1 # Isn't started
+ if [ -f /usr/lib/nagios/plugins/check_nagios ]; then
+ if ! /usr/lib/nagios/plugins/check_nagios -e 15 -F /var/log/nagios/status.log -C 'nagios' > /dev/null; then
+ return 1 # isn't started
+ fi
fi
- elif [ -f $PIDFILE ]; then
- # Try discovering if nagios is alive checking its pid
- pid=`cat $PIDFILE`
- if [ "$pid" ]; then
- if ps $pid >/dev/null; then
+ if [ -f $PIDFILE ]; then
+ pid=`cat $PIDFILE`
+ if [ "$pid" ] && ps $pid >/dev/null; then
return 0 # Is started
fi
- else
- return 1 # Isn't started
fi
- else
- return 1 # Isn't started
- fi
+ return 1 # Isn't started
}
get_config () {