tbrehm
2011-06-08 3cdb9a8fdc13ceb9de7a32b6fd989b76bafb45af
server/mods-available/monitor_core_module.inc.php
@@ -86,6 +86,7 @@
      /*
       * Calls the single Monitoring steps 
       */
      $this->_monitorEmailQuota();
      $this->_monitorHDQuota();
      $this->_monitorServer();
      $this->_monitorOsVer();
@@ -113,6 +114,31 @@
      $this->_monitorFail2ban();
      $this->_monitorSysLog();
   }
    private function _monitorEmailQuota() {
        global $app;
        /*
         * First we get the Monitoring-data from the tools
         */
        $res = $this->_tools->monitorEmailQuota();
        /*
         * Insert the data into the database
         */
        $sql = 'INSERT INTO monitor_data (server_id, type, created, data, state) ' .
                'VALUES (' .
                $res['server_id'] . ', ' .
                "'" . $app->dbmaster->quote($res['type']) . "', " .
                'UNIX_TIMESTAMP(), ' .
                "'" . $app->dbmaster->quote(serialize($res['data'])) . "', " .
                "'" . $res['state'] . "'" .
                ')';
        $app->dbmaster->query($sql);
        /* The new data is written, now we can delete the old one */
        $this->_delOldRecords($res['type'], $res['server_id']);
    }
   private function _monitorHDQuota() {
      global $app;
@@ -366,7 +392,7 @@
      /*
       *  This monitoring is expensive, so do it only once an hour
       */
      $min = date('i');
      $min = @date('i');
      if ($min != 0)
         return;
@@ -451,8 +477,8 @@
      /*
       *  This monitoring is expensive, so do it only once a day
       */
      $min = date('i');
      $hour = date('H');
      $min = @date('i');
      $hour = @date('H');
      if (!($min == 0 && $hour == 23))
         return;
      /*
@@ -763,4 +789,4 @@
}
?>
?>