Page 1 of 2
services
Posted: Thu Mar 14, 2013 12:33 pm
by maxwellmiranda
i have deleted services of a particular node that i am monitoring but the services are still visible in the service detail link.....
i ran the repair database script but still no luck
Re: services
Posted: Thu Mar 14, 2013 12:34 pm
by slansing
How did you delete the services? Did you delete them from the command line? Or through the Core Config Manager and Applying configuration.
Re: services
Posted: Thu Mar 14, 2013 12:38 pm
by maxwellmiranda
i deleted them from core config manager.
i have applied the configuration as well
Re: services
Posted: Thu Mar 14, 2013 1:17 pm
by abrist
What version of XI are you running? There was a bug with a few previous versions where a change of the "config name" of a host or service would spawn ghost copy that would have to be removed by hand. It was resolved in 2012R1.3, but any "ghost" configs still have to be removed manually from the CLI.
To remove the "ghost service", do the following:
Code: Select all
root@localhost$ cd /usr/local/nagios/etc/services
This directory contains the cfg files written out by XI when you click "Apply Configuration". Get a listing of the directory and you should find the ghost service. Remove it.
Code: Select all
root@localhost services$ ls -la
root@localhost services$ rm <name of ghost service>
Now, before you "Apply Configuration" in XI or restart the Nagios server, try to "Write Configs to File". You will find this option in the CCM under "Tools" in left hand nav pane. Once they are written, click "Verify". If verification fails, you may have missed a ghost service cfg or you have other configuration problems. The output from the "Verify" button is in invaluable here.
If "Verify" fails DO NOT restart Nagios or "Apply Configuration". This will revert your configuration to the broken state (and subsequently write the ghost cfg files back to disk) . Instead, look for hints to the offending service or host in the verification output. Once you have fixed any new issues, "Write" and then "Verify" the config once again. You may have to "Write" and then "Verify" multiple times to hunt down all the issues/ghosted files.
Only "Restart" Nagios once all verification errors have been resolved (warnings do not need to be resolved to fix this issue). If Nagios restarts cleanly, "Apply Configuration" in XI. This will save a new, working configuration snapshot for any future configuration failures to roll back to.
Now restart nagios.
Code: Select all
root@localhost hosts$ service nagios restart
If all checks out and your ghost host issue is fixed, now would be a good time to upgrade to 2012R1.3 if you have not already. Let me know if this solved your issues or if you have any other related problems.
Re: services
Posted: Thu Mar 14, 2013 1:25 pm
by maxwellmiranda
i dont see the services in the /usr/local/nagios/etc/services directory...
i dont see the server as well...i dont think there is any ghost servicees here
Re: services
Posted: Thu Mar 14, 2013 1:40 pm
by sreinhardt
What version of XI are you running? ( bottom left corner)
Try to "Write Configs to File". You will find this option in the CCM under "Tools" in left hand nav pane. Once they are written, click "Verify". If verification fails, you may have missed a ghost service cfg or you have other configuration problems. The output from the "Verify" button is in invaluable here, please post it back to the forums.
If "Verify" fails DO NOT restart Nagios or "Apply Configuration". This will revert your configuration to the broken state (and subsequently write the ghost cfg files back to disk) . Instead, look for hints to the offending service or host in the verification output. Once you have fixed any new issues, "Write" and then "Verify" the config once again. You may have to "Write" and then "Verify" multiple times to hunt down all the issues/ghosted files.
Only "Restart" Nagios once all verification errors have been resolved (warnings do not need to be resolved to fix this issue). If Nagios restarts cleanly, "Apply Configuration" in XI. This will save a new, working configuration snapshot for any future configuration failures to roll back to.
Now restart nagios.
Code: Select all
root@localhost hosts$ service nagios restart
Re: services
Posted: Thu Mar 14, 2013 2:41 pm
by maxwellmiranda
i followed this steps...i am still seeing the ghost services...
there were no errors when i wrote the configuration files
Re: services
Posted: Thu Mar 14, 2013 2:46 pm
by abrist
Make sure you do not have multiple instances of Nagios running:
Code: Select all
service nagios stop
ps -aef | grep nagios
killall nagios
service nagios start
Run the following from the cli and post the output here in code wraps:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Re: services
Posted: Thu Mar 14, 2013 2:58 pm
by maxwellmiranda
i see the following processes after i stop nagios
do you want me to kill all these
Code: Select all
nagusgrd1:/usr/local/nagios/etc/hosts> ps -aef | grep nagios
nagios 2459 1 0 Feb25 ? 00:02:13 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
root 2575 2203 0 13:10 ? 00:00:00 sshd: nagios [priv]
nagios 2577 2575 0 13:10 ? 00:00:00 sshd: nagios@pts/2
nagios 2578 2577 0 13:10 pts/2 00:00:00 -ksh
nagios 2587 1 0 Feb25 ? 00:00:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
root 10123 2203 0 Mar08 ? 00:00:00 sshd: nagios [priv]
nagios 10149 10123 0 Mar08 ? 00:05:12 sshd: nagios@pts/0
nagios 10163 10149 0 Mar08 pts/0 00:00:00 -ksh
nagios 10216 1 0 Mar08 pts/0 00:00:00 dbus-launch --autolaunch 2771bc3ac9af4fa336a5af460000000a --binary-syntax --close-stderr
nagios 10217 1 0 Mar08 ? 00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
postgres 14307 2400 0 Mar10 ? 00:00:09 postgres: nagiosxi nagiosxi ::1(32916) idle
root 17240 2203 0 10:45 ? 00:00:00 sshd: nagios [priv]
nagios 17247 17240 0 10:45 ? 00:00:41 sshd: nagios@pts/1
nagios 17248 17247 0 10:45 pts/1 00:00:00 -ksh
nagios 17548 17248 3 10:46 pts/1 00:11:59 /usr/lib64/firefox/firefox
postgres 17550 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54465) idle
nagios 17579 1 0 10:46 pts/1 00:00:00 dbus-launch --autolaunch 2771bc3ac9af4fa336a5af460000000a --binary-syntax --close-stderr
nagios 17580 1 0 10:46 ? 00:00:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
nagios 17582 1 0 10:46 ? 00:00:01 /usr/libexec/gconfd-2
postgres 17775 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54514) idle
postgres 17778 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54515) idle
postgres 17804 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54520) idle
postgres 17933 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54555) idle
postgres 18148 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54606) idle
postgres 18498 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54686) idle
postgres 19216 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(54841) idle
postgres 24549 2400 0 Mar11 ? 00:00:05 postgres: nagiosxi nagiosxi ::1(39763) idle
postgres 24945 2400 0 Mar11 ? 00:00:05 postgres: nagiosxi nagiosxi ::1(39938) idle
postgres 24948 2400 0 Mar11 ? 00:00:05 postgres: nagiosxi nagiosxi ::1(39940) idle
postgres 25349 2400 0 Mar11 ? 00:00:05 postgres: nagiosxi nagiosxi ::1(40044) idle
nagios 26870 26869 0 15:56 ? 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 26871 26866 0 15:56 ? 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 26872 26867 0 15:56 ? 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 26873 26870 0 15:56 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php
nagios 26875 26868 0 15:56 ? 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 26876 26871 0 15:56 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php
nagios 26877 26865 0 15:56 ? 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 26878 26872 0 15:56 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php
nagios 26881 26875 0 15:56 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php
nagios 26884 26877 0 15:56 ? 00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php
postgres 26886 2400 0 15:56 ? 00:00:00 postgres: nagiosxi nagiosxi ::1(60944) idle
postgres 26887 2400 0 15:56 ? 00:00:00 postgres: nagiosxi nagiosxi ::1(60945) idle
postgres 26888 2400 0 15:56 ? 00:00:00 postgres: nagiosxi nagiosxi ::1(60946) idle
postgres 26892 2400 0 15:56 ? 00:00:00 postgres: nagiosxi nagiosxi ::1(60948) idle
postgres 26971 2400 0 15:56 ? 00:00:00 postgres: nagiosxi nagiosxi ::1(60958) idle
nagios 27136 2578 0 15:56 pts/2 00:00:00 ps -aef
nagios 27137 2578 0 15:56 pts/2 00:00:00 grep nagios
postgres 28188 2400 0 Mar10 ? 00:00:10 postgres: nagiosxi nagiosxi ::1(56915) idle
Re: services
Posted: Thu Mar 14, 2013 3:04 pm
by maxwellmiranda
this is the output of the command
i am pasting the initial and the last few lines of the output
Code: Select all
nagusgrd1:/usr/local/nagios/etc/hosts> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
.
.
.
.
.
.
Checked 194 services.
Checking hosts...
Checked 20 hosts.
Checking host groups...
Checked 6 host groups.
Checking service groups...
Checked 3 service groups.
Checking contacts...
Checked 10 contacts.
Checking contact groups...
Checked 4 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 115 commands.
Checking time periods...
Checked 15 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 181
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
nagusgrd1:/usr/local/nagios/etc/hosts>