Ok, I got a script created, by butchering the BGP script elsewhere:
# Monitor Status of Aruba Wireless AP
#
# Parameters in PRTG should be:
# -hostaddr '%host' -community '%snmpcommunity' -port '161' -timeout '5'
# Alternatively (without placeholders):
# -hostaddr 'ap.domain.tld' -community 'public' -port '161' -timeout '5'
#
# Requites net-snmp installed and in the path since it will use snmpwalk.exe (http://www.net-snmp.org/)
#
# It's recommended to use large scanning intervals for exe/xml scripts. (Not below 300 seconds)
param(
[string]$hostaddr = "router.domain.tld",
[string]$community = "public",
[string]$port = "161",
[string]$timeout = "5",
[string]$troubleshooting = 0
)
$version = "0.1"
$queryMeasurement = [System.Diagnostics.Stopwatch]::StartNew()
$walkresult = (c:\snmpwalk\snmpwalk.exe -Ln -On -v 2c -c $community $hostaddr":"$port ".1.3.6.1.4.1.14823.2.3.3.1.2.4.1.3" -t $timeout -l | Measure-Object -Line | Select-Object -expand Lines)
if ($troubleshooting -eq 1){
c:\snmpwalk\snmpwalk.exe -Ln -On -v 2c -c $community $hostaddr":"$port "1.3.6.1.4.1.14823.2.1.1.1" -t $timeout | Measure-Object -Line | Select-Object -expand Lines
Exit
}
#Check if snmwalk.exe suceeded.
if ($LASTEXITCODE -ne 0 ){
write-host "<prtg>"
write-host "<error>1</error>"
write-host "<text>Error: $($walkresult) / ScriptV: $($version) / PSv: $($PSVersionTable.PSVersion)</text>"
write-host "</prtg>"
Exit
}
write-host "<prtg>"
write-host "<result>"
write-host "<channel>Clients connected</channel>"
write-host "<value>"$walkresult"</value>"
write-host "</result>"
write-host "</prtg>"
This will return the number of clients connected to the 'controllerless' instant AP Aruba system.
It requires an SNMPWALK.EXE to be placed in a c:\snmpwalk\ folder
Add comment