Page 1 of 2

Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 10:44 am
by ivp2015
Hi Team,
We removed Host and Services from Nagios Xi but after removed still showing Host and Services in Nagios XI
Please find out the attachment for the same.

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 10:57 am
by benjaminsmith
Hello @ivp2015,

After making changes, did you successfully Apply Configuration? If there's an error in the configs, it would revert back to the last known good configuration.

Otherwise, you may have more than one Nagios process running and please run through the commands to completely re-start Nagios XI.

Code: Select all

systemctl stop crond
systemctl stop npcd
systemctl stop nagios
systemctl stop ndo2db
pkill -9 -u nagios
for i in $(ipcs -q | grep nagios |awk '{print $2}'); do ipcrm -q $i; done
rm -rf /usr/local/nagiosxi/var/dbmaint.lock
rm -rf /usr/local/nagiosxi/var/event_handler.lock
rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
systemctl restart mariadb
systemctl start ndo2db
systemctl start nagios
systemctl start npcd
systemctl start crond

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 11:56 am
by ivp2015
Yes i click on Apply Configuration after changes, We will do this activity after take the backup of Nagios Server.

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 12:03 pm
by ivp2015
Is there any possibility to crash Nagios xi after running given commands.

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:09 pm
by ivp2015
Issue resolved now, but we are getting an error in System problem,
Please find out the attachment.

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:10 pm
by benjaminsmith
No, but a simplified version would be to just stop and re-start the nagios service.

Code: Select all

systemctl stop nagios.service
killall nagios
systemctl start nagios.service

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:24 pm
by ivp2015
[root@ivpnagiosprod ~]# service nagios stop
Stopping nagios:. done.
[root@ivpnagiosprod ~]# killall nagios
nagios: no process killed
[root@ivpnagiosprod ~]# service nagios start
Starting nagios: done.
[root@ivpnagiosprod ~]#

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:26 pm
by ivp2015
[root@ivpnagiosprod ~]# service nagios stop
Stopping nagios:. done.
[root@ivpnagiosprod ~]# killall nagios
nagios: no process killed
[root@ivpnagiosprod ~]# service nagios start


[root@ivpnagiosprod ~]# lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.3 (Final)
Release: 6.3
Codename: Final
[root@ivpnagiosprod ~]#

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:40 pm
by scottwilkerson
Can you show the results of the following commands

Code: Select all

chage -l nagios
grep nagios /var/log/cron|tail -20

Re: Unable to Remove host from Nagios Xi

Posted: Fri Oct 18, 2019 1:43 pm
by ivp2015
[root@ivpnagiosprod ~]# chage -l nagios
Last password change : Feb 17, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

[root@ivpnagiosprod ~]# grep nagios /var/log/cron|tail -20

Oct 18 23:30:01 ivpnagiosprod CROND[7592]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php > /usr/local/nagiosxi/var/dbmaint.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7593]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7595]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.l og 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7597]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok)
Oct 18 23:30:01 ivpnagiosprod CROND[7598]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>& 1)
Oct 18 23:30:01 ivpnagiosprod CROND[7596]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/deadpool.php > /usr/local/nagiosxi/var/deadpool.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7600]: (root) CMD (/usr/lib/sa/sa1 1 1)
Oct 18 23:30:01 ivpnagiosprod CROND[7599]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7602]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7603]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7607]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.l og 2>&1)
Oct 18 23:30:01 ivpnagiosprod CROND[7606]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8761]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.l og 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8766]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.l og 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8765]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8762]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8769]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8764]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>& 1)
Oct 18 23:31:01 ivpnagiosprod CROND[8768]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1)
Oct 18 23:31:01 ivpnagiosprod CROND[8767]: (nagios) CMD (/usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1)
[root@ivpnagiosprod ~]#