improved emailing and additional configuration options to use phpmailer. (#38 from Mike Stupalov)

git-svn-id: http://www.observium.org/svn/observer/trunk@3089 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-04-26 12:11:03 +00:00
parent 283f33afa1
commit 4045c970af
10 changed files with 3464 additions and 22 deletions
+2 -2
View File
@@ -44,14 +44,14 @@ while ($device = mysql_fetch_assoc($device_query))
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('0', '" . $device['device_id'] . "', 'Device is up\n')");
if ($config['alerts']['email']['enable'])
{
notify($device, "Device Up: " . $device['hostname'], "Device Up: " . $device['hostname'] . " at " . date($config['timestamp_format']));
notify($device, "Device Up: " . $device['hostname'], "Device Up: " . $device['hostname']);
}
} else {
$stat = "Down";
mysql_query("INSERT INTO alerts (importance, device_id, message) VALUES ('9', '" . $device['device_id'] . "', 'Device is down\n')");
if ($config['alerts']['email']['enable'])
{
notify($device, "Device Down: " . $device['hostname'], "Device Down: " . $device['hostname'] . " at " . date($config['timestamp_format']));
notify($device, "Device Down: " . $device['hostname'], "Device Down: " . $device['hostname']);
}
}