Page 5 of 6
Re: CentOS errors
Posted: Thu Nov 14, 2013 2:05 pm
by cbeattie
It's been my experience that it's best to avoid trying to make a distinction between configuration errors and warnings. I have 1,500 hosts and 14,000 service checks, so a clean preflight is essential for every change I make.
Re: CentOS errors
Posted: Thu Nov 14, 2013 2:08 pm
by tmcdonald
cbeattie wrote:It's been my experience that it's best to avoid trying to make a distinction between configuration errors and warnings. I have 1,500 hosts and 14,000 service checks, so a clean preflight is essential for every change I make.
Wise words. The line between warning and error is thin.
MPIvan, is everything working fine now that you fixed the warning?
Re: CentOS errors
Posted: Mon Nov 18, 2013 6:49 am
by MPIvan
Hi,
Yes it is all aright ... but warning is still different from error ... and i dont know way this is happening ..
Re: CentOS errors
Posted: Mon Nov 18, 2013 11:38 am
by slansing
Warnings are simply letting you know that something non crucial to the reading and writing of your configuration file "or use of it for monitoring" is not present or is incorrectly defined.
Re: CentOS errors
Posted: Mon Nov 18, 2013 1:48 pm
by MPIvan
OK we know what warning is ... as I say and you it is not crucial. When i using Nagios on Ubuntu, when i have warnings (no errors) i can still run, or i can still restart the nagios and nagios working just fine with this warnings, even there is warnings it still running. Now im using Nagios on CentOS and if i have one warnings, for example about contact not defined in one of the Host ... nagios cant start or restart ...
Re: CentOS errors
Posted: Mon Nov 18, 2013 4:06 pm
by abrist
Warnings will not cause nagios to not restart. Can you post the full output of the verification?
Re: CentOS errors
Posted: Tue Nov 19, 2013 7:03 am
by MPIvan
That is the problem, here i turn off/i comment the "contact" in one of the routers hosts ...
here is the configuration of the router
define host{
use zgrada-rt
host_name RouterCiscoT
alias Test Cisco SNMP
address 172.25.0.55
_SNMPCOMMUNITY TestCisco
# contacts Ivan
}
here is the verification ...
Code: Select all
[root@mpnagios objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 932 services.
Warning: Host 'RouterCiscoT' has no default contacts or contactgroups defined!
Checked 138 hosts.
Checked 3 host groups.
Checked 0 service groups.
Checked 12 contacts.
Checked 1 contact groups.
Checked 26 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 138 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: 1
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@mpnagios objects]#
And here is what iv got when i try to restart the nagios service
Code: Select all
[root@mpnagios objects]# /etc/init.d/nagios restart
Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 932 services.
Warning: Host 'RouterCiscoT' has no default contacts or contactgroups defined!
Checked 138 hosts.
Checked 3 host groups.
Checked 0 service groups.
Checked 12 contacts.
Checked 1 contact groups.
Checked 26 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 138 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: 1
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
Object precache file created:
/usr/local/nagios/var/objects.precache
[root@mpnagios objects]#
The thing here is that nagios wont stop and if i force to stop i canot start again till i fix the warnings
Re: CentOS errors
Posted: Tue Nov 19, 2013 2:05 pm
by lmiltchev
Have you modified the "/etc/init.d/nagios"? Please, post it for a review. Are you using a precache file?
Re: CentOS errors
Posted: Wed Nov 20, 2013 8:56 am
by MPIvan
No i have not modified ... here it is
Re: CentOS errors
Posted: Wed Nov 20, 2013 4:56 pm
by sreinhardt
That init script is definitely not something that would seem standard for a nagios install. Specifically looking, if any warning or errors are found when checking the configuration it immediately exits. On a standard init, this would proceed through fine. Try using the attached init instead and see how it works for you, or just altering line 54 to look like this:
This will avoid exiting on warnings, and only exit on error when checking the configs.