[op5-users] re Merlin not importing all data from objects.conf

Mirza Dedic mirde at oppy.com
Mon Aug 10 23:23:58 CEST 2009


I am having the very same issue, I am not seeing all of the hosts/services on Ninja; however they all appear in Nagios UI.

I don't know if this is a Ninja or Merlin issue...

I have tried restarting the services etc, running the php import.php script again, no luck.

Can anyone shed some light on this or provide steps to diagnose the issue? Seems like quite a few users are running into this.

I have had Ninja/Merlin running for a few weeks now, but recently started picking up on the nagios configuration and adding more hosts/services to be monitored, which are not showing in Ninja.

Thanks.

From: op5-users-bounces at lists.op5.com [mailto:op5-users-bounces at lists.op5.com] On Behalf Of Michael Hobbs
Sent: August/10/2009 7:57 AM
To: 'Mailinglist for op5's products'
Subject: [op5-users] re Merlin not importing all data from objects.conf

Hi all

Been beating head against this problem with merlin not importing properly and in the end I came up with the idea of just truncating the merlin database tables and doing a re-import and that worked

So I bashed up a quick script ( which was obviously nicked off the web from http://david-burger.blogspot.com/2008/02/truncate-all-tables-in-mysql-database.html) and I call that as part of the nagios reload script I run

<snip>
#!/bin/bash
user=merlin
PASS=XXXX
dbname=merlin
basecmd="mysql -u ${user} -p$PASS -D ${dbname}"
tables=$(${basecmd} -e "SHOW TABLES;" | grep -v "+--" | grep -v "Tables_in_${dbname}"| grep -v "ninja*" | grep -v "user*")
#tables=$(${basecmd} -e "SHOW TABLES;" | grep -v "+--" | grep -v "ninja*" )
if [ $? -ne 0 ]; then
echo "Unable to retrieve the table names." >&2
  exit 1
fi
cmd=""
for table in ${tables}; do
cmd="${cmd} TRUNCATE ${table};"
echo ${table}
done
$(${basecmd} -e "${cmd}")
php /usr/local/nagios/etc/addons/merlin/import.php --cache=/usr/local/nagios/var/objects.cache
</snip>

As you can see I'm not touching the ninja or the user tables just the merlin ones, now I'm not sure if this is the correct approach to this problem but it works for me

Cheers

Mike




More information about the op5-users mailing list