WLC AP Up/Down Alerting

Librenms doesn’t have a way to alert when APs go down on a Cisco wireless controller. I’d like to be able to alert when this happens. APs themselves don’t support SNMP, so I am limited to ICMP currently.

6 Likes

+1 This would be a awesome feature.

1 Like

I have an alert for APs that go down on my Cisco 5520 and 5508 controllers. When creating a new alert, under the Advanced tab I have the following query.

SELECT * FROM access_points WHERE (access_points.device_id = ?) && (access_points.deleted = “1” )

Then the main tab looks like this.

2 Likes

Just check whether the access_point table needs sanitizing before enabling this alert. I have a similar alert in place for our 8510s.

Any AP which has ever been connected to your controller will still be in there even if no longer live, just marked as “deleted”. From memory this included any APs which had changed name, including from default APmac_addr naming.

Otherwise you end up with a fairly hefty alert message on the next poll…

When APs are renamed, replaced, or permanently taken out of service, I do need to manually remove the old entries from the database. It can be annoying, but I find the value of the alert is worth it.

1 Like

Agree entirely!

+1 to this.

Alerts on lightweight APs would br great

After a bit of fiddling I’ve come at this from a slightly different direction. This method relies on CDP information stored in the links table.

The following DB query uses this information to find any switchports on the network which have just gone down and have a Cisco lightweight wireless access point attached:

select devices.hostname,
            ports.ifDescr, 
            ports.ifAlias, 
            links.remote_hostname,
            links.remote_platform
from ports
    join devices on ports.device_id = devices.device_id
    join links on ports.port_id = links.local_port_id
where links.remote_platform regexp '^cisco AIR-'
    and ports.ifAdminStatus = 'up'
    and ports.ifOperStatus_prev = 'up'
    and ports.ifOperStatus = 'down';

Converting this to something which can go into the Override SQL box in the Advanced tab of an alert rule gives us:

select * from ports, devices, links where (devices.device_id = ? AND ports.device_id = devices.device_id AND ports.port_id = links.local_port_id) AND (links.remote_platform regexp "^cisco AIR-") AND (ports.ifAdminStatus = "up") AND (ports.ifOperStatus_prev = "up") AND (ports.ifOperStatus = "down")

I’ve been running this for a few days now and seems to work quite well, and has picked up a few issues we weren’t aware of.

I’m not familiar enough with other wireless vendors’ kit to say if this will work with non-Cisco wireless, but I’ve found the CDP/LLDP information in the links table fairly useful in other areas - we now have a quick way of locating any IP phone on the network knowing only its extension number as this is stored in LLDP information pulled into the links table.

Extending the logic above to other CDP/LLDP neighbour remote_platform types should let you track other such devices.

HTH

Just how do you go about cleaning up the database from removed or renamed access points? On the controller or in Librenms… I can’t find evidence of either. And after the alert polled I got lots of notifications. We have been monitoring with Librenms for over a year and have replaced quite a few access points. Now that I have this alert in place it isn’t helping if I can’t clean this up. Thanks in advance.

@Chris_DeLuca
Cisco does not keep a list of AP that are disconnected. So LibreNMS has no way to know either. Only choice is to keep all of them. And right now, there is no cleaning process as far as I know.
Contributions are of course welcome :slight_smile:

1 Like

Then what does this post mean???

David_Przybyla

Nov '18

When APs are renamed, replaced, or permanently taken out of service, I do need to manually remove the old entries from the database. It can be annoying, but I find the value of the alert is worth it.

what database is he talking about… and we can’t keep all of them some of them have died and been replaced.

Exactly the same. Cisco does not provide the information “this AP was removed” or “This AP is unplugged”. Cisco only gives current list of APs. So you cannot make any conlusion unless you do this list yourself, by removing the decommissioned APs from LibreNMS DB.

This is practically not efficient.

This is exactly my point how does one go about doing this? We are trying to have Librenms tell us when an AP goes offline but it cannot do this if it thinks 182 replaced AP’s are offline. How does one go about removing decommissioned offline AP’s, efficient or not, from the database? This is my question.

You cannot do that until Cisco provides this information in a proper way. They have to keep the list of antennas and manage it from the controller. LibreNMS cannot do it for the WLC. That’s the all point.
This feature request should be sent to Cisco instead of LibreNMS …

the what database is David_Przybyla referring to in an earlier post where he says he takes them out… I am not asking for a feature request I am asking where and how to remove them manually

OK @Chris_DeLuca
Look at the table list, it is the 1st one :

MariaDB [librenms]> show tables;
+---------------------------+
| Tables_in_librenms        |
+---------------------------+
| access_points             |

1 Like

As @PipoCanaja says, it’s the access_points table. You can see which radios have been deleted thus:

select accesspoint_id, name, mac_addr from access_points where deleted = 1;

If you are happy this is a valid list of out-of-service radios, zap them from the table:

delete from access_points where deleted = 1;

HTH

Has anyone found a way to incorporate the AP name into the alerts? I know that from the database each AP gets listed twice because of the 2.4 and 5 GHz radios but I found you can pull the specific AP names out with this query:

SELECT DISTINCT name FROM access_points WHERE deleted = '1';

but I haven’t thought of a way to do it other than going out and writing a custom script to constantly query the database and send me an alert with each AP in the list.

Apologies for the delay in replying. I pulled out the unique APs using this alert template. If you find it useful please feel free to modify to meet your own needs:

Severity: {{ $alert->severity }}
Rule: @if ($alert->name)
{{ $alert->name }}
@else
{{ $alert->rule }}
@endif
@if ($alert->state == 0)
Time elapsed: {{ $alert->elapsed }}
@endif
Timestamp: {{ $alert->timestamp }}
Unique-ID: {{ $alert->uid }}

Controller: {{ $alert->hostname }}
Link: https://mycontroller/device/device={{ $alert->device_id }}/

@if ($alert->faults)
@foreach ($alert->faults as $key => $value)
@if ($key == 1)
@php
$i = $value['mac_addr'];
$loopcount = 1;
@endphp
@elseif ($key > 1)
@php
$j = $i;
$i = $value['mac_addr'];
@endphp
@endif
@if ($i != $j)
#{{ $loopcount }}: {{ $value['name'] }} ({{ $value['mac_addr'] }})
@php $loopcount++; @endphp
@endif
@endforeach
@endif

Total Access Points lost: {{ $loopcount - 1 }}
1 Like

No worries, that works perfectly! Thank you.