--- alx-src/branches/alx-web-060/index.php 2012/02/08 13:03:11 3348 +++ alx-src/branches/alx-web-070/index.php 2015/09/09 11:20:52 7110 @@ -4,7 +4,10 @@ include('include/common-functions.php'); session_start(); -session_register('alx_sort_krit'); session_register('alx_sort_onfirst'); session_register('alx_sort_loc'); +//session_register('alx_sort_krit'); session_register('alx_sort_onfirst'); session_register('alx_sort_loc'); +$_SESSION['alx_sort_krit'] = $alx_sort_krit; +$_SESSION['alx_sort_onfirst'] = $alx_sort_onfirst; +$_SESSION['alx_sort_loc'] = $alx_sort_loc; $locations = sqlarr('SELECT location FROM client_locations', '', 'location'); $locations[] = ''; @@ -27,11 +30,14 @@ function check_online($dat, $bla) { global $comps; - global $pingcmd; + global $ssh_port; + global $mcore_port; + global $ping_timeout; if(!isset($comps[$dat['serial']])) return false; - //passthru("/bin/ping -I eth0 -c 1 -W 1 -q ".$dat['ip']." &> /dev/null && exit 0 || exit 1",$retval); - passthru($pingcmd." ".$dat['ip']." &> /dev/null && exit 0 || exit 1",$retval); + // first try mcore, then get ssh + $retval = ping_host($dat['ip'],$mcore_port,$ping_timeout); + if($retval==1) $retval = ping_host($dat['ip'],$ssh_port,$ping_timeout); if($retval==0) { $comps[$dat['serial']]['online'] = true; @@ -135,7 +141,7 @@ else echo ''; echo ''; - echo ''.substr($c['location'],0,1).''; + echo ''.substr($c['location'],0,3).''; echo ''.strtoupper($pic).''; echo '#'.$c['serial'].''; echo ''.$c['hostname'].''; @@ -162,8 +168,8 @@ //$alxutils = $alxinfo[1]; } } - if($alxver == '') $alxver='unkown'; - if($alxutils == '') $alxutils='unkown'; + if($alxver == '') $alxver='unknown'; + if($alxutils == '') $alxutils='unknown'; echo ''.$alxver.''; echo ''.$alxutils.'';