Page 2 of 2

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 11:55 am
by swethog
Here you go. Not sure if those are the normal entries in the static directory or not.

Code: Select all

[root@<mon-server> ~]# service nagios stop
Stopping nagios:. done.
[root@<mon-server> ~]# killall nagios
nagios: no process killed
[root@<mon-server> ~]# service ndo2db stop
Stopping ndo2db: done.
[root@<mon-server> ~]# service ndo2db start
Starting ndo2db: done.
[root@<mon-server> ~]# service nagios start
Starting nagios: done.

Code: Select all

[root@<mon-server> ~]# ls -la /usr/local/nagios/etc/static
total 16
drwsrwsr-x 2 apache nagios 4096 Jul  1 13:51 .
drwxrwsr-x 7 apache nagios 4096 Jul  1 13:51 ..
-rwxrwxr-x 1 apache nagios  878 Jun 16 09:36 xiobjects.cfg
-rwxrwxr-x 1 apache nagios 4002 Jun 16 09:36 xitemplates.cfg
-rwxrwxr-x 1 apache nagios    0 Jun 16 09:36 xitest.cfg
From Nagios Core:

Code: Select all

Service Status Totals
Ok	Warning	Unknown	Critical	Pending
4889	    3   1	              3     	0
All Problems	All Types
7	                 4896

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 12:16 pm
by dwhitfield
Is the Service Summary count still ~4x after restarting the processes?

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 12:17 pm
by lmiltchev
In addition to this, what is the output of the following command?

Code: Select all

echo 'select count(*) from nagios_services;' | mysql -t -uroot -pnagiosxi nagios

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 2:49 pm
by swethog
Here you go.

[root@mon-server~]# echo 'select count(*) from nagios_services;' | mysql -t -uroot -pnagiosxi nagios
+----------+
| count(*) |
+----------+
| 9786 |
+----------+

yes, Service Status Summary is still showing ~+4x


Service Status Summary
Ok Warning Unknown Critical Pending
19534 12 0 20 6
Unhandled Problems All
32 32 19572
Last Updated: 2016-10-03 14:48:09

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 3:20 pm
by lmiltchev
Run the following command just in case you have some corrupted tables in the DB:

Code: Select all

mysqlcheck -r -f -uroot -pnagiosxi --all-databases
and restart mysqld.

Code: Select all

service mysqld restart
Also, try running reconfigure.sh as nagios user, and show us the output in case you get some errors:

Code: Select all

su nagios
cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
What is the output of the commands below?

Code: Select all

grep dbserver /usr/local/nagiosxi/html/config.inc.php
grep db_host /usr/local/nagios/etc/ndo2db.cfg

Re: Nagios XI service count not same in Service Summary and

Posted: Mon Oct 03, 2016 3:48 pm
by swethog
Here you go.

Code: Select all

[root@mon-server~]# mysqlcheck -r -f -uroot -pnagiosxi --all-databases
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.func                                         OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
nagios.nagios_acknowledgements                     OK
nagios.nagios_commands                             OK
nagios.nagios_commenthistory                       OK
nagios.nagios_comments                             OK
nagios.nagios_configfiles                          OK
nagios.nagios_configfilevariables                  OK
nagios.nagios_conninfo                             OK
nagios.nagios_contact_addresses                    OK
nagios.nagios_contact_notificationcommands         OK
nagios.nagios_contactgroup_members                 OK
nagios.nagios_contactgroups                        OK
nagios.nagios_contactnotificationmethods           OK
nagios.nagios_contactnotifications                 OK
nagios.nagios_contacts                             OK
nagios.nagios_contactstatus                        OK
nagios.nagios_customvariables                      OK
nagios.nagios_customvariablestatus                 OK
nagios.nagios_dbversion                            OK
nagios.nagios_downtimehistory                      OK
nagios.nagios_eventhandlers                        OK
nagios.nagios_externalcommands                     OK
nagios.nagios_flappinghistory                      OK
nagios.nagios_host_contactgroups                   OK
nagios.nagios_host_contacts                        OK
nagios.nagios_host_parenthosts                     OK
nagios.nagios_hostchecks                           OK
nagios.nagios_hostdependencies                     OK
nagios.nagios_hostescalation_contactgroups         OK
nagios.nagios_hostescalation_contacts              OK
nagios.nagios_hostescalations                      OK
nagios.nagios_hostgroup_members                    OK
nagios.nagios_hostgroups                           OK
nagios.nagios_hosts                                OK
nagios.nagios_hoststatus                           OK
nagios.nagios_instances                            OK
nagios.nagios_logentries                           OK
nagios.nagios_notifications                        OK
nagios.nagios_objects                              OK
nagios.nagios_processevents                        OK
nagios.nagios_programstatus                        OK
nagios.nagios_runtimevariables                     OK
nagios.nagios_scheduleddowntime                    OK
nagios.nagios_service_contactgroups                OK
nagios.nagios_service_contacts                     OK
nagios.nagios_service_parentservices               OK
nagios.nagios_servicechecks                        OK
nagios.nagios_servicedependencies                  OK
nagios.nagios_serviceescalation_contactgroups      OK
nagios.nagios_serviceescalation_contacts           OK
nagios.nagios_serviceescalations                   OK
nagios.nagios_servicegroup_members                 OK
nagios.nagios_servicegroups                        OK
nagios.nagios_services                             OK
nagios.nagios_servicestatus                        OK
nagios.nagios_statehistory                         OK
nagios.nagios_systemcommands                       OK
nagios.nagios_timedeventqueue                      OK
nagios.nagios_timedevents                          OK
nagios.nagios_timeperiod_timeranges                OK
nagios.nagios_timeperiods                          OK
nagiosql.tbl_command                               OK
nagiosql.tbl_contact                               OK
nagiosql.tbl_contactgroup                          OK
nagiosql.tbl_contacttemplate                       OK
nagiosql.tbl_domain                                OK
nagiosql.tbl_host                                  OK
nagiosql.tbl_hostdependency                        OK
nagiosql.tbl_hostescalation                        OK
nagiosql.tbl_hostextinfo                           OK
nagiosql.tbl_hostgroup                             OK
nagiosql.tbl_hosttemplate                          OK
nagiosql.tbl_info                                  OK
nagiosql.tbl_lnkContactToCommandHost               OK
nagiosql.tbl_lnkContactToCommandService            OK
nagiosql.tbl_lnkContactToContactgroup              OK
nagiosql.tbl_lnkContactToContacttemplate           OK
nagiosql.tbl_lnkContactToVariabledefinition        OK
nagiosql.tbl_lnkContactgroupToContact              OK
nagiosql.tbl_lnkContactgroupToContactgroup         OK
nagiosql.tbl_lnkContacttemplateToCommandHost       OK
nagiosql.tbl_lnkContacttemplateToCommandService    OK
nagiosql.tbl_lnkContacttemplateToContactgroup      OK
nagiosql.tbl_lnkContacttemplateToContacttemplate   OK
nagiosql.tbl_lnkContacttemplateToVariabledefinition OK
nagiosql.tbl_lnkHostToContact                      OK
nagiosql.tbl_lnkHostToContactgroup                 OK
nagiosql.tbl_lnkHostToHost                         OK
nagiosql.tbl_lnkHostToHostgroup                    OK
nagiosql.tbl_lnkHostToHosttemplate                 OK
nagiosql.tbl_lnkHostToVariabledefinition           OK
nagiosql.tbl_lnkHostdependencyToHost_DH            OK
nagiosql.tbl_lnkHostdependencyToHost_H             OK
nagiosql.tbl_lnkHostdependencyToHostgroup_DH       OK
nagiosql.tbl_lnkHostdependencyToHostgroup_H        OK
nagiosql.tbl_lnkHostescalationToContact            OK
nagiosql.tbl_lnkHostescalationToContactgroup       OK
nagiosql.tbl_lnkHostescalationToHost               OK
nagiosql.tbl_lnkHostescalationToHostgroup          OK
nagiosql.tbl_lnkHostgroupToHost                    OK
nagiosql.tbl_lnkHostgroupToHostgroup               OK
nagiosql.tbl_lnkHosttemplateToContact              OK
nagiosql.tbl_lnkHosttemplateToContactgroup         OK
nagiosql.tbl_lnkHosttemplateToHost                 OK
nagiosql.tbl_lnkHosttemplateToHostgroup            OK
nagiosql.tbl_lnkHosttemplateToHosttemplate         OK
nagiosql.tbl_lnkHosttemplateToVariabledefinition   OK
nagiosql.tbl_lnkServiceToContact                   OK
nagiosql.tbl_lnkServiceToContactgroup              OK
nagiosql.tbl_lnkServiceToHost                      OK
nagiosql.tbl_lnkServiceToHostgroup                 OK
nagiosql.tbl_lnkServiceToServicegroup              OK
nagiosql.tbl_lnkServiceToServicetemplate           OK
nagiosql.tbl_lnkServiceToVariabledefinition        OK
nagiosql.tbl_lnkServicedependencyToHost_DH         OK
nagiosql.tbl_lnkServicedependencyToHost_H          OK
nagiosql.tbl_lnkServicedependencyToHostgroup_DH    OK
nagiosql.tbl_lnkServicedependencyToHostgroup_H     OK
nagiosql.tbl_lnkServicedependencyToService_DS      OK
nagiosql.tbl_lnkServicedependencyToService_S       OK
nagiosql.tbl_lnkServiceescalationToContact         OK
nagiosql.tbl_lnkServiceescalationToContactgroup    OK
nagiosql.tbl_lnkServiceescalationToHost            OK
nagiosql.tbl_lnkServiceescalationToHostgroup       OK
nagiosql.tbl_lnkServiceescalationToService         OK
nagiosql.tbl_lnkServicegroupToService              OK
nagiosql.tbl_lnkServicegroupToServicegroup         OK
nagiosql.tbl_lnkServicetemplateToContact           OK
nagiosql.tbl_lnkServicetemplateToContactgroup      OK
nagiosql.tbl_lnkServicetemplateToHost              OK
nagiosql.tbl_lnkServicetemplateToHostgroup         OK
nagiosql.tbl_lnkServicetemplateToServicegroup      OK
nagiosql.tbl_lnkServicetemplateToServicetemplate   OK
nagiosql.tbl_lnkServicetemplateToVariabledefinition OK
nagiosql.tbl_lnkTimeperiodToTimeperiod             OK
nagiosql.tbl_logbook                               OK
nagiosql.tbl_mainmenu                              OK
nagiosql.tbl_service                               OK
nagiosql.tbl_servicedependency                     OK
nagiosql.tbl_serviceescalation                     OK
nagiosql.tbl_serviceextinfo                        OK
nagiosql.tbl_servicegroup                          OK
nagiosql.tbl_servicetemplate                       OK
nagiosql.tbl_settings                              OK
nagiosql.tbl_submenu                               OK
nagiosql.tbl_timedefinition                        OK
nagiosql.tbl_timeperiod                            OK
nagiosql.tbl_user                                  OK
nagiosql.tbl_variabledefinition                    OK

Code: Select all

[root@mon-server~]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

Code: Select all

[root@mon-server~]# su nagios
[nagios@<mon-server> root]$ cd /usr/local/nagiosxi/scripts
[nagios@mon-server scripts]$ ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=t4c3c6' -O nagiosql.login--2016-10-03 15:42:21--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

    [ <=>                                                                 ] 34,885      --.-K/s   in 0.05s   

2016-10-03 15:42:23 (735 KB/s) - `nagiosql.login' saved [34885]

LOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: http://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&username=nagiosxi&password=<snip>' -O nagiosql.login--2016-10-03 15:42:24--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

    [ <=>                                                                 ] 34,885      --.-K/s   in 0.07s   

2016-10-03 15:42:25 (520 KB/s) - `nagiosql.login' saved [34885]

LOGIN SUCCESSFUL!
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2016-10-03 15:42:25--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.export.monitoring'

    [     <=>                                                             ] 14,782      4.61K/s   in 3.1s    

2016-10-03 15:42:29 (4.61 KB/s) - `nagiosql.export.monitoring' saved [14782]

WRITE CONFIGS SUCCESSFUL!
OUTPUT: 
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://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 4896 services.
        Checked 611 hosts.
        Checked 16 host groups.
        Checked 0 service groups.
        Checked 35 contacts.
        Checked 10 contact groups.
        Checked 125 commands.
        Checked 26 time periods.
        Checked 0 host escalations.
        Checked 0 service escalations.
Checking for circular paths...
        Checked 611 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 26 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
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.

Code: Select all

[nagios@mon-server scripts]$ grep dbserver /usr/local/nagiosxi/html/config.inc.php
$cfg['dbserver']='localhost'; // this setting is no longer used - use settings below
                "dbserver" => 'localhost',
                "dbserver" => 'localhost',
                "dbserver" => 'localhost',
[nagios@mon-server scripts]$ grep db_host /usr/local/nagios/etc/ndo2db.cfg
db_host=localhost

Re: Nagios XI service count not same in Service Summary and

Posted: Tue Oct 04, 2016 9:25 am
by lmiltchev
This is very strange... Have you made any changes in MySQL, i.e. DB replication?

At this point, I believe we need to move this to our email ticketing system, and probably do a remote session to further troubleshoot the issue. If this is an option for you, please send your profile to [email protected].

Admin->System Profile->Download Profile

Type "Nagios XI service count not same in Service Summary and CCM" in the subject field, and provide a URL link to this forum post in the email's body. Thank you!

Re: Nagios XI service count not same in Service Summary and

Posted: Wed Nov 02, 2016 12:48 pm
by swethog
This problem was resolved with Tech Support and was caused by two instances of a database somehow. Once removed (lost 6 minutes from one day 6 weeks ago) everything came back ok.

Thanks everyone.

Re: Nagios XI service count not same in Service Summary and

Posted: Wed Nov 02, 2016 12:59 pm
by avandemore
Good to hear it's been resolved. If you have further issues, please open a new thread or ticket.