[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.3, Sat Jan 13 00:04:51 2007 UTC (17 years, 5 months ago) by andrew
Branch: MAIN
Changes since 1.2: +12 -5 lines

check if the files are different before updating.  To that end, sort the order that we output them so that there is a better chance they are.

#!/bin/sh
# $RedRiver: update_nagios_wireless_client_config,v 1.2 2007/01/12 23:41:56 andrew Exp $

CFG=/etc/nagios/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}