Email subjects
This commit is contained in:
parent
37065e3a3e
commit
6483c516e3
1 changed files with 4 additions and 4 deletions
|
@ -291,12 +291,12 @@ sub send_notifications {
|
||||||
my ($task_id, $host, $type, $message, $status) = @_;
|
my ($task_id, $host, $type, $message, $status) = @_;
|
||||||
|
|
||||||
if ($status == 0) {
|
if ($status == 0) {
|
||||||
$subject = 'ALERT: host "' . $host . '" [' . $type . '] is down';
|
$subject = 'DOWN: host "' . $host . '" [' . $type . '] is down';
|
||||||
$datas = "------ ALERT DETECTED BY MONITORING SERVICE ------ \n\n\nDATETIME: " . server_time() . "(server time)\nHOST: " . $host . "\nSERVICE: " . $type . "\nMESSAGE: " . $message;
|
$datas = "------ ALERT DETECTED BY MONITORING SERVICE ------ \n\n\nDATETIME: " . server_time() . " (server time)\nHOST: " . $host . "\nSERVICE: " . $type . "\nMESSAGE: " . $message;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$subject = 'RECOVERY: host "' . $host . '" [' . $type . '] is up';
|
$subject = 'UP: host "' . $host . '" [' . $type . '] is up';
|
||||||
$datas = "------ RECOVERY DETECTED BY MONITORING SERVICE ------ \n\n\nDATETIME: " . server_time() . "(server time)\nHOST: " . $host . "\nSERVICE: " . $type . "\nMESSAGE: " . $message;
|
$datas = "------ RECOVERY DETECTED BY MONITORING SERVICE ------ \n\n\nDATETIME: " . server_time() . " (server time)\nHOST: " . $host . "\nSERVICE: " . $type . "\nMESSAGE: " . $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $query = $dbh->prepare('SELECT c.email FROM contacts as c JOIN notifications as n ON (n.contact_id = c.id) WHERE c.active = 1 AND n.task_id = '.$task_id);
|
my $query = $dbh->prepare('SELECT c.email FROM contacts as c JOIN notifications as n ON (n.contact_id = c.id) WHERE c.active = 1 AND n.task_id = '.$task_id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue