tips:airos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:airos [2019/03/12 14:39] scipiotips:airos [2019/03/15 11:24] (current) – [SNMP] scipio
Line 1: Line 1:
 ====== AirOS ====== ====== AirOS ======
 +
 +===== SNMP =====
 +
 +<code>
 +snmpwalk -c lessinianet.snmp -v 1 10.210.12.249 IF-MIB::ifDescr                                
 +IF-MIB::ifDescr.1 = STRING: lo
 +IF-MIB::ifDescr.2 = STRING: eth0
 +IF-MIB::ifDescr.3 = STRING: eth1
 +IF-MIB::ifDescr.4 = STRING: wifi0
 +IF-MIB::ifDescr.5 = STRING: ath0
 +IF-MIB::ifDescr.6 = STRING: eth0.10
 +IF-MIB::ifDescr.7 = STRING: br0
 +</code>
 +
 +<code>
 +snmpget -c lessinianet.snmp -v 1 10.210.12.249 IF-MIB::ifPhysAddress.4                                  
 +IF-MIB::ifPhysAddress.4 = STRING: 4:18:d6:ec:98:ac
 +</code>
 +
 +Cercando dalla prima query i "wifi*" e sostituendo l'indice corrispondente (nell'esempio 4) nella seconda query si ottiene il mac. Ovviamente da fare usande le librerie SNMP PHP
 +
 +===== http API =====
 +
  
 <code php> <code php>
Line 12: Line 35:
 // airOS_getFile_HTTP ($username, $password, $file, $address, $schema) // airOS_getFile_HTTP ($username, $password, $file, $address, $schema)
  
-#$out = airOS_getFile_HTTP ("root", "xxx", "status.cgi", "10.210.48.2", "https"); +#$out = airOS_getFile_HTTP ("root", "xxx", "status.cgi", "10.210.48.2", "https"); // CPE mng 
-$out = airOS_getFile_HTTP ("galileo", "xxx", "status.cgi", "10.210.12.247", "http");+#$out = airOS_getFile_HTTP ("galileo", "xxx", "status.cgi", "10.210.12.247", "http"); // settore 
 +$out = airOS_getFile_HTTP ("root", "xxx", "status.cgi", "109.104.240.187:8008", "http"); // CPE
 print $out; print $out;
  
Line 614: Line 638:
     "timestamp": "2018-01-26T08:29:57+0100"     "timestamp": "2018-01-26T08:29:57+0100"
   }   }
 +}
 +</code>
 +
 +
 +risposta CPE
 +<code javascript>
 +{ "host": {
 + "uptime": 5104088,
 + "time": "2017-02-16 18:53:02",
 + "fwversion": "v6.0",
 + "fwprefix": "XW",
 + "hostname": "cpe-240187",
 + "devmodel": "PowerBeam M5 300",
 + "netrole": "router",
 + "totalram": 63623168,
 + "freeram": 39596032,
 + "cputotal": 510331084,
 + "cpubusy": 3895687
 + },
 + "wireless": {
 + "mode": "sta",
 + "essid": "lessinianet.net",
 + "hide_essid": 0,
 + "apmac": "04:18:D6:EC:98:AC",
 + "countrycode": 380,
 + "channel": 40,
 + "frequency": "5200 MHz",
 + "dfs": "0",
 + "opmode": "11NAHT20",
 + "antenna": "300 - 22 dBi",
 + "chains": "2X2",
 + "signal": -70, "rssi": 26, "noisef": -96,
 + "txpower": 22,
 + "ack": 37,
 + "distance": 1950,
 + "ccq": 991,
 + "txrate": "39", "rxrate": "117",
 + "security": "WPA2", "qos": "No QoS",
 + "rstatus": 5,
 + "count": 1, "cac_nol": 0, "nol_chans": 0,
 + "polling": {
 + "enabled": 0, "quality": 0, "capacity": 0, "priority": 0, "noack": 0,
 + "airsync_mode": 0, "airsync_connections": 0,
 + "airsync_down_util" : 0, "airsync_up_util" : 0,
 + "airselect" : 0, "airselect_interval" : 0
 + },
 + "stats": { "rx_nwids": 0,
 + "rx_crypts": 0,
 + "rx_frags": 0,
 + "tx_retries": 0,
 + "missed_beacons": 0,
 + "err_other": 0
 + },
 + "wds": 0,
 + "aprepeater": 0,
 + "chwidth": 20,
 + "chanbw": 20,
 + "cwmmode": 0,
 + "rx_chainmask": 3,
 + "tx_chainmask": 3,
 + "chainrssi" : [ 20, 25, 0 ],
 + "chainrssimgmt" : [ 21, 25, 0 ],
 + "chainrssiext" : [ 20, 25, 0 ]
 + },
 + "airview": { "enabled": 0 },
 + "services": { "dhcpc": 0, "dhcpd": 1, "pppoe": 1 },
 + "firewall": { "iptables": 0, "ebtables" : 0, "ip6tables": 0, "eb6tables" : 0 },
 + "genuine": "/images/genuine.png",
 + "interfaces" : [
 + {
 + "ifname" : "lo",
 + "hwaddr": "00:00:00:00:00:00",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 0, "duplex": 255 },
 + "services" : { "dhcpc": false, "dhcpd": false, "pppoe": false }
 + },
 + {
 + "ifname" : "eth0",
 + "hwaddr": "80:2A:A8:6F:67:A9",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 100, "duplex": 1 },
 + "services" : { "dhcpc": false, "dhcpd": false, "pppoe": false }
 + },
 + {
 + "ifname" : "wifi0",
 + "hwaddr": "80:2A:A8:6E:67:A9",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 0, "duplex": 255 },
 + "services" : { "dhcpc": false, "dhcpd": false, "pppoe": false }
 + },
 + {
 + "ifname" : "ath0",
 + "hwaddr": "80:2A:A8:6E:67:A9",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 0, "duplex": 255 },
 + "services" : { "dhcpc": false, "dhcpd": false, "pppoe": true }
 + },
 + {
 + "ifname" : "br0",
 + "hwaddr": "80:2A:A8:6F:67:A9",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 0, "duplex": 255 },
 + "services" : { "dhcpc": false, "dhcpd": true, "pppoe": false }
 + },
 + {
 + "ifname" : "ppp0",
 + "hwaddr": "00:00:00:00:00:00",
 + "enabled" : true,
 + "status" : { "plugged": 1, "speed": 0, "duplex": 255 },
 + "services" : { "dhcpc": false, "dhcpd": false, "pppoe": false }
 + }
 + ]
 } }
 </code> </code>
  • tips/airos.1552397981.txt.gz
  • Last modified: 2019/03/12 14:39
  • by scipio