summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2017-10-24 15:19:30 +0200
committerUrban Müller2017-10-24 15:19:30 +0200
commit24406cd568a47a8a8e4b30406cf5c0ee1e4e2c82 (patch)
tree7c0bef6306f598cbfbe2312974f49004eba69ede
parente8f13f87ebe461f5b72c057ce57fccc767b3dd4d (diff)
downloaditools-24406cd568a47a8a8e4b30406cf5c0ee1e4e2c82.tar.gz
itools-24406cd568a47a8a8e4b30406cf5c0ee1e4e2c82.tar.bz2
itools-24406cd568a47a8a8e4b30406cf5c0ee1e4e2c82.zip
indicate time of previous err with timewindow; we seem to have false triggers
-rw-r--r--it.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it.class b/it.class
index 5246336..e42bbeb 100644
--- a/it.class
+++ b/it.class
@@ -200,7 +200,8 @@ static function error($p = array())
else
{
$errstampfn = "/tmp/alertdata/errstamp_" . urlencode($p['id']);
- $errstampage = time() - @filemtime($errstampfn);
+ $errstamp = @filemtime($errstampfn);
+ $errstampage = time() - $errstamp;
$sendmail = $errstampage >= $p['graceperiod'] && $errstampage <= $p['graceperiod'] + $p['timewindow'];
if ($errstampage > $p['graceperiod'])
{
@@ -248,7 +249,7 @@ static function error($p = array())
$stackframes[] = $stackframe;
$body .= "Host: " . getenv('HOSTNAME') . "\n\n";
- $body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . "\n\n" : "";
+ $body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . " (previous err: " . it::date('', $errstamp) . ")\n\n" : "";
$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 .= "Overview: ssh " . getenv('HOSTNAME') . " 'tail -100000 /tmp/alertdata/alert.log | grep \"$trace\"'\n\n";
$body .= $_GET ? "\$_GET: " . var_export($_GET, true) . "\n\n" : "";