標籤:
使用mailx發送警示郵件,具體過程如下:
配置安裝mailx軟體
rpm -qa | grep mailx //如果已經安裝則無需再安裝
yum install mailx //使用yum 方式進行安裝
make && make install UCBINSTALL=/usr/bin/install //源碼安裝命令
修改設定檔 /etc/mail.rc
添加如下內容:
set [email protected] smtp=smtp.qq.com
set smtp-auth-user=xxxx smtp-auth-password=xxxx
set smtp-auth=login
說明:from 就是寄件者的郵件地址,最好是你自己的一個可用的郵件地址。
smtp 發送郵件伺服器網域名稱
smtp-auth-user 登入郵箱的使用者名稱
smtp-auth-password 登入密碼
smtp-auth 驗證方式了
#chmod 600 .mailrc
測試:echo "1111" | mailx -s "zabbix" xxx
zabbix上配置郵件警示具體過程
-
配置Media types
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/74/5C/wKioL1YbcLuBp08bAAOiRR7C6Ms741.jpg" title="1.jpg" alt="wKioL1YbcLuBp08bAAOiRR7C6Ms741.jpg" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/74/5C/wKioL1YbcMrxKn_BAAEKe7ENHjg438.jpg" title="2.jpg" alt="wKioL1YbcMrxKn_BAAEKe7ENHjg438.jpg" />
指令碼的位置:
zabbix_server.conf
AlertScriptsPath=/usr/local/zabbix/scripts/email_alerts.sh
-
配置接收警示郵件的郵箱資訊
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/74/60/wKiom1YbclaAMQCSAAHpIJtYBe8037.jpg" title="3.jpg" alt="wKiom1YbclaAMQCSAAHpIJtYBe8037.jpg" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/60/wKiom1YbdxCBzm9vAAJeKfs5ivo016.jpg" title="1111.jpg" alt="wKiom1YbdxCBzm9vAAJeKfs5ivo016.jpg" />
-
配置Action,Action主要作用當觸發器觸發時採取的發送郵件操作
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/74/60/wKiom1YbcliCS1NPAAKCvS6tWcM264.jpg" title="5.jpg" alt="wKiom1YbcliCS1NPAAKCvS6tWcM264.jpg" />
Action選項卡裡面用於配置action的名字,郵件的內容等基本資料
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/74/5D/wKioL1YbcnahYf4nAAIFOZ-vfm4019.jpg" style="float:none;" title="6.jpg" alt="wKioL1YbcnahYf4nAAIFOZ-vfm4019.jpg" />
conditions選項卡裡用於定義,此動作使用哪個觸發器,應用於哪個主機,或主機群組
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/60/wKiom1YbclmSWdU3AAGOVIV4gAQ883.jpg" style="float:none;" title="7.jpg" alt="wKiom1YbclmSWdU3AAGOVIV4gAQ883.jpg" />
operations定義了操作詳情
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/74/5D/wKioL1YbcnfCek_fAANgBv7nbMQ847.jpg" style="float:none;" title="8.jpg" alt="wKioL1YbcnfCek_fAANgBv7nbMQ847.jpg" />
本文出自 “咚咚的部落格” 部落格,請務必保留此出處http://weadyweady.blog.51cto.com/3012956/1702175
zabbix 郵件警示配置