Okey, first of all I wanna say,
a smtp server should be a part of the zabbix server, incase of connection losses the server will still be able to send out alerts.
But anyway, i have been trying for a week now to get my server to send email notification, i have tryed to run a script action (sendEmail)
heres my script:
#!/bin/sh
export smtpemailfrom=zabbix@*mydomain.com*
export zabbixmailto="$1"
export zabbixsubject="$2"
export zabbixbody="$3"
export smtpserver=*mymailserver*
export smtpdomain=*mydomain.com*
#evt passord
#export smtplogin=
#export smtppass=
echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /tmp/mymailinput
echo "To: $zabbixemailto" >> /tmp/mymailinput
echo "Subject: $zabbixsubject" >> /tmp/mymailinput
echo "" >> /tmp/mymailinput
echo "This is an automated alert from Zabbix Network Monitoring. The mess
age is $zabbixbody" >> /tmp/mymailinput
/usr/bin/sendemail -f $smtpemailfrom -t $zabbixmailto -u $zabbixsubject -m $zabbixbody -s $smtpserver:1285 -l /tmp/mymailinput -v -v
# -xu $smtplogin -xp $smtppass
well, i cant see any happending in the logs, and i get no email, but if I do this command, it works perfect: ./zabbix_sendmail eparken@"mydomain.com" test okei
Under administration-> audit, it says that, my script action, has been completed /Successful.... but it dossent send out mail....
Can any1 tell me why my zabbixserver cant run this script? are my variables right? where do i check my variables?
Or do any1 know a good guide how to setup a mailserver and config it right so it will work on and with my zabbix server ?
BTW we have zabbix_server 1.8.4 & Ubuntu 10.04
a smtp server should be a part of the zabbix server, incase of connection losses the server will still be able to send out alerts.
But anyway, i have been trying for a week now to get my server to send email notification, i have tryed to run a script action (sendEmail)
HTML Code:
http://www.zabbix.com/forum/showthread.php?t=1323&highlight=smtp
#!/bin/sh
export smtpemailfrom=zabbix@*mydomain.com*
export zabbixmailto="$1"
export zabbixsubject="$2"
export zabbixbody="$3"
export smtpserver=*mymailserver*
export smtpdomain=*mydomain.com*
#evt passord
#export smtplogin=
#export smtppass=
echo "From: \"Zabbix Monitor\" <$smtpemailfrom>" > /tmp/mymailinput
echo "To: $zabbixemailto" >> /tmp/mymailinput
echo "Subject: $zabbixsubject" >> /tmp/mymailinput
echo "" >> /tmp/mymailinput
echo "This is an automated alert from Zabbix Network Monitoring. The mess
age is $zabbixbody" >> /tmp/mymailinput
/usr/bin/sendemail -f $smtpemailfrom -t $zabbixmailto -u $zabbixsubject -m $zabbixbody -s $smtpserver:1285 -l /tmp/mymailinput -v -v
# -xu $smtplogin -xp $smtppass
well, i cant see any happending in the logs, and i get no email, but if I do this command, it works perfect: ./zabbix_sendmail eparken@"mydomain.com" test okei
Under administration-> audit, it says that, my script action, has been completed /Successful.... but it dossent send out mail....
Can any1 tell me why my zabbixserver cant run this script? are my variables right? where do i check my variables?
Or do any1 know a good guide how to setup a mailserver and config it right so it will work on and with my zabbix server ?
BTW we have zabbix_server 1.8.4 & Ubuntu 10.04

Comment