Updated ping rrd response to include fping6 response

This commit is contained in:
laf
2014-09-29 23:10:00 +01:00
parent 9a178363a0
commit 6afaa17a80

View File

@@ -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);
}