Problem with check_kentix_multisensor


#1

hello,

i use ubuntu 16.04 and want to check my kentix multisensor lan. with the plugin from https://exchange.icinga.com/netways/check_kentix_multisensor/releases i get the following error:

# ./check_kentix_multisensor -h 192.168.105.21 -w temperature=~:25 -c temperature=~:30
Traceback (most recent call last):
  File "./check_kentix_multisensor", line 159, in <module>
    plugin.start()
  File "/home/admin/check_kentix/nagaconda/Plugin.py", line 440, in start
    (self.options, self.arguments) = self.__opt_parser.parse_args()
  File "/usr/lib/python2.7/optparse.py", line 1400, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1444, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1551, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/optparse.py", line 789, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.7/optparse.py", line 809, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/home/admin/check_kentix/nagaconda/Plugin.py", line 520, in convert_range
    bottom = float(bottom)
ValueError: could not convert string to float: /root

i tried a lot of thins, but im not very experienced in python.
does anyone know that error and can give me a hint?

btw: snmpget is working correctly:

# snmpget -v2c -c icinga 192.168.105.21 .1.3.6.1.4.1.37954.5.1.1.1.0
iso.3.6.1.4.1.37954.5.1.1.1.0 = INTEGER: 10

best regards,
markus


(Michael Friedrich) #2

I’ve just edited your output for better readability. Previously you’ve had enclosing ** characters. Those would be translated to /root by the bash, you are sure that the command did not have them inside?


#3

thanks for editing the output :slight_smile:

yes - i have copy&paste the command from the bash.
there are no ** inside the command.


(Michael Friedrich) #4

Hm. Then please don’t test as root, use sudo -u <icingausername> <command> to simulate how Icinga would execute the check.


#5

i get the same error with the monitoring-user :frowning:

nagios@ikaros:/usr/lib/nagios/plugins/check_kentix$ ./check_kentix_multisensor -h 192.168.105.21 -w temperature=~:25 -c temperature=~:30
Traceback (most recent call last):
File “./check_kentix_multisensor”, line 159, in
plugin.start()
File “/usr/lib/nagios/plugins/check_kentix/nagaconda/Plugin.py”, line 440, in start
(self.options, self.arguments) = self.__opt_parser.parse_args()
File “/usr/lib/python2.7/optparse.py”, line 1400, in parse_args
stop = self._process_args(largs, rargs, values)
File “/usr/lib/python2.7/optparse.py”, line 1444, in _process_args
self._process_short_opts(rargs, values)
File “/usr/lib/python2.7/optparse.py”, line 1551, in _process_short_opts
option.process(opt, value, values, self)
File “/usr/lib/python2.7/optparse.py”, line 789, in process
self.action, self.dest, opt, value, values, parser)
File “/usr/lib/python2.7/optparse.py”, line 809, in take_action
self.callback(self, opt, value, parser, *args, **kwargs)
File “/usr/lib/nagios/plugins/check_kentix/nagaconda/Plugin.py”, line 520, in convert_range
bottom = float(bottom)
ValueError: could not convert string to float: /var/lib/nagios
nagios@ikaros:/usr/lib/nagios/plugins/check_kentix$

do you have more hints for me?


(Michael Friedrich) #6

As you can see, the error changed to a different directory. There’s something wrong with the arguments parser, somehow it interprets a given argument into a bash-ism resolved directory.

I have the feeling that ~ is causing this. Looking at the plugin, this was last touched 2015 and likely only tested with Python 2.6. Might be the case that the arguments parser in 2.7 behaves differently, especially with special shell characters.

Try to enclose the argument values with single quotes, e.g. '~:25'.


#7

now i get a different error - but i also think it will be a problem with the different python versions.

nagios@ikaros:/usr/lib/nagios/plugins/check_kentix$ ./check_kentix_multisensor -h 192.168.105.21 -w temperature=’~:25’ -c temperature=’~:30’
Traceback (most recent call last):
File “./check_kentix_multisensor”, line 175, in
plugin.set_status_message("SNMP request failed: " + errorIndication)
TypeError: cannot concatenate ‘str’ and ‘RequestTimedOut’ objects
nagios@ikaros:/usr/lib/nagios/plugins/check_kentix$


(Michael Friedrich) #8

Hm. Please create two corresponding issues. One for the docs for the argument parser quotes, and one for this. Those issues can be looked at by my coworkers.


#9

really? should i open 2 new cases in this forum for that problem?


(Michael Friedrich) #10

On GitHub: https://github.com/NETWAYS/check_kentix_multisensor

This forum is a community platform, not a bug tracker :slight_smile:


#11

thanks - i´ve opened 2 new issues.


(Michael Friedrich) #12

Thanks. Looking at the stacktrace again, I’d say the plugin times out, e.g. it cannot reach the target OID or the server itself.


#13

ok - i will check the oids in the code…
a normal snmpget will respond very fast.

root@ikaros:/usr/lib/nagios/plugins/check_kentix# time snmpget -v2c -c icinga 192.168.105.21 .1.3.6.1.4.1.37954.5.2.2.1.2.1
iso.3.6.1.4.1.37954.5.2.2.1.2.1 = INTEGER: 300

real 0m0.010s
user 0m0.000s
sys 0m0.000s

root@ikaros:/usr/lib/nagios/plugins/check_kentix# time ./check_kentix_multisensor -h 192.168.105.21 -w temperature=’~:25’ -c temperature=’~:30’
Traceback (most recent call last):
File “./check_kentix_multisensor”, line 175, in
plugin.set_status_message("SNMP request failed: " + errorIndication)
TypeError: cannot concatenate ‘str’ and ‘RequestTimedOut’ objects

real 0m6.443s
user 0m0.308s
sys 0m0.052s
root@ikaros:/usr/lib/nagios/plugins/check_kentix#