Hi All, this document deals with how to configure SMS in Zabbix using AWS SNS.
Zabbix is an open source monitoring software tool for diverse IT components, including networks, servers, virtual machines, and cloud services. Zabbix provides monitoring metrics, among others network utilization, CPU load and disk space consumption

Its required to have a monitoring system to monitor your infrastructure an including server, application, network device. Zabbix does this with an alerting system including emails and SMS. Since we have cloud service available for sending SMS here we are going to use AWS SNS ( simple notification service) for sending SMS rather than using GSM modem.

You can approach GSM modem when you have your monitoring system in On-premises, where is use cloud services when you deployed your monitoring system in the cloud.

So here I will guide you how to set up SMS alerts in Zabbix using AWS SNS.

prerequisites

1. AWS IAM user with access and a secret key which have access to SNS for sending SMS.
2. Installed Zabbix Server, if not installed check this link.

Configuration

login to Zabbix server via SSH and create a sns.sh script in location /usr/lib/zabbix/alertscripts

vi sns.sh

Add the following lines in the script, replace your access key, secret key, and region.

if [ $# -eq 2 ]; then
    AWS_ACCESS_KEY_ID="AKIAnnnnnnnnnnnnnn" \
    AWS_SECRET_ACCESS_KEY="MySecretKeyHere" \
    AWS_DEFAULT_REGION="eu-west-1" \
    /bin/aws sns publish --phone-number "${1}" --message "${2}"
else
    /bin/echo -e "\nThis script requires 2 parameters."
    /bin/echo -e "\nUsage: ${0} PhoneNumberInE.194 Message\n"
    /bin/echo -e "\nUsage: ${0} +44nnnnnnnn 'My message here'\n"
fi

Apply execution permission to the file

chmod +x sns.sh

Now login to WEB UI of Zabbix server.

Go to Administration – Media types


Create a Media Type

Name: SNS
Type: script
Enter 2 parameters for the script
{ALERT.SENDTO}
{ALERT.MESSAGE}

Then Goto User- select user – add media

Type: SNS
send to: Add your mobile number including country code.
Severity: Select according to your need.

Make sure that AWS SNS support your Country.

that’s it now you have completed SMS alert configuration.
The user will receive the alerts via SMS in there any issues are triggered.

 

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.