Coder Social home page Coder Social logo

stdevel / check_dlink_dgs Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 19 KB

A Nagios / Icinga plugin for monitoring D-Link DGS managed switches

License: GNU General Public License v3.0

Python 100.00%
icinga-plugin snmp nagios switch icinga dlink dlink-dgs switch-ports network networking

check_dlink_dgs's People

Contributors

stdevel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

sowoi

check_dlink_dgs's Issues

RPM spec file missing

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.

Plugin requires IP instead of hostname

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

Got this error...

./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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.