hosts check_enabled, state retention, stored in SQL

VEGH Karoly karoly.vegh at uta.at
Thu Dec 9 18:33:00 CET 2004


Hi.


I dont't quite understand what goes wrong, I have three questions.

Summary: checking hosts (e.g. check_command in hosts.cfg) does not update, or work.

I am using Nagios 1.3 on a debian linux, with mysql support...

atsrvlx02-new:/etc/nagios# /usr/sbin/nagios --version | head -4 

Nagios 1.3
Copyright (c) 1999-2004 Ethan Galstad (nagios at nagios.org)
Last Modified: 10-24-2004
atsrvlx02-new:/etc/nagios#


...with everthing in SQL:

atsrvlx02-new:/etc/nagios# grep ^x resource.cfg 
xsddb_database=our_nagios_db
xsddb_username=our_nagiosdb_user
xsddb_password=our_nagiosdbuser_pw
xcddb_database=our_nagios_db
xcddb_username=our_nagiosdb_user
xcddb_password=our_nagiosdbuser_pw
xdddb_database=our_nagios_db
xdddb_username=our_nagiosdb_user
xdddb_password=our_nagiosdbuser_pw
xrddb_database=our_nagios_db
xrddb_username=our_nagiosdb_user
xrddb_password=our_nagiosdbuser_pw
atsrvlx02-new:/etc/nagios#

atsrvlx02-new:/etc/nagios# grep ^x cgi.cfg
xeddb_database=our_nagios_db
xeddb_username=our_nagiosdb_user
xeddb_password=our_nagiosdbuser_pw
xsddb_database=our_nagios_db
xsddb_username=our_nagiosdb_user
xsddb_password=our_nagiosdbuser_pw
xcddb_database=our_nagios_db
xcddb_username=our_nagiosdb_user
xcddb_password=our_nagiosdbuser_pw
xdddb_database=our_nagios_db
xdddb_username=our_nagiosdb_user
xdddb_password=our_nagiosdbuser_pw
atsrvlx02-new:/etc/nagios# 


I would like to have my hosts (defined in hosts.cfg) be checked as well 
with check-host-alive in hosts.cfg, and therefore I added 

 checks_enabled                  1       ; Host checks are enabled

in my hosts.cfg to the generic host definition template which I 'use'
at all of my boxes.

Well, after done that I thought my hosts will be checked as well (check-host-alive)
and I don't need to add a service to the host to check the network connectivity.

To test this, I changed the host_address of the host to a nonexistent (not pingable) 
address, and waited for the host to turn 'red'.

It didn't.

I thought, okay, lets rtfm, and voila, in the docs I found the following:

---------------------------------------
It is important to point out that several directives in host and service 
definitions may not be picked up by Nagios when you change them. Host and 
service directives that can exhibit this behavior are marked with an 
asterisk (*). The reason for this behavior is due to the fact that Nagios 
chooses to honor values stored in the state retention file over values 
found in the config files, assuming you have state retention enabled on 
a program-wide basis.
--------------------------------------

OK, checks_enabled was overruled by the settings in retention, it seems so.
Well, since I store that information in a mysql db, i checked the values:

mysql> select host_name,checks_enabled from hostretention ; 
+------------------------------+----------------+
| host_name                    | checks_enabled |
+------------------------------+----------------+
| atsrvlx03.utalan.at          |              1 |
| c65wat4-vlan16.net.utalan.at |              0 |
+------------------------------+----------------+
2 rows in set (0.00 sec)

mysql> select host_name,checks_enabled from hoststatus; 
+------------------------------+----------------+
| host_name                    | checks_enabled |
+------------------------------+----------------+
| atsrvlx03.utalan.at          |              1 |
| c65wat4-vlan16.net.utalan.at |              0 |
+------------------------------+----------------+
2 rows in set (0.00 sec)

mysql>


Hm. This means, checks _are_ (were) enabled. Though I was given the 
status 'Host assumed to be up', checks are enabled, but the host didn't
turn 'red' though i explicitly gave it a nonexistent/wrong IP in the hosts.cfg 
as host_address.

Well that is my first question:

I. What did I do wrong with this? Feel free to ask for more information, 
if thats not enough.

The other curious thing, is that as you see, in the DB i had in both tables 
checks_enabled set on 1, but the Web-interface told me that they are set to 'No':

http://web.utanet.at/charlie/nagios_checks_enabled.png

Thats the second question: 

II. Do I mix things up, or is this inconsistent?

And here comes my third one:

As I added one service (a simple check_http) to the host in the services.cfg, 
and Nagios checked the service, at once both the service and the host turned 
red.

Thats the third question:
 
III. Do I need to add services to every host to be 
checked, or I again miss something?


any help is appreciated.


extra infos:

atsrvlx02-new:/etc/nagios# uname -a 
Linux atsrvlx02-new 2.6.9-rc3 #1 SMP Fri Oct 1 14:40:04 CEST 2004 i686 GNU/Linux
atsrvlx02-new:/etc/nagios# 

I have the following mysql and nagios related packages installed:

ii  libdbd-mysql-p 2.9003-3       A Perl5 database interface to the MySQL data
ii  libmysqlclient 3.23.56-2      LGPL-licensed client library for MySQL datab
ii  libmysqlclient 3.23.56-2      LGPL-licensed client development files for M
ii  libmysqlclient 4.0.21-7       mysql database client library
ii  mysql-admin    1.0.12-1       GUI tool for intuitive MySQL administration
ii  mysql-admin-co 1.0.12-1       Architecture independent files for MySQL Adm
ii  mysql-client   4.0.21-7       mysql database client binaries
ii  mysql-common   4.0.21-6       mysql database common files (e.g. /etc/mysql
ii  mysql-doc      4.0.21-2       mysql database documentation
ii  mysql-server   4.0.21-7       mysql database server binaries
ii  nagios-common  1.3-0+pre4     A host/service/network monitoring and manage
ii  nagios-mysql   1.3-0+pre4     A host/service/network monitoring and manage
ii  nagios-plugins 1.3.1.0-12     Plugins for the nagios network monitoring an



tia, and sorry for the rather lengthy mail.

charlie

-- 
 - Because it messes up the order in which you normally read text.
 - Why is top-posting such a bad idea?
 - Top-posting.
 - What is the most annoying thing on Usenet?


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list