def snmp_validate_firewall(data): intfs = local_interfaces_firewall_open(['udp', 'tcp'], 161) if len(intfs) == 0: # by issueing a warning, running-config doesn't display the # error during replay. command.sdnsh.warning( 'SNMP server port not open on any controller-node ' 'interface. Use firewall rule configuration to open ' 'SNMP UDP port 161')
def snmp_validate_firewall(data): intfs = local_interfaces_firewall_open(["udp", "tcp"], 161) if len(intfs) == 0: # by issueing a warning, running-config doesn't display the # error during replay. command.sdnsh.warning( "SNMP server port not open on any controller-node " "interface. Use firewall rule configuration to open " "SNMP UDP port 161" )
def snmp_firewall_interfaces(data): """ There is currently only one row of data in the query, add to that a 'interfaces' entity, which lists the interfaces which have the snmp port open """ if not hasattr(command, "query_result"): return if command.query_result == None: return intfs = local_interfaces_firewall_open(["udp", "tcp"], 161) intfs_text = ", ".join([x["discovered-ip"] if x["discovered-ip"] != "" else x["ip"] for x in intfs]) for q in command.query_result: q["interfaces"] = intfs_text
def snmp_firewall_interfaces(data): """ There is currently only one row of data in the query, add to that a 'interfaces' entity, which lists the interfaces which have the snmp port open """ if not hasattr(command, 'query_result'): return if command.query_result == None: return intfs = local_interfaces_firewall_open(['udp', 'tcp'], 161) intfs_text = ', '.join([ x['discovered-ip'] if x['discovered-ip'] != '' else x['ip'] for x in intfs ]) for q in command.query_result: q['interfaces'] = intfs_text