--- alx-src/branches/alx-web-060/index.php 2012/02/01 10:54:50 3347 +++ alx-src/branches/alx-web-070/index.php 2015/09/11 15:25:31 7123 @@ -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; @@ -114,6 +120,8 @@ echo ''; echo ''; +//always enable showversion atm +$showversion = "on"; if($showversion=='on') echo ''; echo ''; @@ -133,7 +141,7 @@ else echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; echo ''; @@ -150,21 +158,21 @@ $alxver = $alxinfo[os]; $alxutils = $alxinfo[utils]; - if( $alxver == '') - { - if($c['online']) - { - //$alxinfo = @sshdo('os_ver=$('.$alxver.''; - echo ''; + echo ''; + echo ''; } echo ''; - echo ''; + echo ''; } echo '
editserialhostnameiplast connectedversionup/down
'.substr($c['location'],0,1).''.substr($c['location'],0,3).''.strtoupper($pic).'#'.$c['serial'].''.$c['hostname'].''.$alxutils.''.$alxver.''.$alxutils.''; @@ -178,7 +186,7 @@ else echo ''; echo '

';