From 35102d015abc46b0ccd63dc0b442280cb4f3faea Mon Sep 17 00:00:00 2001 From: M.Gergő Date: Mon, 25 May 2020 21:47:53 +0200 Subject: Litte repair --- ubnt_unifi.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ubnt_unifi.php') diff --git a/ubnt_unifi.php b/ubnt_unifi.php index 2b5726b..880c7df 100644 --- a/ubnt_unifi.php +++ b/ubnt_unifi.php @@ -424,12 +424,14 @@ function collect_response_time($inp, $host){ //Calculates the Roundtrip time a $sum_time += $ret['data'][$i]['value']; $i++; } - $ret['head'][$i+1]['name'] = "ping_average"; - $ret['head'][$i+1]['label'] = "Average"; - $ret['head'][$i+1]['draw'] = "LINE1.2"; - $ret['head'][$i+1]['info'] = "Response Time"; - $ret['head'][$i+1]['type'] = "GAUGE"; - $ret['head'][$i+1]['min'] = "0"; + if($host == null){ //count average + $ret['head'][$i+1]['name'] = "ping_average"; + $ret['head'][$i+1]['label'] = "Average"; + $ret['head'][$i+1]['draw'] = "LINE1.2"; + $ret['head'][$i+1]['info'] = "Response Time"; + $ret['head'][$i+1]['type'] = "GAUGE"; + $ret['head'][$i+1]['min'] = "0"; + } if(count($inp) != 0 && $host == null){ //count average $ret['data'][$i+1]['value'] = $sum_time/count($inp); -- cgit v1.2.3