Ad Widget

Collapse

Zabbix 1.8.2 SMS Alerts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Melanie Long
    Junior Member
    • May 2010
    • 9

    #1

    Zabbix 1.8.2 SMS Alerts

    Hi,

    We use a SMS gateway to send alerts. When the alert gets sent and received on the cellphone, its just gibberish. The email alerts are working perfectly. I have tested it with different formats, and it doesnt make a difference. Is there a setting that is need for Zabbix to be able to use a SMS Gateway to relay sms's ?

    tks
  • jfischer
    Junior Member
    • Jan 2010
    • 11

    #2
    This seems to be a bug regarding to UTF-8 encondings introduced with 1.8.2. We stumbled upon this, too. A very simple workaround on UNIX is a script that calls the "mail" (or "mailx") utility, e.g. create a Media Type to execute a custom alert script. Put a little custom alert scripts in the configured path, which basically does the following:

    Code:
    /bin/mail -s "$2" "$1"
    Map that media type to your users, configure the recipients, and your Mail-2-SMS works again.

    Comment

    • Melanie Long
      Junior Member
      • May 2010
      • 9

      #3
      thanks so much
      Do you have an example of the script i should use. I am pretty new to zabbix.

      /bin/mail -s "$2" "$1" - is the $1 = the script ?

      Is the mail utility installed on linux by default, or will i need to install it ?

      thanks again

      Comment

      • jfischer
        Junior Member
        • Jan 2010
        • 11

        #4
        You could use the following example script:

        Code:
        #!/bin/sh
        echo "" | mail -s "$2" $1
        Put it in the directory as defined by AlertScriptsPath in zabbix_server.conf. Make sure the script is executable.

        As for the variables, $1 is the recipient, $2 the subject and $3 the message. In our specific case, we don't require the full alert in SMS messages, we just need the subject (it contains all data we need). If you want to send the full message, replace 'echo ""' above with 'echo "$3"'.

        As for the mail utility, check on the ZABBIX server if it does exist. If not, install the "mail" or "mailx" package depending on your distribution.

        Comment

        • Melanie Long
          Junior Member
          • May 2010
          • 9

          #5
          I have created the script and tested that its executable, i have tested that the zabbix server can send emails by using mailx to send my outlook an email - tested OK. I have created the media type and linked to to the new users, and in the actions it says that the email was sent ok to the script, but yet i am still not getting an sms.

          Am i missing something ? Is there a mail queue or log that i can check where these emails are going, or if there is errors while sending them ?

          Thanks so much for the quick response

          Comment

          • Melanie Long
            Junior Member
            • May 2010
            • 9

            #6
            Under users, what path should a person put in the send to field when using a script to send sms's ? And under media types when selecting script, should the script name be the full path or literally just the script name ?

            Comment

            • jfischer
              Junior Member
              • Jan 2010
              • 11

              #7
              For the script name, it is just the name of the script (which must reside in the CustomAlertScripts path, as configured in zabbix_server.conf) and must be executable by zabbix user. E.g. if your CustomAlertScripts is configured to be /usr/share/zabbix/CustomAlertScripts and the script is /usr/share/zabbix/CustomAlertScripts/mail2sms.sh, put in mail2sms.sh for script name.

              The "Send to" field should be the e-mail address of your SMS gateway user, e.g. <phonenumber>@<yoursmsgateway> (just like for media-type E-mail). This will be the argument $1 supplied to the script.

              Hope that helped.

              Comment

              • Melanie Long
                Junior Member
                • May 2010
                • 9

                #8
                Its working!!!!!!!!!! LOL, thanks so much, took me long enough. But hey from being a newby, i now know alot more! THANKS AGAIN

                Comment

                Working...