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?
how to Nagiosxi could test himself SQL?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: how to Nagiosxi could test himself SQL?
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?
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?
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?
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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: how to Nagiosxi could test himself SQL?
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
fiBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: how to Nagiosxi could test himself SQL?
uh...sound interesting..i will give it a try!
Thank you!!
Thank you!!
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: how to Nagiosxi could test himself SQL?
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.