Page 5 of 8

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 2:37 pm
by donnyforbes
This is the same plugin from the previous that you worked on me with

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 3:02 pm
by tgriep
OK, take a look at the previous post then.

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 3:15 pm
by donnyforbes
ok I have been... everything looks correct. I looked at the script and even ran this line from it and got the correct output.

Code: Select all

[root@huey libexec]# $INFORMIXDIR/bin/onstat -
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 16:55:53 -- 1138808 Kbytes

[root@huey libexec]#

Code: Select all

[root@huey libexec]# /usr/local/nagios/libexec/check_informix.sh /usr/informix hueynet
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 17:29:51 -- 1138808 Kbytes
[root@huey libexec]#

Code: Select all

[code][root@nag libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -c check_informix -a '/usr/informix hueynet'
NRPE: Unable to read output
You have mail in /var/spool/mail/root
[root@nag libexec]#
[/code]

Not sure what is going on. I need to get this working and also, I have another one I need to get working as well.

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 3:28 pm
by tgriep
Login to the huey server and add the following lines to the /etc/sudoers file on the remote servers.

Code: Select all

nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_informix.sh
nagios ALL=NOPASSWD: /usr/informix/bin/onstat *
then run the following to test and see if the plugin runs as the nagios user and post the output.

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_informix.sh /usr/informix hueynet
It is passes, try running it from the Nagios server to see if it functions from there.

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 4:55 pm
by donnyforbes
I got this

Code: Select all

[nagios@huey ~]$ /usr/local/nagios/libexec/check_informix.sh /usr/informix hueynet
-bash: /usr/local/nagios/libexec/check_informix.sh: Permission denied
[nagios@huey ~]$
do I need to change the script to this
chmod 777 & chgrp nagios.nagios

Here is what the permission are now...

Code: Select all

[nagios@huey ~]$ ls -l /usr/local/nagios/libexec/check_informix.sh
-rwxr-x---. 1 root root 684 Nov 19 12:35 /usr/local/nagios/libexec/check_informix.sh

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 5:14 pm
by tgriep
Run these commands again to set the permissions on that plugin again.

Code: Select all

chown nagios.nagios /usr/local/nagios/libexec/check_informix.sh
chmod a+x /usr/local/nagios/libexec/check_informix.sh

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 5:21 pm
by donnyforbes
here is the output from the remote server.

Code: Select all

[nagios@huey ~]$ /usr/local/nagios/libexec/check_informix.sh /usr/informix hueynet
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 19:32:58 -- 1138808 Kbytes

Here is the output from the NAGIOS server.

Code: Select all

[root@nag libexec]# [nagios@huey ~]$ /usr/local/nagios/libexec/check_informix.sh /usr/informix hueynet
-bash: [nagios@huey: command not found
[root@nag libexec]# IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 19:32:58 -- 1138808 Kbytes
-bash: syntax error near unexpected token `('
[root@nag libexec]#

Also when I run this from NAGIOS

Code: Select all

[root@nag libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -c check_informix -a '/usr/informix hueynet'
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 19:37:43 -- 1138808 Kbytes
[root@nag libexec]#

Any thoughts?

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 5:37 pm
by donnyforbes
I tested on all 3 remote servers and NAGIOS server after making those changes. And it seems to be good. Here is the output from the NAGIOS server

Code: Select all

[root@nag libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.39.10 -c check_informix -a '/usr/informix louienet'
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (RSS) -- Up 23 days 16:31:38 -- 1138808 Kbytes
[root@nag libexec]#

[root@nag libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -c check_informix -a '/usr/informix hueynet'
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- Updatable (Sec) -- Up 20 days 19:48:19 -- 1138808 Kbytes
[root@nag libexec]#

[root@nag libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.43 -c check_informix -a '/usr/informix dueynet'
IBM Informix Dynamic Server Version 12.10.FC8W2WE -- On-Line (Prim) -- Up 23 days 16:34:54 -- 1204344 Kbytes
[root@nag libexec]#
Now what I need to do is add to nagios right? I have this in there already. I believe, I will send you a screenshot shortly...

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 5:41 pm
by tgriep
The correct command to run on the nagios server to run the plugin on the remote server is this.

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -c check_informix -a '/usr/informix hueynet'
which is your 3rd example in your post and it passed.

Your second example looks like you tried to run this as a command "[nagios@huey ~]$" which would fail as it is not valid.

Re: Informix Monitoring

Posted: Mon Nov 19, 2018 5:44 pm
by donnyforbes
I got the command to run on all 3 servers and NAGIOS. I went and enable the service that was in XI and here is the screenshot. What does the status of 'Unknown" mean" It should say "OK"