Problem with check_ifoperstatnag

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Problem with check_ifoperstatnag

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with check_ifoperstatnag

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Problem with check_ifoperstatnag

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Problem with check_ifoperstatnag

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Problem with check_ifoperstatnag

Post 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?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with check_ifoperstatnag

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Problem with check_ifoperstatnag

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with check_ifoperstatnag

Post 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.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Problem with check_ifoperstatnag

Post by b2m »

For me the update does not work.

Are there any news?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Problem with check_ifoperstatnag

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked