diff options
author | Urban Müller | 2017-10-24 15:19:30 +0200 |
---|---|---|
committer | Urban Müller | 2017-10-24 15:19:30 +0200 |
commit | 24406cd568a47a8a8e4b30406cf5c0ee1e4e2c82 (patch) | |
tree | 7c0bef6306f598cbfbe2312974f49004eba69ede | |
parent | e8f13f87ebe461f5b72c057ce57fccc767b3dd4d (diff) | |
download | itools-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.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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" : ""; |