Nagios not working after Update

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios not working after Update

Post by lmiltchev »

You have config errors that you need to fix:
Error: Cannot open resource file '/etc/nagios3/resource.cfg' for reading!
Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Error: Cannot open config file '/etc/nagios3/commands.cfg' for reading: No such file or directory
Error processing object config files!
Do the "resource.cfg" and "commands.cfg" files exist? What are the permissions of these files? Is the path to these files correctly defined in the "nagios.cfg"?

Code: Select all

resource_file=/path/to/resource.cfg
cfg_file=/path/to/commands.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
Darth_Panda
Posts: 27
Joined: Sun Jun 28, 2015 7:01 am

Re: Nagios not working after Update

Post by Darth_Panda »

Nagios 3 I started to install accidentally after I caused the first problem. I should just have Nagios Core. Can I remove Nagios 3? Would I just use apt-get uninstall nagios3?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not working after Update

Post by Box293 »

I believe what you have is the included OS distribution of Nagios, which is the same but usually lacking behind in versions, as opposed to building Nagios Core from source.

It might be easier to start fresh on a new build and bring your configs across (all the .cfg files) ... this is the core of Nagios monitoring. I'm unsure how Cacti integrates so that might be a hurdle for you as well.

As a suggestion you could deploy a Nagios XI VM and test it for 60 days, importing your existing configs. If it suits your needs it might be better in the long run to purchase it as it has support and a known deployment method. It's just always hard to troubleshoot some problems when many different options like cacti are integrated in.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Darth_Panda
Posts: 27
Joined: Sun Jun 28, 2015 7:01 am

Re: Nagios not working after Update

Post by Darth_Panda »

My preference would be to stick to the free versions. I have set up a virtual machine with Jessie to test on before I reload the server. How do I check the Nagios version that comes free with Jessie (if it does). Unless that's a Wheezy only thing.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not working after Update

Post by Box293 »

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Darth_Panda
Posts: 27
Joined: Sun Jun 28, 2015 7:01 am

Re: Nagios not working after Update

Post by Darth_Panda »

Thanks, so would it be pre-installed or do I need to grab it from apt-get ? Also another important question. Please see my Nagios status below. Can I import all my hosts and host groups in to my new build?

root@watchtower:~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 14)
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 1 services.
Checked 851 hosts.
Checked 66 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 851 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not working after Update

Post by Box293 »

I believe you would install it via apt-get.
Darth_Panda wrote:
Thanks, so would it be pre-installed or do I need to grab it from apt-get ? Also another important question. Please see my Nagios status below. Can I import all my hosts and host groups in to my new build?

root@watchtower:~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
It does look like you are using 4.0.8. You could have been using 3.5.1 before this "update" so it must have been built from source ... but I could be wrong because it does throw this warning:
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 14)
My previous link to that guide would walk you through building it from source.

Basically everything under
/usr/local/nagios/etc
Is where the configs are and your should be able to copy/paste.

In this file:
/usr/local/nagios/etc/nagios.cfg

It has the definitions of what config files/folders it uses.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Darth_Panda
Posts: 27
Joined: Sun Jun 28, 2015 7:01 am

Re: Nagios not working after Update

Post by Darth_Panda »

Box293 wrote:
My previous link to that guide would walk you through building it from source.

Basically everything under
/usr/local/nagios/etc
Is where the configs are and your should be able to copy/paste.

In this file:
/usr/local/nagios/etc/nagios.cfg

It has the definitions of what config files/folders it uses.
Thanks. That's good news, that is going to save me so much configuration time. I could have this back to the way it was in a few hours. I am going to take a look at your guide also. Just one question regarding copy and paste on Linux.
If I am connected through TTY to the old server and the new server, how would I copy and paste my cfg files between the two?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios not working after Update

Post by Box293 »

You could scp:

Example if logged onto new server:

Code: Select all

mkdir /var/tmp/old_nagios
scp root@old_ip_address:/usr/local/nagios/etc/*.* /var/tmp/old_nagios/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Darth_Panda
Posts: 27
Joined: Sun Jun 28, 2015 7:01 am

Re: Nagios not working after Update

Post by Darth_Panda »

Box293 wrote:You could scp:

Example if logged onto new server:

Code: Select all

mkdir /var/tmp/old_nagios
scp root@old_ip_address:/usr/local/nagios/etc/*.* /var/tmp/old_nagios/
Thanks! :P
Locked