stdevel / check_dlink_dgs Goto Github PK
View Code? Open in Web Editor NEWA Nagios / Icinga plugin for monitoring D-Link DGS managed switches
License: GNU General Public License v3.0
A Nagios / Icinga plugin for monitoring D-Link DGS managed switches
License: GNU General Public License v3.0
Currently, a RPM spec file is missing. It would be great to have a single spec file that creates an Icinga as well as a Icinga 2 package.
When specifying a hostname instead of an IP, the plugin crashes:
$ ./check_dlink_dgs.py -H myswitch.test.loc -c giertz -A
Traceback (most recent call last):
File "./check_dlink_dgs.py", line 257, in <module>
elif options.act_ports: get_active_ports()
File "./check_dlink_dgs.py", line 136, in get_active_ports
get_all_ports()
File "./check_dlink_dgs.py", line 119, in get_all_ports
check_switch_ports(True)
File "./check_dlink_dgs.py", line 167, in check_switch_ports
get_oid_result(OID)
File "./check_dlink_dgs.py", line 99, in get_oid_result
retryCount=5
File "/usr/lib/python2.7/site-packages/pysnmp/entity/config.py", line 283, in addTargetAddr
transportAddress = SnmpUDPAddress(transportAddress)
File "/usr/lib/python2.7/site-packages/pyasn1/type/univ.py", line 284, in __init__
base.AbstractSimpleAsn1Item.__init__(self, value, tagSet, subtypeSpec)
File "/usr/lib/python2.7/site-packages/pyasn1/type/base.py", line 68, in __init__
value = self.prettyIn(value)
File "/usr/lib/python2.7/site-packages/pysnmp/smi/mibs/SNMPv2-TM.py", line 27, in prettyIn
int2oct((value[1] >> 8) & 0xff) + \
socket.error: illegal IP address string passed to inet_pton
A valid Icinga (1) example configuration misses currently
Utilizing the nagiosplugin
python module would simplify maintaining the code.
SNMP v3 offers greater security, currently the plugin only supports v1 and v2c.
./check_dlink_dgs.py -d -H 192.168.1.251 -V 1 -c public -A
DEBUG:check_dlink_dgs:OPTIONS: {'show_perfdata': False, 'snmp_port': 161, 'act_ports': True, 'snmp_vers': '1', 'host': '192.168.1.251', 'all_ports': False, 'debug': True, 'snmp_comm': 'public', 'ports': None}
DEBUG:check_dlink_dgs:PORTS: {}
DEBUG:check_dlink_dgs:Retrieving information about port '1'...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.31.1.1.1.10.1' (outOct)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.31.1.1.1.6.1' (inOct)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.31.1.1.1.18.1' (alias)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.2.2.1.8.1' (state)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.31.1.1.1.1.1' (device)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.31.1.1.1.15.1' (speed)...
DEBUG:check_dlink_dgs:Requesting '1.3.6.1.2.1.2.2.1.2.1' (desc)...
DEBUG:check_dlink_dgs:my_ports: '[1]'
DEBUG:check_dlink_dgs:my_portinfo: '{1: {'outOct': '80430753', 'inOct': '3232', 'alias': '', 'state': '1', 'device': '1/1', 'speed': '100', 'desc': 'Ethernet Interface'}}'
Traceback (most recent call last):
File "./check_dlink_dgs.py", line 257, in
elif options.act_ports: get_active_ports()
File "./check_dlink_dgs.py", line 136, in get_active_ports
get_all_ports()
File "./check_dlink_dgs.py", line 125, in get_all_ports
LOGGER.debug("Seems like we have {0} ports on this switch ({1})".format(prod_ports[0], prod_name))
IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.