Page 1 of 1
how to Nagiosxi could test himself SQL?
Posted: Mon Nov 10, 2014 3:02 am
by damned
Hi, sometimes happens that nagiosxi's sql goes wrong and i must do the repair procedure and this always worked.
But is there a way to automatically check the nagiosxi sql to report possible corruptions problems?
Someone has any experience on this?
Re: how to Nagiosxi could test himself SQL?
Posted: Mon Nov 10, 2014 10:37 am
by slansing
Well, it is done as part of the maintenance cron, you would see the issues immediately anyways in the WebUI, so that is essentially the same as having a plugin do it for you,

. If this is happening often, you must be doing something incorrectly, the leading cause for this is incorrectly shutting down the XI server. You must use a derivative of "shutdown -h now" to gracefully close processes/services/etc or you will see corruption.
Re: how to Nagiosxi could test himself SQL?
Posted: Fri Nov 14, 2014 3:51 pm
by damned
uhm...i've about 30 nagiosxi installed and when this happens (luckily so rare) i never see an error reported..
Re: how to Nagiosxi could test himself SQL?
Posted: Sat Nov 15, 2014 5:20 pm
by damned
i will try to explain better: i never received a mail that signaled the problem..if i login to webpage i see the problem, but if i don't login i don't notice any problem..
Re: how to Nagiosxi could test himself SQL?
Posted: Mon Nov 17, 2014 12:34 pm
by abrist
Depends which tables are failing and how. If tables are crashing, you could just check the mysql log for "crashed" and then alert on that.
Re: how to Nagiosxi could test himself SQL?
Posted: Mon Nov 17, 2014 1:03 pm
by lmiltchev
You can set up a simple check using a bash script, maybe something like this:
Code: Select all
#!/bin/bash
tail /var/log/mysqld.log | grep crashed
if [ $? -eq 0 ]
then
echo "There are crashed tables in mysql database."
exit 1
else
echo "No errors in mysql database."
exit 0
fi
Re: how to Nagiosxi could test himself SQL?
Posted: Wed Nov 19, 2014 3:46 pm
by damned
uh...sound interesting..i will give it a try!
Thank you!!
Re: how to Nagiosxi could test himself SQL?
Posted: Wed Nov 19, 2014 5:26 pm
by slansing
Yep, it's really as simple as that, you could also use a log check plugin that offers a more robust set of parameters, its up to you.