diff options
author | Urban Müller | 2018-01-12 17:54:33 +0100 |
---|---|---|
committer | Urban Müller | 2018-01-12 17:54:33 +0100 |
commit | 1b6f4c10069a3bc12b2f8f6b6414338ddc084223 (patch) | |
tree | 0d4216b3c8da1720ec4105a268c49496ed7b0f9e | |
parent | 2c587d8efa0ad426ee7fab622c5dbe7bca00c351 (diff) | |
download | itools-1b6f4c10069a3bc12b2f8f6b6414338ddc084223.tar.gz itools-1b6f4c10069a3bc12b2f8f6b6414338ddc084223.tar.bz2 itools-1b6f4c10069a3bc12b2f8f6b6414338ddc084223.zip |
no overview possible if no trace
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -265,8 +265,8 @@ static function error($p = array()) $body .= "Time: " . date("Y-m-d H:i:s") . (($t = time() - $_SERVER['REQUEST_TIME']) ? " (started {$t}s before)" : "") . "\n\n"; # no it::date() due to time- debug param $body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n\n" : ""; $body .= $origp['blockmail'] ? "Block-resend: " . $origp['blockmail'] . " seconds\n\n" : ""; - $body .= "Overview: ssh " . getenv('HOSTNAME') . " 'cat /tmp/alertdata/alertlog | grep \"$trace\"'\n\n"; - $body .= ($t = it::exec('grep {0} /tmp/alertdata/alertlog 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $trace)) ? "Histogram: (last 10 minutes)\n$t\n" : ""; + $body .= !$trace ? "" : "Overview: ssh " . getenv('HOSTNAME') . " 'cat /tmp/alertdata/alertlog | grep \"$trace\"'\n\n"; + $body .= ($trace and $t = it::exec('grep {0} /tmp/alertdata/alertlog 2>/dev/null | grep ^2 | cut -d : -f 1-2 | sort | uniq -c | tail -10', $trace)) ? "Histogram: (today's last 10 affected minutes)\n$t\n" : ""; $body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : ""; $body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : ""; $body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : ""; |