CygnusNetworks / check_ruckus_vsz

Ruckus Virtual Smartzone Nagios Check
Apache License 2.0
3 stars 1 forks source link

Not detect VsZ #2

Closed jeremyit closed 4 years ago

jeremyit commented 4 years ago

Hi, I've tried your plugin to check my ap status from my Virtual SmartZone, this is the return


RUCKUSVSZ UNKNOWN - Device is not a Ruckus SCG device - System description is SmartZone - No data available
unknown: Device is not a Ruckus SCG device - System description is SmartZone

Is not compatible ?

cygnusb commented 4 years ago

Which Version are you running? My guess is you are running a much newer version then we are and this has not been tested on current versions. (our version is 3.5) You can try and change:

if not str(self.snmpclient.sysdescr).startswith("SmartCell Gateway"):

to:

if not str(self.snmpclient.sysdescr).startswith("SmartZone"):

This should enable you to get over this sanity check. Please let me know if there are other issue afterwards. I hope the basic SNMP MIBs have not changed. So my guess is that it could work even with newer versions.

jeremyit commented 4 years ago

I am currently on 3.5 but soon on 5.1. Migration is planned. I've done replacement in code but same issue

./check_ruckus_vsz -H 192.168.X.X -C xx-vvv RUCKUSVSZ UNKNOWN - Device is not a Ruckus SCG device - System description is SmartZone - No data available unknown: Device is not a Ruckus SCG device - System description is SmartZone Probing Ruckus SCG device 192.168.x.X through SNMP Queried Ruckus SCG device 192.168.x.X through SNMP - device is reachable Found Sysname vsz01 and sysdescr SmartZone

cygnusb commented 4 years ago

Can you send me the first lines of a snmpwalk of the device (20 or so)? In addition you can simply remove the lines:

if not str(self.snmpclient.sysdescr).startswith("SmartCell Gateway"):
            raise nagiosplugin.CheckError("Device is not a Ruckus SCG device - System description is %s" % self.snmpclient.sysdescr)

and check again?

jeremyit commented 4 years ago

Same issue with 2 lines removed. snmpwalk.txt

cygnusb commented 4 years ago

Thanks. It seems that you have two versions on your system. The one installed and the one on the checkout. With the two lines removed the issue cannot happen, if you use the correct source.

Please make sure the two lines are remove and then reinstall using:

python setup.py install

This will make sure that the installed version has also the two lines removed

cygnusb commented 4 years ago

And one more question: Is your system a Smartzone 100 or 300? Like a phyiscally installed box or just a virtual machine?

jeremyit commented 4 years ago

ok, done. Now this is output RUCKUSVSZ UNKNOWN: MibNotFoundError: No module RUCKUS-SCG-SYSTEM-MIB loaded at <pysnmp.smi.builder.MibBuilder object at 0x7fcc68832050>caused by <type 'exceptions.ValueError'>: invalid literal for int() with base 10: 'RUCKUS-SCG-SYSTEM-MIB::ruckusSystemStatsWLANTotalRxPkts' It's only a VM so called VirtualSmartZone

cygnusb commented 4 years ago

Same as ours. Can you try calling it from the git checkout directly? ./check_ruckus_vsz .... and not from the installed version? The MibNotFoundError results from the script not able to find the mib. If you call it directly from the git checkout it should propably work

cygnusb commented 4 years ago

I think I found the issue. Need to add an option to the setup.py. Please stash your changes and pull from github. That should solve your issue on the installed version

jeremyit commented 4 years ago

done, now : RUCKUSVSZ UNKNOWN: RuntimeError: Cannot query oid %r if multiple varBinds keys are present

cygnusb commented 4 years ago

Strange. Same as #1 but you are running the same version we are running. Can you please pull again and execute with -vvv option. I added some more debug output to clarify why this happens

jeremyit commented 4 years ago

OK cygnusb. Thanks.

RUCKUSVSZ UNKNOWN: RuntimeError: Cannot query oid None if multiple varBinds keys are present: []
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nagiosplugin/runtime.py", line 43, in wrapper
    return func(*args, **kwds)
  File "/usr/lib/python2.7/site-packages/check_ruckus_vsz-0.13-py2.7.egg/EGG-INFO/scripts/check_ruckus_vsz", line 399, in main
    check.main(args.verbose, timeout=args.timeout)
  File "/usr/lib/python2.7/site-packages/nagiosplugin/check.py", line 120, in main
    runtime.execute(self, verbose, timeout)
  File "/usr/lib/python2.7/site-packages/nagiosplugin/runtime.py", line 128, in execute
    with_timeout(self.timeout, self.run, check)
  File "/usr/lib/python2.7/site-packages/nagiosplugin/platform/posix.py", line 19, in with_timeout
    func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nagiosplugin/runtime.py", line 117, in run
    check()
  File "/usr/lib/python2.7/site-packages/nagiosplugin/check.py", line 105, in __call__
    self._evaluate_resource(resource)
  File "/usr/lib/python2.7/site-packages/nagiosplugin/check.py", line 79, in _evaluate_resource
    for metric in metrics:
  File "/usr/lib/python2.7/site-packages/check_ruckus_vsz-0.13-py2.7.egg/EGG-INFO/scripts/check_ruckus_vsz", line 118, in probe
    stats_rx_pkts = self.snmpclient.get("RUCKUS-SCG-SYSTEM-MIB::ruckusSystemStatsWLANTotalRxPkts.0").get_value()
  File "/usr/lib/python2.7/site-packages/check_ruckus_vsz-0.13-py2.7.egg/ruckus_vsz_snmp/snmpclient.py", line 334, in get_value
    return self.get_by_dict(oid)
  File "/usr/lib/python2.7/site-packages/check_ruckus_vsz-0.13-py2.7.egg/ruckus_vsz_snmp/snmpclient.py", line 316, in get_by_dict
    raise RuntimeError("Cannot query oid %r if multiple varBinds keys are present: %r" % (oid, self.__varbinds_dict.keys()))
RuntimeError: Cannot query oid None if multiple varBinds keys are present: []
Probing Ruckus SCG device xx.xxx.xxx.XX through SNMP
PySNMP version is 4.4.12 - pyasn1 version is 0.4.7
Queried Ruckus SCG device xx.xxx.xxx.XX through SNMP - device is reachable
Found Sysname vsz01 and sysdescr SmartZone
Starting SNMP polling of host xx.xxx.xxx.XX
parsing entry ObjectType(ObjectIdentity(<ObjectName value object, tagSet <TagSet object, tags 0:0:6>, payload [1.3.6.1.2.1.1.3.0]>), <TimeTicks value object, subtypeSpec <ConstraintsIntersection object, consts <ValueRangeConstraint object, consts 0, 4294967295>>, tagSet <TagSet object, tags 64:0:3>, payload [300728880]>)
oid/value is 1.3.6.1.2.1.1.3.0=<TimeTicks value object, subtypeSpec <ConstraintsIntersection object, consts <ValueRangeConstraint object, consts 0, 4294967295>>, tagSet <TagSet object, tags 64:0:3>, payload [300728880]>
parsing entry ObjectType(ObjectIdentity(<ObjectName value object, tagSet <TagSet object, tags 0:0:6>, payload [1.3.6.1.4.1.2505...1.3.1.1.1.15.5.0]>), <NoSuchObject value object, subtypeSpec <ConstraintsIntersection object, consts <SingleValueConstraint object, consts ''>>, tagSet <TagSet object, tags 128:0:0>, encoding iso-8859-1, payload [No Such Object c...ists at this OID]>)
oid 1.3.6.1.4.1.25053.1.3.1.1.1.15.5.0 is noSuchObject
cygnusb commented 4 years ago

Ok. It seems that this fails on the first Ruckus specific MIB entry. So my guess is either there is a misconfiguration of SNMP communities?!? or your device is not providing all data. Can you please do a: snmpwalk -v2c -cCOMMUNITY HOSTNAME 1.3.6.1.4.1.25053

on the device and provide me with the details? You could add a

snmpwalk -v2c -cCOMMUNITY HOSTNAME 1.3.6.1.4.1.25053 | cut -d: -f1,2,3

this should cut out all sensitive data (please double check)

cygnusb commented 4 years ago

Found the snmp walk in centreon project. Will take a look

cygnusb commented 4 years ago

It seems your device is at least missing the total tx/rx statistics, which are present in oid 1.3.6.1.4.1.25053.1.3.1.1.1.15.5.0

I added some checks to ignore this and also make the code not fail completely in this case. Might not really be perfect. Please pull and let me know.

jeremyit commented 4 years ago

yeah! thanks! strange thing all values connected configured are 0

RUCKUSVSZ OK - 0 stations connected AP:(monitored 0, connected 0, configured 0) DISK:(free 74.2 / 87.5 GB -- 84.8%) MEM:(free 4.8 / 17.7 GB -- 27.2%) LOAD:(1min 0.09, 5min 0.11, 15min 0.12) | data_free=74.1503105164;40:;30: data_free_percent=84.7677580675 data_size=87.4746627808 load_15min=0.12;3;4 load_1min=0.09;5;10 load_5min=0.11;4;6 mem_free=4.80597686768;4:;2: mem_free_percent=27.2018433701 mem_size=17.6678352356 num_ap=0 num_ap_configured=0 num_ap_connected=0 num_sta=0 sysuptime=50179;@120

cygnusb commented 4 years ago

No its not really working. It seems now all data is missing except the basic system data. I reverted the change and handled this again.

Please check if that works and please provide full -vvvv output

jeremyit commented 4 years ago

out.log

jeremyit commented 4 years ago

Just tried vscg-5.1.2.0.302, but same issue. Basic system data reported, but impossible to control aps status

cygnusb commented 4 years ago

Can you please make snmpwalk on the ruckus controller. You need to copy all *.txt files from ruckus_vsz_snmp/ directory to ~/.snmp/mibs/ dir. And add mibs +ALL to ~./snmp/snmp.conf

When this is setup, you will be able to run: snmpwalk -v2c -cYOUR_COMMUNITY YOUR_RUCKUS_IP RUCKUS-SCG-WLAN-MIB::ruckusSCGAPMac

In addition you can try this with the corresponding mibs for 5.1.2.

I might not be able to properly fix this issue, since we do not plan to move to a newer version at the moment and have no way to test this.

cygnusb commented 4 years ago

Can you please retry this with the latest version? Should hopefully be resolved

cygnusb commented 4 years ago

Remaining issues should be fixed in #3

jeremyit commented 4 years ago

sorry for delay and thank you for the job. It's working with my 5.1.2 !

cygnusb commented 4 years ago

Great! Glad to hear it is also working with an newer ruckus release. Thanks for the feedback.