Inconsistency in a script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Inconsistency in a script

Post by ssax »

When you run it and it doesn't work, does it still show up in the audit log? (Admin > Audit Log)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Inconsistency in a script

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
peter.zanetti
Posts: 90
Joined: Wed Oct 01, 2014 8:34 am

Re: Inconsistency in a script

Post by peter.zanetti »

Sorry for the long wait. I will try and work on this Friday morning and post the requested file here.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Inconsistency in a script

Post 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.
Former Nagios Employee.
me.
Locked