I spent last 3 hours of reasearch on how to get nagios to work with email notifications, i need to send emails form work where the only accesible smtp server is the company's one.
i managed to get it done from the console using:
mail adam.xxxx@gmail.com
working perfectly for the purpouse i set up ssmtp.conf so as:
root=adam.xxxx@company.pl
mailhub=smtp.company.com:587
AuthUser=adam.xxx@company.pl
AuthPass=mypassword
FromLineOverride=YES
useSTARTTLS=YES
rewriteDomain=company.pl
hostname=nagios
UseTLS=YES
i also edited the file /etc/ssmtp/revaliases so as:
root:adam.xxxx@company.com:smtp.company.com:587
nagios:adam.xxxx@company.com:smtp.company.com:587
nagiosadmin:adam.xxxx@company.com:smtp.company.com:587
i also edited the file permisions for /etc/ssmtp/* so as:
-rwxrwxrwx 1 root nagios 371 lis 22 15:27 /etc/ssmtp/revaliases
-rwxrwxrwx 1 root nagios 1569 lis 22 17:36 /etc/ssmtp/ssmtp.conf
and i assigned to proper groups i belive:
cat /etc/group |grep nagios
mail:x:12:mail,postfix,nagios
mailnull:x:47:nagios
nagios:x:2106:nagios
nagcmd:x:2107:nagios
when i send mail manualy, i recieve it on my priv box, but when i send mail from nagios the mail log says:
Nov 22 17:47:03 certa-vm2 sSMTP[9099]: MAIL FROM:<root@company.pl>
Nov 22 17:47:03 certa-vm2 sSMTP[9099]: 550 You are not allowed to send mail from this address
it says root@company.com and im not allowed to send mails claiming to be root@company.com, its suppoused to be adam.xxxx@company.com, what am i doing wrong? i ran out of tricks...
kind regards Adam xxxx