Re: Inconsistency in a script
Posted: Thu Aug 27, 2015 4:23 pm
When you run it and it doesn't work, does it still show up in the audit log? (Admin > Audit Log)
Support for Nagios products and services
https://support.nagios.com/forum/
Code: Select all
#!/bin/bash
echo ""
/bin/echo 'select count(*) from nagios_hosts;' | mysql -s -pnagiosxi nagios
echo ""
cd /usr/local/nagiosxi/scripts
/bin/cat /usr/local/nagiosxi/scripts/delete-hosts.csv | while read LINE
do
Name=`/bin/echo $LINE | /bin/cut -d, -f1`
./nagiosql_delete_host.php --host=$Name
done
./reconfigure_nagios.shCode: Select all
./delete-hosts.sh &> /tmp/debug.txtThank you, let us know what happens.peter.zanetti wrote:Sorry for the long wait. I will try and work on this Friday morning and post the requested file here.