CentOS errors

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.
cbeattie
Posts: 19
Joined: Fri Oct 04, 2013 7:12 am

Re: CentOS errors

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CentOS errors

Post 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?
Former Nagios employee
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

Hi,
Yes it is all aright ... but warning is still different from error ... and i dont know way this is happening ..
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: CentOS errors

Post 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.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post 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 ...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: CentOS errors

Post by abrist »

Warnings will not cause nagios to not restart. Can you post the full output of the verification?
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.
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CentOS errors

Post by lmiltchev »

Have you modified the "/etc/init.d/nagios"? Please, post it for a review. Are you using a precache file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
MPIvan
Posts: 213
Joined: Thu Nov 22, 2012 6:09 am

Re: CentOS errors

Post by MPIvan »

No i have not modified ... here it is
Attachments
nagios.txt
Nagios init file
(3.2 KiB) Downloaded 302 times
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: CentOS errors

Post 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:

Code: Select all

	if test "${ERR}" = "0"; then
This will avoid exiting on warnings, and only exit on error when checking the configs.
Attachments
nagios.txt
(3.18 KiB) Downloaded 279 times
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.
Locked