Page 2 of 2

Re: External Commands not working

Posted: Tue Jun 23, 2020 2:01 pm
by lmiltchev
Trying from commandline using the api worked fine:
You are not going to make this easy for me, are you? :)

Let's try this again from the GUI.

First, start a running tail on the cmdsubsys.log:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Next, from the Nagios XI web UI, go to Service Status > SSQL12 - Deadlocks, and click on Enable (or Disable) notifications link under the Quick Actions.

Check the output from the tail command. Do you see any clues?

Re: External Commands not working

Posted: Tue Jun 23, 2020 2:40 pm
by BanditBBS
I think I know what happened Ludmil, just need you guys to tell me how to resolve :?

So this is a customer of ours and we help them manage their XI installation. I was assisting them with something a week or so ago and I saw this host added with all caps SSQL12. All his other hosts are lowercase(for the most part) and my OCD kicked in and I mentioned it to him. He either deleted the host and re-added it with lowercase(instead of using bulk renaming tool)or manually renamed. It is all the services on this host that this is happening on. If I click on the host, cheek out what I get:
host.jpg
And look at this log data:
log.jpg
Looking at those somehow Nagios is still trying to use all caps hostname. I looked for any ghost config files(none) and also deleted the lowercase ones just to force it to rre-write and still issue persists.

Any ideas?

Re: External Commands not working

Posted: Tue Jun 23, 2020 4:56 pm
by lmiltchev
Can you run the following command from the CLI and show the output?

Code: Select all

echo "select * from nagios_objects where name2 like '%Deadlocks%';" | mysql -t -uroot -pnagiosxi nagios

Re: External Commands not working

Posted: Tue Jun 23, 2020 5:07 pm
by ssax
In addition to what @lmiltchev posted, what is the output of this command:

Code: Select all

chage -l nagios
Does the core interface show properly? (please check)

Re: External Commands not working

Posted: Tue Jun 23, 2020 6:58 pm
by BanditBBS
Hey guys:

Code: Select all

[root@nagiosxi ~]# chage -l nagios

Last password change                                    : Nov 01, 2016

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
Nagios Core interface shows everything just fine

And the sql query, here are the rows you are concerned with:

Code: Select all

+-----------+-------------+---------------+------------------+----------------------------------+-----------+
| object_id | instance_id | objecttype_id | name1            | name2                            | is_active |
+-----------+-------------+---------------+------------------+----------------------------------+-----------+
|      7442 |           1 |             2 | SSQL12           | SSQL12 - Deadlocks               |         1 |
|      7448 |           1 |             2 | ssql12           | SSQL12 - Deadlocks               |         0 |
+-----------+-------------+---------------+------------------+----------------------------------+-----------+

Re: External Commands not working

Posted: Wed Jun 24, 2020 1:51 pm
by ssax
There is a bug in XI 5.7+ with the new NDO on some systems with statuses not being updated in the XI interface (Core shows correctly), there is not currently a resolution for it, development is currently working the issue.

As a workaround, please do this to downgrade NDO3 to NDO2DB (they are entirely different) and it should resolve your issues:

Take an XI backup first just in case:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Code: Select all

systemctl stop nagios
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.6.14.tar.gz
tar zxf xi-5.6.14.tar.gz
cd /tmp/nagiosxi/subcomponents/ndoutils
./install
systemctl enable ndo2db
systemctl start ndo2db
Then edit your /usr/local/nagios/etc/nagios.cfg and make sure this line is uncommented:

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
Make sure this line is commented:

Code: Select all

#broker_module=/usr/local/nagios/bin/ndo.so /usr/local/nagios/etc/ndo.cfg
Then start the nagios service:

Code: Select all

systemctl start nagios
To fix the duplicate issue, please do this:

Code: Select all

mysql -uroot -pnagiosxi -h 127.0.0.1 -e "delete from nagios_objects where name1 like '%SSQL12%';"
Then apply configuration.

If you have a lot of these you can do this:

Code: Select all

mysql -uroot -pnagiosxi -h 127.0.0.1 -e "truncate table nagios_objects;"
Then apply config and it should be right as rain.