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:
.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.19
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
.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.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 .222.173.190.239.202.254
So you would perform the following command:
snmpwalk -v2c -On -c <community_string> IP_of_controller:<snmp_port> .1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.19.222.173.190.239.202.254
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)[2]+hex(s)[3]
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.