06-26-2014 01:52 AM
If you Found My Post Helping you kindly Give KUDOS and if it solved your question Kindly hit Accept as a solution box.
Re: Ping AP
Re: Ping AP
06-27-2014 04:42 AM - edited 06-27-2014 04:45 AM
If you are trying to monitor, it is best to monitor using SNMP and not PING in both cases (Controller or Instant).
Instant requires IAP version 4.1 for SNMP to work
If you have a MIB browser, download the MIB and the MIB guide and you will be able to locate them both.
For the AP status, the OID is the following:
After 19, you will need to enter in the decimal format of the MAC address of the AP, it will then return something like so
.22.214.171.124.4.1.148126.96.36.199.188.8.131.52.1.19.xxx.243.127.yyy.153.236 = INTEGER: 1
1 = AP is UP
2 = AP is DOWN
For example, if your MAC address was, DE:AD:BE:EF:CA:FE, the corresponding decimal format would be .184.108.40.206.202.254
So you would perform the following command:
snmpwalk -v2c -On -c <community_string> IP_of_controller:<snmp_port> .220.127.116.11.4.1.14818.104.22.168.22.214.171.124.126.96.36.199.188.8.131.52
You would then receive the response of 1 or 2.
How to convert decimal to MAC and MAC to Decimal, here is something I wrote in Python that will do the work for you.
#!/usr/bin/env python import sys def hex2dec(s): return int(s, 16) def dec2hex(s): print "s = " + s mac = hex(s)+hex(s) return mac def mac2oid(mac): oid = "" for byte in mac.split(':'): oid += ".%s" % hex2dec(byte) return oid.strip() def oid2mac(oid): mac = "" for byte in oid.split('.'): #for i in range(len(byte)): # t = int(byte[i]) mac += ".%s" % dec2hex(byte) return mac.strip() menu = """ Please choose how you want to convert your string (1) Convert from MAC 2 OID (2) Convert from OID 2 MAC """ while True: choice = raw_input(menu) if "1" in choice: macstr = raw_input("Enter MAC:") print mac2oid(macstr) elif "2" in choice: oidstr = raw_input("Enter OID - format(xxx.yyy.zzz.aaa.bbb.ccc): ") print oid2mac(oidstr)
Hope this helps.
ACDX #420 | ACCA
[If you found my post helpful, please give kudos!]