nagios db issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

nagios db issue

Post by ravish78 »

Hi team,

We are migrating our nagios xi environment to new OS.When we did restore it happened successfully but it is showing db error in GUI.

Attached screenshot for reference.We have production live this weekend.So any help would be appreciated.

Also ndo is showing as locked

/etc/init.d/ndo2db status
ndo2db is not running but subsystem locked

Thanks
Ravi
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios db issue

Post by slansing »

That is showing that it is not running, it is not precisely an error.... Click the cog wheel and then click start. Or issue the following from an ssh session:

Code: Select all

service mysqld start
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: nagios db issue

Post by ravish78 »

We tried that but it still remains same.

Restarted mysql but still no luck.We suspect it is ndo issue.

i could not see ndo.sock in /usr/local/nagios/var
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios db issue

Post by slansing »

What was the exact output you got when you ran:

Code: Select all

service mysqld start
On the command line? You may have a stuck mysql.sock file, in which case make sure mysqld is stopped (it should be) and run:

Code: Select all

rm -f /var/lib/mysql/mysql.sock

Code: Select all

service mysqld start
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: nagios db issue

Post by ravish78 »

I tried steps as suggested by you.

mysql in running state and found mysql.sock
stopped mysqld,could not find mysql.sock after stopping.
Tried removing command.
started mysql

Attached complete output.
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios db issue

Post by slansing »

Are you running an offloaded database? If so, just as the document says you don't need it running locally. If you are running a local database, what does the red icon on the System Status page say when you mouse over it?
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: nagios db issue

Post by ravish78 »

It is local database and when mouse over it is showing as database backend not running.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: nagios db issue

Post by sreinhardt »

OK, let's get some basics out of the way then.

Code: Select all

ps -ef | grep bin/nag
ps -ef | grep bin/ndo
ps -ef | grep mysql
service ndo2db status

grep 'output=' /usr/local/nagios/etc/ndomod.cfg

grep 'socket_name' /usr/local/nagios/etc/ndo2db.cfg
grep 'db_' /usr/local/nagios/etc/ndo2db.cfg | grep -v 'user\|pass'
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: nagios db issue

Post by ravish78 »

Attached output.

Can we have online session tommorow around 10:00am CST to fix this.
We have production luanch this weekend and we need to fix this ASAP.
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios db issue

Post by abrist »

Lets check your mysqld logs for crashed tables and then restart ndo:

Code: Select all

tail -50 /var/log/mysqld.log | grep "crashed"
If you have any crashed tables, run the repair script:

Code: Select all

/usr/local/nagiosxi/scripts/repairmysql.sh nagios
/usr/local/nagiosxi/scripts/repairmysql.sh nagiosql
Then restart ndo2db:

Code: Select all

service ndo2db restart
service ndo2db status
service mysqld status
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.
Locked