External Commands not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: External Commands not working

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: External Commands not working

Post 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?
You do not have the required permissions to view the files attached to this post.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: External Commands not working

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External Commands not working

Post 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)
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: External Commands not working

Post 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 |
+-----------+-------------+---------------+------------------+----------------------------------+-----------+
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: External Commands not working

Post 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.
Locked