--- alx-src/branches/alx-web-070/index.php 2015/12/16 15:21:22 8005 +++ alx-src/branches/alx-web-070/index.php 2016/02/08 09:59:56 8525 @@ -30,14 +30,11 @@ function check_online($dat, $bla) { global $comps; - global $ssh_port; global $mcore_port; global $ping_timeout; if(!isset($comps[$dat['serial']])) return false; - // 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; @@ -73,7 +70,7 @@ else return ''; } -$comps = sqlarr("select client_serials.serial, client_serials.location, client_serials.mac, cfg_network.hostname, state_connected.mtime, state_connected.netboot from client_serials left join cfg_network on client_serials.serial=cfg_network.serial left join state_connected on client_serials.serial=state_connected.serial", "serial"); +$comps = sqlarr("select client_serials.serial, client_serials.enabled, client_serials.location, client_serials.mac, cfg_network.hostname, state_connected.mtime, state_connected.netboot from client_serials left join cfg_network on client_serials.serial=cfg_network.serial left join state_connected on client_serials.serial=state_connected.serial", "serial"); sqlforeach('SELECT state_connected.serial, state_connected.ip, cfg_network.hostname, state_connected.mac FROM state_connected left join cfg_network on cfg_network.serial=state_connected.serial', 'check_online', null); usort($comps, 'sortcomp'); @@ -122,18 +119,19 @@ echo 'editserialhostnameipmaclast connected'; //always enable showversion atm $showversion = "on"; -if($showversion=='on') echo 'version'; +if($showversion=='on') echo 'version'; +echo 'boot'; echo 'up/down'; foreach($comps as $c) { if(!$_SESSION['alx_sort_loc'][$c['location']]) Continue; - if($c['serial']<0 && !$_SESSION['alx_sort_loc']['DEAD']) Continue; + if($c['enabled']==0 && !$_SESSION['alx_sort_loc']['DEAD']) Continue; if($c['online']) $pic='online'; else $pic='offline'; - if($c['serial']<0) + if($c['enabled']==0) { echo ''; $pic = 'deact'; @@ -159,10 +157,6 @@ $alxver = $alxinfo[os]; $alxutils = $alxinfo[utils]; - //netboot state - if($c['netboot'] == 1) $bootmethod = 'Netboot (PXE)'; - else $bootmethod = 'Local Disk'; - // if( $alxver == '') // { // if($c['online']) @@ -176,11 +170,14 @@ if($alxver == '') $alxver='unknown'; if($alxutils == '') $alxutils='unknown'; - echo ''.$bootmethod.''; echo ''.$alxver.''; echo ''.$alxutils.''; } + //netboot state + if($c['netboot'] == 1) echo 'Netboot (PXE)'; + else echo 'Local Disk'; + echo ''; if($c['online']) {