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.

31 lines
816 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. $UID = intval( $CUser->Data['id'] );
  4. $ACCESS = intval( $CUser->Data['access'] );
  5. if( $UID > 1 ){
  6. ob_start();
  7. //@$MEMDB = new SQLite_DB( '/dev/shm/argus/mem_db.db');
  8. $QS = "SELECT * FROM `servers` LIMIT 1";
  9. //$RV = $MEMDB->Query( $QS );
  10. $RV = array();
  11. if( count( $RV ) ){
  12. if( ( time() - intval( $RV[0]['ts'] ) ) < 3 ){
  13. $Data['status']='ok';
  14. $Data['stats']=$RV[0];
  15. $Data['online'] = 1;
  16. } else {
  17. $Data['status'] ='na';
  18. $Data['stats'] = array();
  19. $Data['online'] = 0;
  20. };
  21. } else {
  22. $Data['status']='na';
  23. $Data['stats'] = array();
  24. $Data['online'] = 0;
  25. };
  26. $Data['messages'] = ob_get_clean();
  27. } else {
  28. header('location: /');
  29. exit();
  30. };
  31. echo json_encode( $Data );
  32. ?>