version 1.1, 2007/01/12 23:41:19 |
version 1.3, 2007/01/13 00:04:51 |
|
|
#!/bin/sh |
#!/bin/sh |
# $RedRiver$ |
# $RedRiver: update_nagios_wireless_client_config,v 1.2 2007/01/12 23:41:56 andrew Exp $ |
|
|
CFG=/etc/nagios/hosts-wireless-clients.cfg |
CFG=/etc/nagios/hosts-wireless-clients.cfg |
NAGIOSOUT=`mktemp` |
NAGIOSOUT=`mktemp` |
|
|
|
|
make_wireless_client_config /var/www/wstationinfo/known_hosts.stor > ${CFG} |
make_wireless_client_config /var/www/wstationinfo/known_hosts.stor > ${CFG} |
|
|
nagios -v /etc/nagios/nagios.cfg > ${NAGIOSOUT} |
cmp -s ${CFG} ${CFG}.old |
|
|
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
mail -s "Nagios configuration problem!" andrew < ${NAGIOSOUT} |
|
cp ${CFG} ${CFG}.bad |
nagios -v /etc/nagios/nagios.cfg > ${NAGIOSOUT} |
cp ${CFG}.old ${CFG} |
|
|
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 |
fi |
|
|
|
|