Nagios reporting unexistent services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Nagios reporting unexistent services

Post by vmesquita »

Nagios is reporting errors on services which don't actually exist. I am sending only a sample, but there are other hosts in the same situation. In some other cases, when the host actually exists and has that service, check results result in warning, however if I test the command using the "Test Check Command" on CCM, I get an OK.
I have tried restarting Nagios XI and also repairing the MySql database (folowing the provided instructions), with no improvent. Any ideas?
You do not have the required permissions to view the files attached to this post.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios reporting unexistent services

Post by gormank »

Have a look under configure, CCM, and under tool, the write config files item. There you can verify config files, delete, then write new.
Or just try an apply configuration to overwrite what's there. I think that's the same as write new above w/o the verify or delete.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Nagios reporting unexistent services

Post by vmesquita »

I tried to write, verify and restart Nagios but still same problem. Would it be safe to"Delete All Host / Service Configuration Files" using the provided option and then write the files?

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios reporting unexistent services

Post by gormank »

It should be fine.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Nagios reporting unexistent services

Post by vmesquita »

Ok. I did a "Delete All Host / Service Configuration Files", double checked that "/usr/local/nagios/etc/services/" was completelly empty, then "Write Configs To File" ans Restart Nagios, but still nothing changed.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios reporting unexistent services

Post by gormank »

Is anything suspicious in the static dir?

ll /usr/local/nagios/etc/static/

Do those services run on any hosts?

I'd have a look in /usr/local/nagios/etc/services for the services, and /usr/local/nagios/etc/hosts at that host...
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Nagios reporting unexistent services

Post by vmesquita »

On static folder there seems to be only default files:

Code: Select all

ll /usr/local/nagios/etc/static/
total 8
-rwxrwxr-x 1 apache nagios  878 Jan  5 18:04 xiobjects.cfg
-rwxrwxr-x 1 apache nagios 4002 Jan  5 18:04 xitemplates.cfg
-rwxrwxr-x 1 apache nagios    0 Jan  5 18:04 xitest.cfg
In other hosts there are services with the same name. For instance, there are many services named "yum Updates" for other hosts, but not for the one in question. If I do a:

Code: Select all

[root@nagios etc]# pwd
/usr/local/nagios/etc
[root@nagios etc]# find ./ -type f -exec grep -H 'vb139' {} \;
./hostgroups.cfg:       members                                 
<...>
./services/vb139.selic.bc.cfg:  host_name                       vb139.selic.bc
./hosts/vb139.selic.bc.cfg:     host_name                       vb139.selic.bc
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios reporting unexistent services

Post by lmiltchev »

Are you sure these services don't exist in the CCM (database)? Is it possible, that you have services added to multiple hosts/hostgroups?

You searched for "vb139". What do you find, when you search for the service description, i.e. "Total Processes", "Swap Free", etc. Can you post the configs of these services (if you find any)?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Nagios reporting unexistent services

Post by vmesquita »

If I search for Yum Updates or Total Process, I get a list of cfg files in /usr/local/nagios/etc/services, one for each other host (each one actually have this service), but no vb139.cfg, for instance. There are many cfg files for each of those services (one for each server) since they were created by the wizard. For instance, this is the one from va137 host, which is not suffering from this issue:

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date:       2016-02-10 16:11:55
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
        host_name                       va137
        service_description             / Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /'
        max_check_attempts              3
        check_interval                  60
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             /boot Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /boot'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxxxxxxx

        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             CPU Stats
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_cpu_stats!-a '-w 70,40,30 -c 90,60,40'!!!!!!
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxx-xxxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }
define service {
        host_name                       va137
        service_description             Load
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }
define service {
        host_name                       va137
        service_description             MicroStrategy IntelligenceServer
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_services!-a 'MSTRSvr'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             MicroStrategy Listener
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_services!-a 'MSTRLsn'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             NTP
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_services!-a 'ntpd'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             Open Files
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_open_files!-a '-w 30 -c 50'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             Ping
        use                             xiwizard_linuxserver_ping_service
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  xxxxxxxxxxxx
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             Swap Free
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_swap!-a '-w 50% -c 20%'!!!!!!
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       va137
        service_description             Total Processes
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_procs!-a '-w 200 -c 250'!!!!!!
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        notifications_enabled           1
        contact_groups                  Equipe-Banco_Dados,Equipe-SO
        _xiwizard                       linux-server
        register                        1
        }
define service {
        host_name                       va137
        service_description             Users
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_users!-a '-w 5 -c 10'
        max_check_attempts              3
        check_interval                  7
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           720
        notification_period             xi_timeperiod_24x7
        contact_groups                  Equipe-Banco_Dados,Equipe-SO
        _xiwizard                       linux-server
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios reporting unexistent services

Post by gormank »

Can you post the vb139.selic.bc.cfg files?

I see you appear to have removed the parts of find output that show vb139 in one or more hostgroups. This could be where the trouble is. You can add a host to a hostgroup, and apply the hostgroup to a service.

Code: Select all

./hostgroups.cfg:       members                                 
<
...>

Can you post the deleted output?

The host vb139 exists, and the services exist under it. You just need to find how they're connected.
Locked