help with syslog email alerts
Moderators: Developers, Moderators
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
help with syslog email alerts
I have finally managed to put my haloe plugin working. But I created some rules for notification and I just dont get the emails..
how does the notification works? I use the SMTP function of thold to get emails delivered and thats the only way it will work here
any advice??
how does the notification works? I use the SMTP function of thold to get emails delivered and thats the only way it will work here
any advice??
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
I have the same problem, but I haven't researched it enough to find an answer....
----------
PHP Network Weathermap (weathermap - v0.92)
Thresholds (thold - v0.3.0)
Device Monitoring (monitor - v0.7)
Network Discovery (discovery - v0.6)
Network Tools (tools - v0.2)
Syslog Monitoring (haloe - v0.4)
mactrack
RRD Cleaner (rrdclean - v1.1)
Update Checker (update - v0.3)
FlowView (flowview - v0.3)
Host Info (hostinfo - v0.1)
Error Images (errorimage - v0.1)
report it! (ReportIt - v0.4.2)
Create Aggregate Graphs (aggregate - v0.62)
----------
PHP Network Weathermap (weathermap - v0.92)
Thresholds (thold - v0.3.0)
Device Monitoring (monitor - v0.7)
Network Discovery (discovery - v0.6)
Network Tools (tools - v0.2)
Syslog Monitoring (haloe - v0.4)
mactrack
RRD Cleaner (rrdclean - v1.1)
Update Checker (update - v0.3)
FlowView (flowview - v0.3)
Host Info (hostinfo - v0.1)
Error Images (errorimage - v0.1)
report it! (ReportIt - v0.4.2)
Create Aggregate Graphs (aggregate - v0.62)
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
Sendmail
You can edit sendmail config to send to a smart host to relay the messages. (/etc/mail/sendmail.cf)
# "Smart" relay host (may be null)
DSmail.bellsouth.net
you will have to uncomment the above line and ensure DS is before your smtp relay, as shown above.
Just got it working today after some reading up on sendmail.
You may be able to edit the /var/www/html/cacti/plugins/haloe/class.smtp.php file to send directly to your isp by chagning some variables. Didn't try it though.
# "Smart" relay host (may be null)
DSmail.bellsouth.net
you will have to uncomment the above line and ensure DS is before your smtp relay, as shown above.
Just got it working today after some reading up on sendmail.
You may be able to edit the /var/www/html/cacti/plugins/haloe/class.smtp.php file to send directly to your isp by chagning some variables. Didn't try it though.
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
-
- Posts: 14
- Joined: Tue Jul 10, 2007 3:05 pm
I know very little about php but just by looking at it I would think that you could change the $host, variable.... in the class.smtp file section:
function Connect($host,$port=0,$tval=30) {
# set the error val to null so there is no confusion
$this->error = null;
to
function Connect($host=yourmailserver,$port=0,$tval=30) {
# set the error val to null so there is no confusion
$this->error = null;
Also if you use the sendmail option (send to smart host in the above post) you can have it forward to your internal smtp server as well. I have mine forwarding to an internal Exchange server.
Let me know if it works!
function Connect($host,$port=0,$tval=30) {
# set the error val to null so there is no confusion
$this->error = null;
to
function Connect($host=yourmailserver,$port=0,$tval=30) {
# set the error val to null so there is no confusion
$this->error = null;
Also if you use the sendmail option (send to smart host in the above post) you can have it forward to your internal smtp server as well. I have mine forwarding to an internal Exchange server.
Let me know if it works!
-
- Posts: 30
- Joined: Sat Apr 28, 2007 3:57 am
I am using smtp in my Windows environment, and I looked at haloe's php files.
These are the file I see need to update, but I still can't send email.
Any ideas?
class.phpmailer.php
class.smtp.php (optional) - value of $host should be defined in class.phpmailer.php's $Host
These are the file I see need to update, but I still can't send email.
Any ideas?
class.phpmailer.php
Code: Select all
...
/**
* Method to send mail: ("mail", "sendmail", or "smtp").
* @var string
*/
//var $Mailer = "mail";
var $Mailer = "smtp";
...
/**
* Sets the SMTP hosts. All hosts must be separated by a
* semicolon. You can also specify a different port
* for each host by using this format: [hostname:port]
* (e.g. "smtp1.example.com:25;smtp2.example.com").
* Hosts will be tried in order.
* @var string
*/
//var $Host = "localhost";
var $Host = "192.168.0.1";
...
Code: Select all
...
function Connect($host="192.168.0.1",$port=25,$tval=30) {
...
-
- Posts: 30
- Joined: Sat Apr 28, 2007 3:57 am
Hi guys,
below are additional info I found out about SMTP.
If using smtp, also need to change $mail->IsMail() to $mail->IsSMTP().
haloe's functions.php
I created a smtptest php script to call syslog_mail_alerts() function in haloe_alert.php.
smtptest.php (placed this in haloe's directory
If everything works fine. You should received a test email.
Now the problem is I still don't get how haloe send out alert email after examine the code.
No where I see is calling the syslog_mail_alerts() function.
Anybody got an idea?
below are additional info I found out about SMTP.
If using smtp, also need to change $mail->IsMail() to $mail->IsSMTP().
haloe's functions.php
Code: Select all
function syslog_mail_alerts($to, $from, $subject, $message) {
...
//$mail->IsMail(); // set mailer to use PHPMailer
$mail->IsSMTP();
...
smtptest.php (placed this in haloe's directory
Code: Select all
<?php
$to="test@local.com";
$from="test@local.com";
$subject="Testing in Progress...";
$message="Test 123";
chdir('../../');
include_once("plugins/haloe/functions.php");
syslog_mail_alerts($to, $from, $subject, $message);
Now the problem is I still don't get how haloe send out alert email after examine the code.
No where I see is calling the syslog_mail_alerts() function.
Anybody got an idea?
Hi
I think I have found the problem for some of people like me. Instead to insert the trap in the syslog_incoming table we have insert it directly in the syslog .....
I will update my "syslogupd" in order to fill the incoming table (in few days).
I think I have found the problem for some of people like me. Instead to insert the trap in the syslog_incoming table we have insert it directly in the syslog .....
I will update my "syslogupd" in order to fill the incoming table (in few days).
Jean-Michel
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
cacti 0.8.7e | cmd & cactid (cactid 0.8.x) | Linux | MySQL Ver 14.7 Distrib 4.1.12, for Win32 | PHP v5.2.6 | Apache v2.x | Thold | Plugin Architecture | plugin "configuration manager" http://cactiusers.org/forums/topic257.html | plugin "IP subnet calculator IPv4 / IPV6" http://forums.cacti.net/viewtopic.php?t=15428 | plugin banner http://docs.cacti.net/userplugin:banner | Net-SNMP 5.5.2 | cygwin 1.5.18 of 02.07.2005
Who is online
Users browsing this forum: No registered users and 2 guests