Page 1 of 2
By mistake if nagios.cfg got deleted???
Posted: Thu Jan 19, 2017 7:53 am
by dspatil7768
My question is suppose if nagios.cfg got deleted. And still, the daemon is running using pre-configuration. How to recover old configuration data with help of running daemon information??? I have not tried deleting it but I want to know it??
Thank you,
Devendra Patil
Re: By mistake if nagios.cfg got deleted???
Posted: Thu Jan 19, 2017 5:31 pm
by rkennedy
I don't believe this is going to be possible at a simple level, and a bit beyond what we can provide support for on the Nagios side. You may be able to recover it from memory somehow.
Re: By mistake if nagios.cfg got deleted???
Posted: Thu Jan 19, 2017 5:32 pm
by avandemore
Well if you deleted it and didn't have a backup it would be hard to recover especially in Nagios Core. XI would have created a backup automatically.
Otherwise if the file is still open and you know the inode:
Code: Select all
cp /proc/<pid>/fd/<fdno> /usr/local/nagios/etc/nagios.cfg
Re: By mistake if nagios.cfg got deleted???
Posted: Thu Jan 19, 2017 11:40 pm
by dspatil7768
I found pid in nagios.lock file. As mentioned above I looked into /proc/<PID>. But still didn't get any useful information about configuration. The only file which have some configuration information is /usr/local/nagios/var/retention.dat .
Thank you, sir @rkennedy and @avandemore
Re: By mistake if nagios.cfg got deleted???
Posted: Fri Jan 20, 2017 12:27 pm
by avandemore
I checked and the configuration is not held open, just read and closed. If you have deleted the file and not backed it up it is gone. There may be some file system recovery tool, but that is beyond the scope of this forum.
Re: By mistake if nagios.cfg got deleted???
Posted: Sat Jan 21, 2017 3:17 am
by dspatil7768
I'm new to Nagios and just queried that question to know.☺
Thank you,
Devendra patil
Re: By mistake if nagios.cfg got deleted???
Posted: Mon Jan 23, 2017 11:15 am
by dwhitfield
It complicates things, but you can use NDOUtils to deal with this in in some regards:
https://assets.nagios.com/downloads/nag ... OUtils.pdf
The best thing to do is just set things up in a VM, take regular snapshots and if things go awry, roll back.
That all said, are we ready to lock this up?
Re: By mistake if nagios.cfg got deleted???
Posted: Mon Jan 23, 2017 11:35 pm
by dspatil7768
That is the thing that I do every time, Just rolling back.
Re: By mistake if nagios.cfg got deleted???
Posted: Tue Jan 24, 2017 10:22 am
by dwhitfield
Great to hear of best practices out in the wild. Did you have any other questions, or are we ready to lock this thread?
Re: By mistake if nagios.cfg got deleted???
Posted: Wed Jan 25, 2017 2:38 am
by dspatil7768
I want to ask one question again. I have installed Nagios 4.2.0 and Nagiosgraph 1.5.2. And I have added one Linux Remote host and I'm getting empty graphs for Localhost as well as Remote Linux host. And I'm getting graphs using MRTG.
Any Solution??
Thank you,
Devendra Patil