summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class6
1 files changed, 4 insertions, 2 deletions
diff --git a/it.class b/it.class
index 47ce722..2407b5b 100644
--- a/it.class
+++ b/it.class
@@ -240,7 +240,7 @@ static function error($p = array())
if ($sendmail) # we're mailing: send maximum info
{
- $p['title'] = "Alert: " . it::replace(['\.[^:]*' => "", '(alert|server): ' => "", "^: " => ""], $GLOBALS['ULTRASITE'] . ": ") . $p['title'] . " (via " . getenv('HOSTNAME') . ")";
+ $p['title'] = it::replace(['\.[^:]*' => "", '(alert|server): ' => "", "^: " => ""], $GLOBALS['ULTRASITE'] . ": ") . $p['title'] . " (via " . getenv('HOSTNAME') . ")";
if (!$p['omitdebuginfo'])
{
@@ -251,6 +251,7 @@ static function error($p = array())
$body .= "Host: " . getenv('HOSTNAME') . "\n\n";
$body .= $p['id'] ? "Filter: timewindow=" . $p['graceperiod'] . "-" . ($p['graceperiod'] + $p['timewindow']) . "\n\n" : "";
$body .= "Time: " . date("Y-m-d H:i:s") . "\n\n"; # no it::date() because of 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" : "";
$body .= $_POST ? "\$_POST: " . var_export($_POST, true) . "\n\n" : "";
$body .= $_COOKIE ? "\$_COOKIE: " . var_export($_COOKIE, true) . "\n\n" : "";
@@ -262,7 +263,8 @@ static function error($p = array())
$body = it::replace(array('(pw|passw|password|secret)(\] => |=)[^&\s]*' => '$1$2********'), $body, array('utf8' => false));
}
- it::mail(array('To' => $p['to'], 'Subject' => substr($p['title'], 0, 160), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel()));
+ it::mail(array('To' => $p['to'], 'Subject' => "Alert: " . substr($p['title'], 0, 160), 'Body' => $body, 'Cc' => $GLOBALS['it_defaultconfig']['error_cc'], 'forcemail' => !it::is_devel()));
+ $p['title'] = "Mail: " . $p['title'];
}
else if ($_SERVER['REMOTE_ADDR']) # toscreen mode: web
echo "<pre style='z-index:10000; position:relative; background:white'>" . htmlspecialchars($p['title'] . "\n" . rtrim($body), ENT_COMPAT, "iso-8859-1") . "</pre>"; # works with iso-8859-1 or utf-8, UTF8SAFE