summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it.class b/it.class
index bb61397..149ec04 100644
--- a/it.class
+++ b/it.class
@@ -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")))