Some changes were necessary. The APifType.php didn't account for changes in SNMP version and just didn't work anyways. The following works for me:
Code: Select all
<?php
/* do NOT run this script through a web browser */
if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) {
die("<br><strong>This script is only meant to run at the command line.</strong>");
}
$no_http_headers = true;
include(dirname(__FILE__) . "/../include/config.php");
include(dirname(__FILE__) . "/../lib/snmp.php");
$hostname = $_SERVER["argv"][1];
$snmp_community = $_SERVER["argv"][2];
$snmp_version = $_SERVER["argv"][3];
$bsnAPIfType = ".1.3.6.1.4.1.14179.2.2.2.1.2";
$radiotypes = reindex(cacti_snmp_walk($hostname, $snmp_community, $bsnAPIfType, $snmp_version, "", "", 161, 1000));
$sorted = array_count_values($radiotypes);
$newfinalarray = array("APdot11a:"=>$sorted[2],"APdot11b:"=>$sorted[1]);
print "APdot11a:" . $sorted[2] . " APdot11b:" . $sorted[1] . "\n";
}
function reindex($arr) {
$return_arr = array();
for ($i=0;($i<sizeof($arr));$i++) {
$return_arr[$i] = $arr[$i]["value"];
}
return $return_arr;
}
?>
I can get
Code: Select all
# snmpwalk xxxxxxx -c public -v2c .1.3.6.1.4.1.14179.2.1.4.1.4 -O s
enterprises.14179.2.1.4.1.4.0.5.78.67.229.41 = Hex-STRING: 00 1B 2B A7 84 40
enterprises.14179.2.1.4.1.4.0.5.78.71.56.219 = Hex-STRING: 00 1B 2B A5 6F 60
enterprises.14179.2.1.4.1.4.0.5.78.74.45.21 = Hex-STRING: 00 1B 2B A7 90 30
enterprises.14179.2.1.4.1.4.0.5.78.74.46.35 = Hex-STRING: 00 1B 2B A7 90 30
HEX-00:00:1B:2B:A5:6F:60!HEX-00:00:1B:2B:A5:6F:60
HEX-00:00:1B:2B:A7:67:C0!HEX-00:00:1B:2B:A7:67:C0
HEX-00:00:1B:2B:A7:84:40!HEX-00:00:1B:2B:A7:84:40
HEX-00:00:1B:2B:A7:90:30!HEX-00:00:1B:2B:A7:90:30
HEX-00:00:1B:2B:A7:91:E0!HEX-00:00:1B:2B:A7:91:E0
HEX-00:00:1B:2B:A7:97:A0!HEX-00:00:1B:2B:A7:97:A0
But trying php -q ./query_cisco4400_aps.php <IP> <comm> <ver> get apassoc HEX-00:00:1B:2B:A5:6F:60
Results in output of 0. As does any other permutation of an AP's MAC address that I've tried.
Any ideas? Maybe you can help me figure out what format the php needs to input for the APAssoc?
Thanks,
-Max