Page 1 of 1

Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 9:01 am
by chicjo01
I am seeing a number of duplicate services showing up in the Service Detail. Is there a way to correct it, there should be only 1 service.

Nagios XI Version: 5.2.8
[root@<Nagios Server> etc]# cat <Server>.cfg
define host {
host_name 010 N ADL <Server>
use <Template>
alias xxx.xxx.xxx.xxx
address <DNS Name>
hostgroups app+adl+esp
register 1
}
[root@<Nagios Server> etc]# cat <Service>.cfg
define service {
service_description ESP URL /WsADL/ComprehensiveADL
use <Template>
hostgroup_name app+adl+esp
check_command <Http Check>
contact_groups app+adl+esp
register 1
}
010 N ADL <Server>
ESP URL /WsADL/ComprehensiveADL Ok 27d 23h 54m 7s 1/2 2016-06-14 09:46:32 HTTP OK: HTTP/1.1 200 OK - 452 bytes in 0.106 second response time
ESP URL /WsADL/ComprehensiveADL Ok 27d 23h 54m 7s 1/2 2016-06-14 09:46:32 HTTP OK: HTTP/1.1 200 OK - 452 bytes in 0.106 second response time
ESP URL /WsADL/ComprehensiveADL Ok 27d 23h 54m 7s 1/2 2016-06-14 09:46:32 HTTP OK: HTTP/1.1 200 OK - 452 bytes in 0.106 second response time
ESP URL /WsADL/ComprehensiveADL Ok 27d 23h 54m 7s 1/2 2016-06-14 09:46:32 HTTP OK: HTTP/1.1 200 OK - 452 bytes in 0.106 second response time

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 10:28 am
by bwallace
By any chance are there multiple Nagios processes running?
What does the output of ps -aef | grep nagios.cfg reveal?

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 10:34 am
by chicjo01
Holy Smoke. How many are supposed to be running?

[root@<Nagios Server ~]# ps -aef | grep nagios.cfg
nagios 1267 1 9 11:32 ? 00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 1469 1267 0 11:32 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 37805 1 0 Jun13 ? 00:00:17 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 37954 37805 0 Jun13 ? 00:00:05 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 66634 1 0 Jun10 ? 00:00:08 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 66741 66634 0 Jun10 ? 00:00:14 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 95626 1 0 Jun10 ? 00:00:08 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 95737 95626 0 Jun10 ? 00:00:13 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 129932 1 0 Jun11 ? 00:00:15 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 130050 129932 0 Jun11 ? 00:00:10 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 138664 1 0 Jun13 ? 00:00:08 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 138801 138664 0 Jun13 ? 00:00:04 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 141078 1 0 Jun12 ? 00:00:15 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 141196 141078 0 Jun12 ? 00:00:08 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 11:09 am
by bwallace
Multiple parent (PPID) processes are what we need to be concerned about - the Nagios process forks itself to run checks therefor sub-processes are normal.
That being said, you have multiple Nagios processes running, which can cause problems. To resolve, run these commands and after a period of monitoring,
let us know of the outcome.

Code: Select all

killall -9 nagios
service nagios start

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 12:05 pm
by chicjo01
There is something which is causing the Nagios services to start back up. I used the below command to kill all the nagios processes.
ps -ef | grep nagios | awk '{print $2}' | xargs kill -9

After the restart:
[root@<Nagios Server> ~]# ps -ef | grep nagios.cfg
nagios 92835 1 4 13:03 ? 00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 92891 92835 0 13:03 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 12:56 pm
by chicjo01
The issue with the duplicate in the service details is still there.

Re: Duplicate Services Showing in Service Details

Posted: Tue Jun 14, 2016 3:27 pm
by tgriep
Having 2 nagios processes is OK, one parent and one child is normal.

It could be that having multiple processes running, the configs became out of sync, try going through this process and see if that removes the duplicates for you.

Go to the Core Config Manager
Under "Tools", click "Write Config Files"
Click the "Delete" button then click the "Write" button and then the "Verify" button
If you get any errors, resolve them and click on the "Write", "Verify" until all of the errors are resolved.
Click the Apply Configuration link and click the "Apply Configuration" button

Re: Duplicate Services Showing in Service Details

Posted: Wed Jun 15, 2016 8:05 am
by chicjo01
I have followed the instructions, but I am still seeing 4 entries.

Re: Duplicate Services Showing in Service Details

Posted: Wed Jun 15, 2016 9:48 am
by lmiltchev
Try stopping/starting services to see if this is going to solve your issue.

Code: Select all

service nagios stop
service ndo2db stop
service ndo2db start
service nagios start
If you continue to have issues, send your profile to [email protected]. This will open a new support ticket in our email ticketing system.

Admin->System Profile->Download Profile