| | |
| | | |
| | | // $now = time(); |
| | | // $old = $now - (4 * 60); // 4 minutes |
| | | $old = 'UNIX_TIMESTAMP() - 240'; |
| | | $old = 240; //seconds |
| | | |
| | | /* |
| | | * ATTENTION if i do NOT pay attention of the server id, i delete all data (of the type) |
| | |
| | | * even though it is the NEWEST data of this server. To avoid this i HAVE to include |
| | | * the server-id! |
| | | */ |
| | | $sql = 'DELETE FROM monitor_data ' . |
| | | 'WHERE ' . |
| | | ' type = ?' . |
| | | 'AND ' . |
| | | ' created < ? ' . |
| | | 'AND ' . |
| | | ' server_id = ?'; |
| | | $sql = 'DELETE FROM `monitor_data` WHERE `type` = ? AND `created` < UNIX_TIMESTAMP() - ? AND `server_id` = ?'; |
| | | $app->dbmaster->query($sql, $type, $old, $serverId); |
| | | } |
| | | |
| | |
| | | $mailSubject = ''; |
| | | $inHeader = true; |
| | | for($l = 0; $l < count($lines); $l++) { |
| | | if($lines[$l] == '') { |
| | | if(trim($lines[$l]) == '') { |
| | | $inHeader = false; |
| | | continue; |
| | | } |