30 |
function check_online($dat, $bla) |
function check_online($dat, $bla) |
31 |
{ |
{ |
32 |
global $comps; |
global $comps; |
|
global $ssh_port; |
|
33 |
global $mcore_port; |
global $mcore_port; |
34 |
global $ping_timeout; |
global $ping_timeout; |
35 |
if(!isset($comps[$dat['serial']])) return false; |
if(!isset($comps[$dat['serial']])) return false; |
36 |
|
|
|
// first try mcore, then get ssh |
|
37 |
$retval = ping_host($dat['ip'],$mcore_port,$ping_timeout); |
$retval = ping_host($dat['ip'],$mcore_port,$ping_timeout); |
|
if($retval==1) $retval = ping_host($dat['ip'],$ssh_port,$ping_timeout); |
|
38 |
if($retval==0) |
if($retval==0) |
39 |
{ |
{ |
40 |
$comps[$dat['serial']]['online'] = true; |
$comps[$dat['serial']]['online'] = true; |