What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

Aruba Wireless AP Counting clients



I'm trying get PRTG to give me the number of clients attached to our AP's. I have an snmp command:

snmpwalk -v2c -c COMMUNITY ADDRESS SNMPv2-SMI::enterprises.14823.

This will return a list of clients connected, so by adding | wc -l I can count them

snmpwalk -v2c -c xxx xxx SNMPv2-SMI::enterprises.14823. -l

But how do I make PRTG count the number of lines returned in SNMP? I've tried asking just on the OID But of course it just returns a list of clients, so it doesn't understand it. Is there a way to use the advanced snmp to count the lines, instead of building a giant custom sensor for this?

aruba network snmp wifi

Created on Oct 31, 2018 4:35:25 PM

Last change on Nov 1, 2018 10:51:34 AM by  Andreas Günther [Paessler Support]

1 Reply



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)

    [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  "." -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 "" -t $timeout | Measure-Object -Line | Select-Object -expand Lines

#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>"

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

Created on Nov 1, 2018 10:35:22 AM

Last change on Nov 1, 2018 11:32:45 PM by  Benjamin Day [Paessler Support] (1,441) 2 1

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.