Ad Widget

Collapse

zext_msmtp stops working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lokoluka
    Junior Member
    • Dec 2013
    • 3

    #1

    zext_msmtp stops working

    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.
    • 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
      1. I took off -c option (sh /etc/zabbix/alert.d/zext_msmtp.sh "[email protected]" "OK: Host: bla bla bla" "more bla blabla")
      2. 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.
  • tartan75
    Junior Member
    • Nov 2012
    • 7

    #2
    I'm not sure if I'll be able to help, but could you provide a bit more information:
    1. What Linux distribution are you using?
    2. What Zabbix version are you using?
    3. Has anything changed or been updated (even anything that you wouldn't expect to be relevant).

    Do I understand correctly that you receive the email but it is blank?

    Comment

    • lokoluka
      Junior Member
      • Dec 2013
      • 3

      #3
      Sure, I installed zabbix 2.0.6 on a Linux Ubuntu 12.04.

      I had some issues with Miredo so I purged and reinstalled, I changed locales to en_us.utf8, I added one entry to route table, I uninstalled gimp, firefox and thunderbird, and I upgrade some packages.

      For your last question, it is not correct. I don't receive any kind of emails if zabbix send them. I only receive them when I send them manually.

      I grabbed .bash_history and the apt-get history for that day and I will try to rollback the upgraded packages. If you have another suggestion I'll be pleased to hear it.

      Originally posted by tartan75
      I'm not sure if I'll be able to help, but could you provide a bit more information:
      1. What Linux distribution are you using?
      2. What Zabbix version are you using?
      3. Has anything changed or been updated (even anything that you wouldn't expect to be relevant).

      Do I understand correctly that you receive the email but it is blank?

      Comment

      • lokoluka
        Junior Member
        • Dec 2013
        • 3

        #4
        I fix it by reinstating on Debian. I just moved the database, config files, scripts, etc to the new server and it started sending emails again.

        Bye

        Comment

        Working...