snmp_cmds.helpers module

snmp_cmds.helpers.check_for_timeout(cmderr, host)[source]

look for a timeout condition in the completed command’s output and raise an error if needed :type cmderr: bytes :param cmderr: the called process’s stderr output :type host: str :param host:

Return type

None

snmp_cmds.helpers.handle_unknown_error(cmdstr, cmderr)[source]

Catch-all for any unhandled error message coming from one of the net-smnp commands. Raises an SNMPError showing the snmp command attempted, and the error message received. :type cmdstr: str :param cmdstr: the full command sent to subprocess :type cmderr: bytes :param cmderr: the called process’s stderr output

Return type

None

snmp_cmds.helpers.validate_ip_address(ipaddress)[source]

convert the IP Address string into an IPv4Address or IPv6Address then back into a string. This is a cheap and easy way to do IP address validation. If the string is not a valid address, a ValueError will be raised

Return type

str