aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM.Gergő2019-02-05 22:51:03 +0100
committerM.Gergő2019-02-05 22:51:03 +0100
commit2720bbc646b0ee86586b0ad4f02c548c7d048c46 (patch)
tree7aebf197dc424b8d6b9c92c837496c514f121e58
parent54db99c38b065ef81c07b3fd3ebd8436bc1a8449 (diff)
downloadmunin-unifi-2720bbc646b0ee86586b0ad4f02c548c7d048c46.tar.gz
munin-unifi-2720bbc646b0ee86586b0ad4f02c548c7d048c46.zip
error handling
-rw-r--r--ubnt_unifi.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/ubnt_unifi.php b/ubnt_unifi.php
index 648a4c0..80d532e 100644
--- a/ubnt_unifi.php
+++ b/ubnt_unifi.php
@@ -81,11 +81,11 @@ function count_wl_networks($inp){ //Count wireless networks from interfade data
function collect_radio_summary($inp,$host){
global $controller, $replace_chars;
$ret = array();
- if(!array_key_exists($host, $inp)){
- return $ret;
- }
if(isset($host) and $host !== null and $host != "" ){
+ if(!array_key_exists($host, $inp)){
+ return $ret;
+ }
$ret['g_multi'] = "radio_".str_replace( array(".", ":"), "_" ,$controller).".".str_replace( array(".", ":"), "_" ,$host);
$ret['g_controller'] = $controller;
$location = str_replace("\"", "", explode(": ", $inp[$host]["iso.3.6.1.2.1.1.6.0"])[1]);
@@ -185,20 +185,20 @@ return $ret;
function collect_netw_summary($inp,$host){ //network information
global $controller, $replace_chars;
$ret = array();
- if(!array_key_exists($host, $inp)){
- return $ret;
- }
if(isset($host) and $host !== null and $host != "" ){ // When showing the Ap's summary.
+ if(!array_key_exists($host, $inp)){
+ return $ret;
+ }
$temp = $inp;
unset($inp);
$inp = array($host => $temp[$host]);
unset($temp);
$multiplier = 8;
$divider = 1;
- } else { //because the normal INTEGER(32) would be overflowed
+ } else {
$multiplier = 8*1024*4; // When showing the controller's summary
- $divider = 1024*4;
+ $divider = 1024*4; //because the normal INTEGER(32) would be overflowed
}