Page 1 of 1
Check Nagios XI database corruption
Posted: Mon Nov 18, 2019 4:56 pm
by jvaira
Hello,
Is it possible to check for Nagios XI database corruption from another Nagios instance? We have run into the situation a few times where a Nagios XI VM unexpectedly restarts which causes database corruption. We have checks in place to tell us if another Nagios host is down but nothing to tell us if there was database corruption after the machine came back up.
Re: Check Nagios XI database corruption
Posted: Mon Nov 18, 2019 5:34 pm
by ssax
Yes, you could setup NRPE on the XI server and run a plugin such as this on the other end:
https://exchange.nagios.org/directory/P ... us/details
To enable the XI server's NPRE you would need to do this:
Add this to
/etc/xinetd.d/nrpe (create it if needed):
-
Change X.X.X.X to the OTHER XI server's IP address
Code: Select all
# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
disable = no
per_source = 25
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
only_from = 127.0.0.1 X.X.X.X
log_on_success =
}
Then run these commands:
Code: Select all
chkconfig nrpe on
service xinetd restart
Now test from the CLI (locally AND from the remote system):
XI Server (local):
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
Other XI server:
-
Change X.X.X.X to the OTHER XI server's IP address
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H X.X.X.X
Let me know if you have any questions or if I can clarify anything.
Re: Check Nagios XI database corruption
Posted: Mon Dec 02, 2019 2:01 pm
by jvaira
Hello Sean,
I am a little confused as to what is being installed on which machine. Lets say XI server #1 is the machine I will be initiating the check from and XI server #2 is the machine that I want to check the database on. I would setup NRPE on XI server #2 correct? If so I would then upload the box293_check_mysql_table_status plugin to XI server #1?
Re: Check Nagios XI database corruption
Posted: Mon Dec 02, 2019 4:01 pm
by ssax
Yes, setup NRPE on XI2, put the plugin in
/usr/local/nagios/libexec on XI2 as well.
XI2:
Code: Select all
wget -O /usr/local/nagios/libexec/box293_check_mysql_table_status 'https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=6498&cf_id=24'
chown apache.nagios /usr/local/nagios/libexec/box293_check_mysql_table_status
chmod og+x /usr/local/nagios/libexec/box293_check_mysql_table_status
The plugin checks the local mysql database, it needs to reside on the one you're checking.
Testing from XI1:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H XI2 -c check_mysql_table_status -a nagios 'ndoutils' 'n@gweb'
XI2's nrpe.cfg:
Code: Select all
command[check_mysql_table_status]=/usr/local/nagios/libexec/box293_check_mysql_table_status $ARG1$ $ARG2$ $ARG3$