summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-04-25 14:55:31 +0200
committerUrban Müller2018-04-25 14:55:31 +0200
commit1a671e962786da343919b4ce6a33efc3077962c0 (patch)
tree35f8476274cb224047c6f00f3e87ae81676ef5d6
parent817d4c55d30685b0dbee464f5aa63664020a05ad (diff)
downloaditools-1a671e962786da343919b4ce6a33efc3077962c0.tar.gz
itools-1a671e962786da343919b4ce6a33efc3077962c0.tar.bz2
itools-1a671e962786da343919b4ce6a33efc3077962c0.zip
fix histogram, prevent hanging if no alertlogs
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index 4c8c0f1..5820291 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} `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 .= ($trace and $t = it::exec('grep -h {0} `ls /tmp/alertdata/alertlog-*|tail -3` /dev/null 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" : "";