diff --git a/zabbix_scripts/check_unifi b/zabbix_scripts/check_unifi index 03cc0c6..ed6c4f0 100755 --- a/zabbix_scripts/check_unifi +++ b/zabbix_scripts/check_unifi @@ -162,7 +162,7 @@ if ($unifi){ } foreach my $entry (@{from_json($resp->decoded_content)->{data}}){ - next if (not $entry->{ap_mac} or $entry->{ap_mac} ne $dev or $entry->{is_wired} == JSON::PP::true); + next if (not $entry->{ap_mac} or $entry->{ap_mac} ne $dev or $entry->{is_wired} == JSON::true); foreach (@radio_proto){ if ($entry->{radio_proto} eq $_){ $json->{'num_sta_' . $_}++; @@ -202,7 +202,7 @@ if ($unifi){ $json->{last_seen} = time - $json->{last_seen}; # For wireless stations, we gather some more info - if ($obj->{is_wired} == JSON::PP::false){ + if ($obj->{is_wired} == JSON::false){ my @client_wireless = qw/rx_rate tx_rate essid ap_mac tx_power radio_proto signal noise satisfaction/; foreach (@client_wireless){ $json->{$_} = $obj->{$_} || 0; diff --git a/zabbix_scripts/disco_unifi b/zabbix_scripts/disco_unifi index 998094c..1d58cd2 100755 --- a/zabbix_scripts/disco_unifi +++ b/zabbix_scripts/disco_unifi @@ -107,8 +107,8 @@ if ($what eq 'devices'){ foreach my $entry (@{from_json($resp->decoded_content)->{data}}){ # Ignore other sites next if ($entry->{site_id} ne $site_id); - next if ($type eq 'wireless' and $entry->{is_wired} eq 'true'); - next if ($type eq 'wired' and $entry->{is_wired} eq 'false'); + next if ($type eq 'wireless' and $entry->{is_wired} == JSON::true); + next if ($type eq 'wired' and $entry->{is_wired} == JSON::false); push @{$json->{data}}, { '{#UNIFI_STA_ID}' => $entry->{_id}, '{#UNIFI_STA_NAME}' => (defined $entry->{hostname}) ? $entry->{hostname} : $entry->{mac},