You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
816 B

<?php
require_once('../ajax_asm.php');
$UID = intval( $CUser->Data['id'] );
$ACCESS = intval( $CUser->Data['access'] );
if( $UID > 1 ){
ob_start();
//@$MEMDB = new SQLite_DB( '/dev/shm/argus/mem_db.db');
$QS = "SELECT * FROM `servers` LIMIT 1";
//$RV = $MEMDB->Query( $QS );
$RV = array();
if( count( $RV ) ){
if( ( time() - intval( $RV[0]['ts'] ) ) < 3 ){
$Data['status']='ok';
$Data['stats']=$RV[0];
$Data['online'] = 1;
} else {
$Data['status'] ='na';
$Data['stats'] = array();
$Data['online'] = 0;
};
} else {
$Data['status']='na';
$Data['stats'] = array();
$Data['online'] = 0;
};
$Data['messages'] = ob_get_clean();
} else {
header('location: /');
exit();
};
echo json_encode( $Data );
?>