Page 1 of 2

Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 11:43 am
by Naveed
Team,

Few services in my nagios xi are showing duplicate services.

I have checked the required files but I can see that every service is defined only once.

I have just replace notification group in a one file with following command, after that 4-5 servers are showing duplicate entries.

I have attached screenshot for verification.

Need your suggestions to take care this.

Thank you!

Re: Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 1:54 pm
by bwallace
By any chance are there multiple Nagios processes running?
What does the output of ps -aef | grep nagios.cfg reveal?

If there are multiple nagios.cfg, then run these commands and let us know of the outcome:

Code: Select all

service nagios stop
killall -9 nagios
service nagios start

Re: Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 5:51 pm
by Naveed
Thank you for your reply.

[root@]# ps -aef | grep nagios.cfg
nagios 53656 1 1 15:45 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 53668 53656 0 15:45 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 53716 52917 0 15:45 pts/0 00:00:00 grep --color=auto nagios.cfg

I killed both processes and start nagios server. But still I can see that duplicate entries still exist.


I ran following command, do I need to kill all these processes as well?

[root@]# ps -ef |grep nagios
nagios 2124 1 0 Jun16 ? 00:01:08 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
nagios 18990 1 0 12:02 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios 55225 1 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 55226 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 55227 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 55228 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 55229 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios 55230 18990 0 15:48 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios 55231 55230 10 15:48 ? 00:00:01 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
nagios 55238 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 55280 55271 0 15:49 ? 00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1
nagios 55281 55272 0 15:49 ? 00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1
nagios 55282 55269 0 15:49 ? 00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1
nagios 55283 55270 0 15:49 ? 00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1
nagios 55284 55268 0 15:49 ? 00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1
nagios 55285 55283 3 15:49 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php
nagios 55286 55280 2 15:49 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php
nagios 55287 55281 2 15:49 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php
nagios 55288 55282 2 15:49 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php
nagios 55290 55284 2 15:49 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php
nagios 55409 55287 0 15:49 ? 00:00:00 sh -c /usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'
nagios 55410 55409 0 15:49 ? 00:00:00 /usr/bin/iostat -c 5 2
nagios 55411 55409 0 15:49 ? 00:00:00 tail --lines=2
nagios 55412 55409 0 15:49 ? 00:00:00 head --lines=1
nagios 55413 55409 0 15:49 ? 00:00:00 awk { print $1,$2,$3,$4,$5,$6 }
root 55433 52917 0 15:49 pts/0 00:00:00 grep --color=auto nagios

Thank you

Re: Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 6:34 pm
by Box293

Code: Select all

nagios 55225 1 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 55238 55225 0 15:48 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
You can see the second entry (55238) is a child of the first entry (55225), this is normal expected behaviour. There would be a concern if there were separate master instances of nagios running.

Looking at your screenshot:
Image

It actually looks like Nagios is working correctly and those services exist in your configuration files. The reason I say this is because:
Check CPU load
Check CPU Load
and
check drive status
Check Drive status

Use different uppercase / lowercase characters and are different.

All you need to do is delete the services in CCM that you don't want.

Re: Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 6:48 pm
by Naveed
Good point my dear.

But these duplicate services do not show in CCM, and also in nagios configuration files. I have already checked it, but nothing worked for me.

Further adding to this, as I delete one of my original service check CPU load, after restart all CPU Load services also disappear.

please suggest a solution.

Thank you

Re: Duplicate entries in nagios xi

Posted: Mon Jun 27, 2016 7:33 pm
by Box293
Please execute these two commands:

Code: Select all

grep -R -l 'Check CPU load' /usr/local/nagios/etc/
grep -R -l 'Check CPU Load' /usr/local/nagios/etc/
The results should be the name of the files those configs exist in.

Please post the config files here.

Re: Duplicate entries in nagios xi

Posted: Tue Jun 28, 2016 5:02 am
by Naveed
Thank you!

I have attached 3 config files for review.
Kindly see and help me out.

Thank you!

Re: Duplicate entries in nagios xi

Posted: Tue Jun 28, 2016 10:16 am
by rkennedy
I believe this is related to your current issue of the ghost services here at this point - https://support.nagios.com/forum/viewto ... 93#p187993

If not, please post your entire objects.cache file for us to look at - [/icode]/usr/local/nagios/var/objects.cache[/icode]. This will help us to see how your configurations are all compiled together, it could be a group.

Re: Duplicate entries in nagios xi

Posted: Tue Jun 28, 2016 12:31 pm
by Naveed
Hello,

I have attached required file to take a look into it.

Thank you!

Re: Duplicate entries in nagios xi

Posted: Tue Jun 28, 2016 3:31 pm
by rkennedy
I suspect you have multiple services defined for some hosts, some are lowercase while some are not as you can see here you have two for uptime -

Code: Select all

define service {
	host_name	UATAX01
	service_description	uptime
	check_period	xi_timeperiod_24x7
	check_command	check_nrpe!check_uptime!!!!!!!
	contacts	nagiosadmin,ddax
	contact_groups	admins
	notification_period	xi_timeperiod_24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	5
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	r,w,u,c
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	_XIWIZARD	nrpe
	}

define service {
	host_name	UATAX01
	service_description	Uptime
	check_period	xi_timeperiod_24x7
	check_command	check_nrpe!check_uptime!!!!!!!
	contacts	nagiosadmin,ddax
	contact_groups	admins
	notification_period	xi_timeperiod_24x7
	initial_state	o
	importance	0
	check_interval	5.000000
	retry_interval	1.000000
	max_check_attempts	5
	is_volatile	0
	parallelize_check	1
	active_checks_enabled	1
	passive_checks_enabled	1
	obsess	1
	event_handler_enabled	1
	low_flap_threshold	0.000000
	high_flap_threshold	0.000000
	flap_detection_enabled	1
	flap_detection_options	a
	freshness_threshold	0
	check_freshness	0
	notification_options	w,c,s
	notifications_enabled	1
	notification_interval	60.000000
	first_notification_delay	0.000000
	stalking_options	n
	process_perf_data	1
	retain_status_information	1
	retain_nonstatus_information	1
	_XIWIZARD	nrpe
	}