Hi All, first of all, sorry for my english. It's not my mother language. Said that I start.
I use zext_msmtp.sh script to send alerts but some days ago it just stopped working.
So I don't know exactly why it stopped working but is like zabbix is sending the wrong command. It's a mystery to me I must confess.
Any help will be appreciated.
Thanks.
I use zext_msmtp.sh script to send alerts but some days ago it just stopped working.
- I didn't find anything useful in /var/log/zabbix-server/zabbix_server.log.
- I turn the debug option on inside the script and nothing at the begining.
- I run the script manually (/etc/zabbix/alerts.d/zext_msmtp.sh [email protected] "test subject" "test body") and It worked.
- I check logs again and I see everything is ok.
- I add logfile option in /etc/msmtprc (/var/log/zabbix_mail.log)
- I run the script again and everything is ok
- I generate an alert and voila! fields in recipient, subject, and body are empty
- I gererate another alert and check the command used by zabbix (ps ax) and I get these lines:
Code:sh -c /etc/zabbix/alert.d/zext_msmtp.sh "[email protected]" "OK: Host: bla bla bla" "more bla blabla" /bin/sh /etc/zabbix/alert.d/zext_msmtp.sh [email protected] OK: Host: bla bla bla more bla blabla msmtp --account zabbix [email protected]
- I ran the first line as it and I get an error "no recipient argument" (or something like that)
- Then I try two things
- I took off -c option (sh /etc/zabbix/alert.d/zext_msmtp.sh "[email protected]" "OK: Host: bla bla bla" "more bla blabla")
- I insterted ' (apostrophe) after -c option and at the end (sh -c '/etc/zabbix/alert.d/zext_msmtp.sh "[email protected]" "OK: Host: bla bla bla" "more bla blabla"')
and both worked!!
So I don't know exactly why it stopped working but is like zabbix is sending the wrong command. It's a mystery to me I must confess.
Any help will be appreciated.
Thanks.
Comment