Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin requires IP instead of hostname #4

Open
stdevel opened this issue Oct 14, 2016 · 0 comments
Open

Plugin requires IP instead of hostname #4

stdevel opened this issue Oct 14, 2016 · 0 comments
Assignees
Labels

Comments

@stdevel
Copy link
Owner

stdevel commented Oct 14, 2016

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
@stdevel stdevel added the bug label Oct 14, 2016
@stdevel stdevel self-assigned this Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant