By mistake if nagios.cfg got deleted???
-
- Posts: 7
- Joined: Thu Jan 19, 2017 7:43 am
By mistake if nagios.cfg got deleted???
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
Thank you,
Devendra Patil
Re: By mistake if nagios.cfg got deleted???
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.
Former Nagios Employee
-
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: By mistake if nagios.cfg got deleted???
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:
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
Previous Nagios employee
-
- Posts: 7
- Joined: Thu Jan 19, 2017 7:43 am
Re: By mistake if nagios.cfg got deleted???
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
Thank you, sir @rkennedy and @avandemore
- Attachments
-
- retention.txt
- (21.74 KiB) Downloaded 158 times
-
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: By mistake if nagios.cfg got deleted???
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.
Previous Nagios employee
-
- Posts: 7
- Joined: Thu Jan 19, 2017 7:43 am
Re: By mistake if nagios.cfg got deleted???
I'm new to Nagios and just queried that question to know.☺
Thank you,
Devendra patil
Thank you,
Devendra patil
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: By mistake if nagios.cfg got deleted???
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?
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?
-
- Posts: 7
- Joined: Thu Jan 19, 2017 7:43 am
Re: By mistake if nagios.cfg got deleted???
That is the thing that I do every time, Just rolling back.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: By mistake if nagios.cfg got deleted???
Great to hear of best practices out in the wild. Did you have any other questions, or are we ready to lock this thread?
-
- Posts: 7
- Joined: Thu Jan 19, 2017 7:43 am
Re: By mistake if nagios.cfg got deleted???
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
Any Solution??
Thank you,
Devendra Patil