| | |
| | | $this->_monitorRaid(); |
| | | $this->_monitorRkHunter(); |
| | | $this->_monitorFail2ban(); |
| | | $this->_monitorMongoDB(); |
| | | $this->_monitorIPTables(); |
| | | $this->_monitorSysLog(); |
| | | } |
| | |
| | | $this->_delOldRecords($res['type'], $res['server_id']); |
| | | } |
| | | |
| | | private function _monitorMongoDB() { |
| | | global $app; |
| | | |
| | | /* |
| | | * First we get the Monitoring-data from the tools |
| | | */ |
| | | $res = $this->_tools->monitorMongoDB(); |
| | | |
| | | /* |
| | | * Insert the data into the database |
| | | */ |
| | | $sql = 'REPLACE 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 _monitorIPTables() { |
| | | global $app; |