diff options
author | Urban Müller | 2007-01-22 13:19:09 +0000 |
---|---|---|
committer | Urban Müller | 2007-01-22 13:19:09 +0000 |
commit | e364858336a05ec5750580aa4bfb2558af662637 (patch) | |
tree | 5dd8f10e1612150d2cd9e0dd680bc9fb185118b1 | |
parent | e1575289bfca4b6817a19ac36f636d3504439b53 (diff) | |
download | itools-e364858336a05ec5750580aa4bfb2558af662637.tar.gz itools-e364858336a05ec5750580aa4bfb2558af662637.tar.bz2 itools-e364858336a05ec5750580aa4bfb2558af662637.zip |
fewer alert repeats
-rw-r--r-- | it.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -67,6 +67,7 @@ function timerlog($label = '') * @param $to (optional) comma separated recipient list * @param named parameter id identifier of error. if given, only subsequent errors of same id will trigger message * @param named parameter timewindow number of seconds within which the second error must occur + * @param named parameter interval minimum number of seconds between alerts */ function error($p = array(), $body = "", $to = "") { @@ -82,7 +83,7 @@ function error($p = array(), $body = "", $to = "") $p = array(); } - $p += array('timewindow' => 25*3600); + $p += array('timewindow' => 25*3600, 'interval' => 6*3600); if (!$to) $to = strtr(trim(@file_get_contents($GLOBALS['ULTRAHOME'] . "/.diffnotice")), array("\n"=>',', ' '=>'')); @@ -115,7 +116,7 @@ function error($p = array(), $body = "", $to = "") } else { - $cmd = "alert -l " . escapeshellarg($to) . " 4 " . escapeshellarg($title); + $cmd = "alert -l -i " . escapeshellarg($p['interval']) ." " . escapeshellarg($to) . " 4 " . escapeshellarg($title); EDC('exec', $cmd); if (($pipe = popen($cmd, "w"))) |