From 31f58a19218d1d2138a8e1ac9fc76be979a401e5 Mon Sep 17 00:00:00 2001 From: Steve Jenkins Date: Fri, 20 Jan 2017 13:35:15 -0800 Subject: [PATCH] Make sure AP has a name before checking Fixes KeyError: 'name' issue reported here: https://community.ubnt.com/t5/UniFi-Wireless/UniFi-WiFi-Nagios-Monitoring-Plugin/m-p/1805913#M205041 --- nagios/check_unifi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagios/check_unifi b/nagios/check_unifi index 4799ca4..385212c 100644 --- a/nagios/check_unifi +++ b/nagios/check_unifi @@ -88,7 +88,7 @@ for ap in aps: offline_names.append(ap['name']) # If a specific AP was specified, record its specific status - if ap['name'] == args.ap: + if hasattr(ap, 'name') and ap['name'] == args.ap: ap_state = ap['state'] if ap['state'] == 1: ap_code = OK