[BACK]Return to update_nagios_wireless_client_config CVS log [TXT][DIR] Up to [local] / nagios / check_rrd / bin

File: [local] / nagios / check_rrd / bin / update_nagios_wireless_client_config (download)

Revision 1.4, Tue Dec 23 20:03:40 2008 UTC (15 years, 4 months ago) by andrew
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines

new nagios means the cfg file moved

#!/bin/sh
# $RedRiver: update_nagios_wireless_client_config,v 1.3 2007/01/13 00:04:51 andrew Exp $

CFG=/etc/nagios/objects/hosts-wireless-clients.cfg
NAGIOSOUT=`mktemp`

cp ${CFG} ${CFG}.old

make_wireless_client_config /var/www/wstationinfo/known_hosts.stor > ${CFG}

cmp -s ${CFG} ${CFG}.old 

if [ $? -ne 0 ]; then

	nagios -v /etc/nagios/nagios.cfg > ${NAGIOSOUT}

	if [ $? -ne 0 ]; then
		mail -s "Nagios configuration problem!" root < ${NAGIOSOUT}
		cp ${CFG} ${CFG}.bad
		cp ${CFG}.old ${CFG}
	else
		pkill -HUP nagios
	fi
fi
	

rm -f ${CFG}.old ${NAGIOSOUT}