Skip to content

Commit 3bdfa35

Browse files
author
vogelor
committed
The Monitor now also monitors the ISPC-Version of each server
1 parent 465c9ed commit 3bdfa35

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

server/mods-available/monitor_core_module.inc.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function doMonitor() {
197197
/* Calls the single Monitoring steps */
198198
$this->monitorServer();
199199
$this->monitorOSVer();
200+
$this->monitorIspCVer();
200201
$this->monitorDiskUsage();
201202
$this->monitorMemUsage();
202203
$this->monitorCpu();
@@ -313,6 +314,42 @@ function monitorOsVer() {
313314
}
314315

315316

317+
function monitorIspcVer() {
318+
global $app;
319+
global $conf;
320+
321+
/* the id of the server as int */
322+
$server_id = intval($conf["server_id"]);
323+
324+
/** The type of the data */
325+
$type = 'ispc_info';
326+
327+
/*
328+
Fetch the data into a array
329+
*/
330+
$data['name'] = ISPC_APP_TITLE;
331+
$data['version'] = ISPC_APP_VERSION;
332+
333+
/* the ISPC-Version has no state. It is, what it is */
334+
$state = 'no_state';
335+
336+
/*
337+
Insert the data into the database
338+
*/
339+
$sql = "INSERT INTO monitor_data (server_id, type, created, data, state) " .
340+
"VALUES (".
341+
$server_id . ", " .
342+
"'" . $app->dbmaster->quote($type) . "', " .
343+
time() . ", " .
344+
"'" . $app->dbmaster->quote(serialize($data)) . "', " .
345+
"'" . $state . "'" .
346+
")";
347+
$app->dbmaster->query($sql);
348+
349+
/* The new data is written, now we can delete the old one */
350+
$this->_delOldRecords($type, 4);
351+
}
352+
316353
function monitorDiskUsage() {
317354
global $app;
318355
global $conf;

0 commit comments

Comments
 (0)