Page 1 of 2

Problem with check_ifoperstatnag

Posted: Thu Jan 08, 2015 9:29 am
by b2m
Hi everyone

can you tell me why the following doesn't work:

Code: Select all

[root@wn203460 libexec]# /usr/local/nagios/libexec/check_ifoperstatnag 10149 -v2c -c communitystring 10.182.82.222
Usage /usr/local/nagios/libexec/check_ifoperstatnag: <interface index> <snmpget options>
  Check_ifoperstatus requires that the first argument be the interface index that this interface can be found at under the remote devices snmp tree.
  This should always be a positive integer, or zero.
  All options beyond the first, are arguments that must follow the snmpget command line parameters.
The plugin is from the newest version of the switch wizard.

BTW: Which permissions are correct for the plugins in /usr/local/nagios/libexec/ ?

Thanks a lot and best wishes

b2m

Re: Problem with check_ifoperstatnag

Posted: Thu Jan 08, 2015 12:49 pm
by tgriep
Try changing the command to what is below and see if it works for you.

Code: Select all

/usr/local/nagios/libexec/check_ifoperstatnag 49 10.182.82.222 -v2c -c communitystring 10.182.82.222
The permissions for that check is as follows

-rwxr-xr-x 1 nagios nagios check_ifoperstatnag

Re: Problem with check_ifoperstatnag

Posted: Fri Jan 09, 2015 1:40 am
by b2m
1) Not really:

Code: Select all

[root@wn203460 libexec]# ./check_ifoperstatnag 49 10.182.82.222 -v2c -c labnet 10.182.82.222
Usage ./check_test: <interface index> <snmpget options>
  Check_ifoperstatus requires that the first argument be the interface index that this interface can be found at under the remote devices snmp tree.
  This should always be a positive integer, or zero.
  All options beyond the first, are arguments that must follow the snmpget command line parameters.
With an older plugin-version it works fine:

Code: Select all

[root@wn203460 libexec]# ./check_ifoperstatnag 10149 -v2c -c labnet 10.182.82.222
OK - Interface GigabitEthernet1/0/49 (index 10149) is up.
The usage should stay the same in the new version.

2) Could you send me a complete ls -lah of the libexec-directory? My permissions of many plugins seem to be messed up and I want to fix that.

Thanks.

Re: Problem with check_ifoperstatnag

Posted: Fri Jan 09, 2015 10:59 am
by sreinhardt
Permissions on libexec files should be 755 and either root:root, or nagios:nagcmd. Personally I prefer restricting write permission to root only. Otherwise, I see that you checked different interfaces there, please use the same interface and remote device for all tests, so that we have commonality in knowing that it is something properly working for other checks. Also, which previous, and what current versions are you running? check_ifoperstatusnag --version should provide the output we are looking for.

Re: Problem with check_ifoperstatnag

Posted: Mon Jan 12, 2015 2:16 am
by b2m
There is no --version.

Old (from an older version of Switch Wizard):

Code: Select all

[root@wn203460 libexec]# ./check_ifoperstatnag 10149 -v2c -c communitystring 10.182.82.222
OK - Interface GigabitEthernet1/0/49 (index 10149) is up.
New (from Switch Wizard 2.1.6 - 01/07/2015):

Code: Select all

[root@wn203460 libexec]# ./check_ifoperstatnag 10149 -v2c -c communitystring 10.182.82.222
Usage ./check_ifoperstatnag: <interface index> <snmpget options>
  Check_ifoperstatus requires that the first argument be the interface index that this interface can be found at under the remote devices snmp tree.
  This should always be a positive integer, or zero.
  All options beyond the first, are arguments that must follow the snmpget command line parameters.
When the permissions are "root:root 755" upgrade of the wizards via the web interface (Admin -> Manage Config Wizards) does not work, right?

Re: Problem with check_ifoperstatnag

Posted: Mon Jan 12, 2015 3:10 pm
by tgriep
There seems to be an issue with that version of the plugin and we are looking in to it.
For now, you may have to revert to the older version of the plugin.

Re: Problem with check_ifoperstatnag

Posted: Mon Jan 12, 2015 4:17 pm
by b2m
Alright, please tell me when there is something new.

When the permissions are "root:root 755" upgrade of the wizards via the web interface (Admin -> Manage Config Wizards) does not work, right?
b2m

Re: Problem with check_ifoperstatnag

Posted: Mon Jan 12, 2015 4:59 pm
by tgriep
Most of my plugins are set 755 root.root and I can update them.

I'll attach a file of my libexec folder showing the permissions.

Re: Problem with check_ifoperstatnag

Posted: Fri Jan 16, 2015 8:07 am
by b2m
For me the update does not work.

Are there any news?

Re: Problem with check_ifoperstatnag

Posted: Fri Jan 16, 2015 10:41 am
by tgriep
Yes, we found the bug in the script and it should be updated soon.
If you want , you can edit the check_ifoperstatnag pluging and change line 15 from

if test -z "$1" || ! [[ "$1" =~ '^[0-9]+$' ]]; then

to

Code: Select all

if test -z "$1" || ! [[ "$1" =~ ^[0-9]+$ ]]; then
That should fix the problem you are having.