Page 1 of 1

count of hosts on CCM and Host summary mismatch

Posted: Wed Nov 09, 2016 5:09 am
by jyoti22
Hi Team,

The count of hosts on CCM is showing different value than on the host summary. Version is Nagios XI 5.3.1

Kindly request you to help with this.

Regards,
Beena

Re: count of hosts on CCM and Host summary mismatch

Posted: Wed Nov 09, 2016 6:56 am
by WillemDH
You might have hosts who are disactivated?

Re: count of hosts on CCM and Host summary mismatch

Posted: Wed Nov 09, 2016 11:22 am
by rkennedy
Thanks @WillemDH!

This is correct, one other thing is the number will not be the same if you are using any sort of templates or services with multiple hosts or a host group assigned.

Re: count of hosts on CCM and Host summary mismatch

Posted: Wed Nov 09, 2016 11:48 pm
by jyoti22
Yes we have multiple host groups and hosts assigned to them. But we have these host groups with multiple hosts assigned from the very beginning. We see the host count discrepancies recently. Why does this happen? Is that the data not being written into MySQL DB?

Re: count of hosts on CCM and Host summary mismatch

Posted: Thu Nov 10, 2016 10:05 am
by ssax
Do you have multiple nagios servers pointing to the same DB?

What is the output of these commands:

Code: Select all

ps aux | grep nagios.cfg
ipcs -q
echo "select * from nagios_instances;" | mysql -uroot -pnagiosxi nagios
Sometimes if there are multiple instances in the DB you will see that effect.

Re: count of hosts on CCM and Host summary mismatch

Posted: Thu Nov 10, 2016 10:58 pm
by jyoti22
Please find the output as requested

Last login: Tue Nov 8 22:01:40 2016 from irv-rdsh04-01.epicor.net
[root@auscrpmonprd00 ~]# ps aux | grep nagios.cfg
nagios 18106 2.0 0.1 60060 26892 ? Ss 05:41 19:24 /usr/local/nagi os/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 18218 0.0 0.0 47244 7340 ? S 05:41 0:02 /usr/local/nagi os/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 20903 1.8 0.2 69984 37712 ? Ss Oct27 392:49 /usr/local/nagi os/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 24563 0.0 0.0 103256 888 pts/0 S+ 21:47 0:00 grep nagios.cfg
You have new mail in /var/spool/mail/root
[root@auscrpmonprd00 ~]# ipcs -q

------ Message Queues --------
key msqid owner perms used-bytes messages
0x95000002 256573440 nagios 600 0 0
0xf9000002 262209537 nagios 600 0 0
0x1c000002 259031042 nagios 600 0 0
0x18000002 259227651 nagios 600 0 0
0x25000002 259293188 nagios 600 0 0
0x9d000002 259424263 nagios 600 0 0
0x3c000002 259751944 nagios 600 0 0
0x4d000002 259686409 nagios 600 0 0
0xdd000002 259817483 nagios 600 0 0
0x2c000002 259948556 nagios 600 0 0
0x34000002 259981325 nagios 600 0 0
0x94000002 260079630 nagios 600 18234368 17807
0x22000002 260046863 nagios 600 0 0
0x99000002 260112400 nagios 600 0 0
0xc7000002 260276241 nagios 600 0 0
0x66000002 260177938 nagios 600 1024 1
0x59000002 260243475 nagios 600 0 0
0x21000002 260440084 nagios 600 0 0
0x63000002 260636694 nagios 600 0 0
0x47000002 260702232 nagios 600 0 0

[root@auscrpmonprd00 ~]# echo "select * from nagios_instances;" | mysql -uroot -pnagios nagios
instance_id instance_name instance_description
1 localhost

Re: count of hosts on CCM and Host summary mismatch

Posted: Fri Nov 11, 2016 12:59 pm
by tgriep
It look like there are multiple Nagios processes running on your server which will cause the issue you are seeing.
To stop the extra processes and clean out the Kernel Message Queue, login as root to the server and run the following.

Code: Select all

service nagios stop
killall -9 nagios
service ndo2db stop
for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
service ndo2db start
service nagios start
Then login to the XI interface and see if the numbers are correct now.

Re: count of hosts on CCM and Host summary mismatch

Posted: Fri Nov 11, 2016 1:11 pm
by WillemDH
TGriep, Can I as why this is done?

Code: Select all

service ndo2db stop
for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
service ndo2db start
jyoti22,

Are you using Mod Gearman? If so what version?

Re: count of hosts on CCM and Host summary mismatch

Posted: Fri Nov 11, 2016 1:31 pm
by tgriep
Willem, those commands are run to clear out the Kernel Message Queue.
The output of the ipcs -q command showed that there were extra Message Queues and that will clean them out.
Multiple nagios processes running on a system could create extra queues and this will clear them out.