Page 2 of 2

Re: Inconsistency in a script

Posted: Thu Aug 27, 2015 4:23 pm
by ssax
When you run it and it doesn't work, does it still show up in the audit log? (Admin > Audit Log)

Re: Inconsistency in a script

Posted: Thu Aug 27, 2015 4:35 pm
by lmiltchev
Modify your script to look like this one:

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.sh
Next, run:

Code: Select all

./delete-hosts.sh &> /tmp/debug.txt
and post the "debug.txt" to the forum.

Re: Inconsistency in a script

Posted: Wed Sep 02, 2015 2:24 pm
by peter.zanetti
Sorry for the long wait. I will try and work on this Friday morning and post the requested file here.

Re: Inconsistency in a script

Posted: Wed Sep 02, 2015 2:36 pm
by hsmith
peter.zanetti wrote:Sorry for the long wait. I will try and work on this Friday morning and post the requested file here.
Thank you, let us know what happens.