From 6afaa17a8069d91683c50e6bcec518d72aa6c115 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 29 Sep 2014 23:10:00 +0100 Subject: [PATCH] Updated ping rrd response to include fping6 response --- includes/functions.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 5371621d3..c3c64b301 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -466,18 +466,9 @@ function isPingable($hostname,$device_id) $status = shell_exec($config['fping'] . " -e $hostname 2>/dev/null"); if (strstr($status, "alive")) { - if(is_numeric($device_id) && !empty($device_id)) - { - preg_match('/(\d+\.*\d*) (ms)/', $status, $time); - $response['last_ping_timetaken'] = $time[1]; - $response['result'] = TRUE; - } - else - { - $response['result'] = TRUE; - } + $response['result'] = TRUE; } else { - $status = shell_exec($config['fping6'] . " $hostname 2>/dev/null"); + $status = shell_exec($config['fping6'] . " -e $hostname 2>/dev/null"); if (strstr($status, "alive")) { $response['result'] = TRUE; @@ -485,6 +476,11 @@ function isPingable($hostname,$device_id) $response['result'] = FALSE; } } + if(is_numeric($device_id) && !empty($device_id)) + { + preg_match('/(\d+\.*\d*) (ms)/', $status, $time); + $response['last_ping_timetaken'] = $time[1]; + } return($response); }