From bf4aa22ea6f0ba4d7177e9810051a27450309f69 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 5 Feb 2018 15:13:15 +0100 Subject: find previous errs if on previous days --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it.class b/it.class index 83fcf0e..54ac227 100644 --- a/it.class +++ b/it.class @@ -266,7 +266,7 @@ static function error($p = array()) $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 .= !$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 .= ($trace and $t = it::exec('grep {0} `ls /tmp/alertdata/alertlog-*|tail -3` 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" : ""; -- cgit v1.2.3