its working now...
Easysnmp doesn't honour the textual conventions when MIBs are loaded.
Help required now, not able to print for multiple oid, something going wrong
Easysnmp doesn't honour the textual conventions when MIBs are loaded.
from easysnmp import Session # Create an SNMP session to be used for all our requests session = Session(hostname='10.124.xxx.xx', community='xxxwifi', version=2) # Perform an SNMP walk system_items = session.walk('1.3.6.1.4.1.25053.1.3.2.1.1.2.2.1.1') for item in system_items: print ':'.join('{:02x}'.format(ord(x)) for x in item.value)
Output:04:4f:aa:34:a2:80
04:4f:aa:34:a7:20
1c:b9:c4:01:cc:50
1c:b9:c4:01:e9:b0
1c:b9:c4:03:79:70
1c:b9:c4:03:7a:a0
1c:b9:c4:03:7b:00
command line outputOutput:SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.4.79.170.52.162.128 = Hex-STRING: 04 4F AA 34 A2 80
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.4.79.170.52.167.32 = Hex-STRING: 04 4F AA 34 A7 20
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.28.185.196.1.204.80 = Hex-STRING: 1C B9 C4 01 CC 50
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.28.185.196.1.233.176 = Hex-STRING: 1C B9 C4 01 E9 B0
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.28.185.196.3.121.112 = Hex-STRING: 1C B9 C4 03 79 70
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.28.185.196.3.122.160 = Hex-STRING: 1C B9 C4 03 7A A0
SNMPv2-SMI::enterprises.25053.1.3.2.1.1.2.2.1.1.6.28.185.196.3.123.0 = Hex-STRING: 1C B9 C4 03 7B 00
Help required now, not able to print for multiple oid, something going wrong
host = '10.124.115.10' session = Session(hostname=host, community='ttlwifi', version=2) WLCip,SCGAPMac = (list(session.bulkwalk('1.3.6.1.4.1.25053.1.3.2.1.1.2.2.1.' + c ,non_repeaters=0, max_repetitions=50)) for c in ('1','10')) for i in range(len(WLCip)): mac_address = ':'.join('{:02x}'.format(ord(x)) for x in SCGAPMac[i].value) #print (SCGAPMac[i].value) #print (mac_address) print (u'{} {} {}'.format(host,mac_address,WLCip[i].value))
Output:10.124.115.10 31:30:2e:31:33:38:2e:34:2e:31:36:35 Oª4¢�
10.124.115.10 31:30:2e:31:33:38:2e:34:2e:31:36:34 Oª4§
10.124.115.10 31:30:2e:31:33:39:2e:32:32:2e:34:36 ¹ÄÌP
10.124.115.10 31:30:2e:31:33:39:2e:32:33:2e:39 ¹Äé°
10.124.115.10 31:30:2e:31:33:38:2e:33:39:2e:32:30 ¹Äyp
10.124.115.10 31:30:2e:31:33:39:2e:32:32:2e:33:38 ¹Äz
10.124.115.10 31:30:2e:31:33:39:2e:37:2e:36 ¹Ä{
10.124.115.10 31:30:2e:31:33:39:2e:37:2e:37 ¹Ä|
10.124.115.10 31:30:2e:31:33:39:2e:32:32:2e:31:37:38 ¹Ä}�
10.124.115.10 31:30:2e:31:33:39:2e:36:2e:36 ¹Ä}Ð
10.124.115.10 31:30:2e:31:33:39:2e:32:32:2e:33:39 ¹Ä~p
10.124.115.10 31:30:2e:31:33:39:2e:36:2e:38 ¹Ä�À