summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2017-08-23 16:22:47 +0200
committerUrban Müller2017-08-23 16:22:47 +0200
commit11f3921d48ca48a9e9da84a4822583a3ca34df43 (patch)
tree3a75920f45595e907c5b9a5a3effe1dff401cd18 /it.class
parentf5af7c571f53357ec037c0b6f798148d80209d04 (diff)
downloaditools-11f3921d48ca48a9e9da84a4822583a3ca34df43.tar.gz
itools-11f3921d48ca48a9e9da84a4822583a3ca34df43.tar.bz2
itools-11f3921d48ca48a9e9da84a4822583a3ca34df43.zip
provide command line for checking past errs
Diffstat (limited to 'it.class')
-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