First, sendemail configuration Zabbix Mail Alarm
1. Download SendEmail:
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
2, Configuration SendEmail:
# yum-y Install Perl-net-ssleay perl-io-socket-ssl # Installation Kit # tar XF sendemail-v1.56.tar.gz-c/usr/src/# cd/usr/src/se ndemail-v1.56/# lltotal 116-rw-r--r--1 root root 13329 Sep changelog-rw-r--r-- 1 root root 7949 Sep 30
2009 readme-rw-r--r--1 root root 4701 Sep readme-br.txt-rwxr-xr-x 1 root root 80213 Sep Sen demaillrwxrwxrwx 1 root root 9 Sep sendemail.pl-sendemail-rw-r--r--1 root root 1229 Sep 30
2009 todo# cp-a sendemail/usr/local/bin/
3. Test the command line to send the message:
/usr/local/bin/sendemail–f [email protected]-t [email protected]-s smtp.163.com-u "Test SendEmail"-O message-content- Type=html-o Message-charset=utf8-xu [email protected]-xp 123456-m "hahaha" 11:23:37 localhost sendemail[17493]: Email was sent successfully! # Send successful return this informational prompt.
4. Send mail script: (/usr/local/etc/zabbix/alertscripts/email.sh)
#!/bin/bash
export LANG=ZH_CN. UTF8 To=$1 Subject=$2 Body=$3 /usr/local/bin/sendemail- F<Ahref= "Mailto:[email protected]">[Email protected]</A>- T "$to"-S Smtp.163.com-u "$subject"-O message-content-type=html-o message-charset =utf8-xu<Ahref= "Mailto:[email protected]">[Email protected]</A>-xp 04484248929-m "$body"
Script parameter Description:
-F: Sender mailbox
-T: Recipient mailbox
-U: Theme
-O: Options
-xu: User Name
-XP: Password
-M: Message body
Note: 163, QQ mailbox needs to set the following to generate authorization code, the authorization code in place of the password to successfully send the message.
Send the message through the command successfully, send the mail script is also written, and placed in the directory specified in the Zabbix_server configuration file, then we can then configure the mail alarm through the Zabbix Web page.
Second, configure the Zabbix Web Management page to add alarms
1. Configure the type of alarm media
Manage-to-alarm media type--Create media type
2. Add User settings
Manage--user--Create user
3. User group settings
Manage-user groups
4. Configure actions
Configure-action
Configuration--Action
Default recipient:
Fault {TRIGGER. STATUS}, server: {HOSTNAME1} occurred: {Trigger.name} failed!
Confidence Information:
Alarm host: {HOSTNAME1}</BR>Alarm time: {EVENT. DATE} {EVENT. TIME}</BR>Alarm level: {TRIGGER. SEVERITY}</BR>warning message: {trigger.name}</BR>Alarm item: {TRIGGER. KEY1}</BR>problem Details: {item.name}:{item. VALUE}</BR>Current status: {TRIGGER. Status}:{item. VALUE1}</BR>Event Id:{event.id}
Configure-to-action recovery operations
Default recipient:
Restore {TRIGGER. STATUS}, server: {HOSTNAME1}: {trigger.name} restored!
Confidence Information:
Alarm host: {HOSTNAME1}</BR>Alarm time: {EVENT. DATE} {EVENT. TIME}</BR>Alarm level: {TRIGGER. SEVERITY}</BR>warning message: {trigger.name}</BR>Alarm item: {TRIGGER. KEY1}</BR>problem Details: {item.name}:{item. VALUE}</BR>Current status: {TRIGGER. Status}:{item. VALUE1}</BR>Event Id:{event.id}
Zabbix monitoring alarm to introduce here, there are many parameters did not do a detailed description, I hope to learn more about the friends, you can view the relevant documents and books, here most of the form of pictures show the process of mail alarm.
Zabbix Mail Alarm (v)