count of hosts on CCM and Host summary mismatch

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jyoti22
Posts: 254
Joined: Mon Mar 23, 2015 4:50 am

count of hosts on CCM and Host summary mismatch

Post 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
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: count of hosts on CCM and Host summary mismatch

Post by WillemDH »

You might have hosts who are disactivated?
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: count of hosts on CCM and Host summary mismatch

Post 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.
Former Nagios Employee
jyoti22
Posts: 254
Joined: Mon Mar 23, 2015 4:50 am

Re: count of hosts on CCM and Host summary mismatch

Post 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?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: count of hosts on CCM and Host summary mismatch

Post 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.
jyoti22
Posts: 254
Joined: Mon Mar 23, 2015 4:50 am

Re: count of hosts on CCM and Host summary mismatch

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: count of hosts on CCM and Host summary mismatch

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: count of hosts on CCM and Host summary mismatch

Post 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?
Nagios XI 5.8.1
https://outsideit.net
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: count of hosts on CCM and Host summary mismatch

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked