vogelor
2010-05-10 3bdfa350abd475078b8f43f7210efe6a07d21fba
The Monitor now also monitors the ISPC-Version of each server
1 files modified
37 ■■■■■ changed files
server/mods-available/monitor_core_module.inc.php 37 ●●●●● patch | view | raw | blame | history
server/mods-available/monitor_core_module.inc.php
@@ -197,6 +197,7 @@
        /* Calls the single Monitoring steps */
        $this->monitorServer();
        $this->monitorOSVer();
        $this->monitorIspCVer();
        $this->monitorDiskUsage();
        $this->monitorMemUsage();
        $this->monitorCpu();
@@ -313,6 +314,42 @@
    }
    function monitorIspcVer() {
        global $app;
        global $conf;
        /* the id of the server as int */
        $server_id = intval($conf["server_id"]);
        /** The type of the data */
        $type = 'ispc_info';
        /*
        Fetch the data into a array
        */
        $data['name'] = ISPC_APP_TITLE;
        $data['version'] = ISPC_APP_VERSION;
        /* the ISPC-Version has no state. It is, what it is */
        $state = 'no_state';
        /*
        Insert the data into the database
        */
        $sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
                "VALUES (".
                $server_id . ", " .
                "'" . $app->dbmaster->quote($type) . "', " .
                time() . ", " .
                "'" . $app->dbmaster->quote(serialize($data)) . "', " .
                "'" . $state . "'" .
                ")";
        $app->dbmaster->query($sql);
        /* The new data is written, now we can delete the old one */
        $this->_delOldRecords($type, 4);
    }
    function monitorDiskUsage() {
        global $app;
        global $conf;