標籤:zabbix user group media types alert actions
定義Media:
Administration--Media types--Create Media types or Edit
註:smtp email選項框裡@後面需要寫網域名稱,不能寫IP,如:[email protected]而不是[email protected]
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/7F/80/wKioL1cg3NCC087cAABiWUvoxMk719.png" title="1.png" alt="wKioL1cg3NCC087cAABiWUvoxMk719.png" />
添加使用者和組:
Administration--Users--User groups--Create user group
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/7F/82/wKiom1cg3FbiqrOkAACXSH8WGdg212.png" title="1.png" alt="wKiom1cg3FbiqrOkAACXSH8WGdg212.png" />
可以點擊組給組添加許可權,在該組的使用者也會擁有相應的許可權
Administration--Users--Users---Create User
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/7F/82/wKiom1cg3IKSjJe7AABmQe0WJlk950.png" title="1.png" alt="wKiom1cg3IKSjJe7AABmQe0WJlk950.png" />
添加使用者的Media(Administration--Users--Users--tom--Media
Use if severity是該使用者關心的事件層級
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M00/7F/80/wKioL1cg3XHjkrTvAAAsth4Y3Kw740.png" title="1.png" alt="wKioL1cg3XHjkrTvAAAsth4Y3Kw740.png" />
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/7F/82/wKiom1cg3Lvw8jsdAAA5AFaMiVE922.png" title="1.png" alt="wKiom1cg3Lvw8jsdAAA5AFaMiVE922.png" />650) this.width=650;" src="http://s2.51cto.com/wyfs02/M01/7F/80/wKioL1cg3cDwWRGIAACGh9EQ2zU805.png" title="1.png" alt="wKioL1cg3cDwWRGIAACGh9EQ2zU805.png" />
建立Action:
Configuration--Actions--Create Action:
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M00/7F/82/wKiom1cg3X6yea_OAAB6X8oPc4A625.png" style="float:none;" title="1.png" alt="wKiom1cg3X6yea_OAAB6X8oPc4A625.png" />
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M00/7F/80/wKioL1cg3kmQP-dcAABR1BI4ce4298.png" style="float:none;" title="2.png" alt="wKioL1cg3kmQP-dcAABR1BI4ce4298.png" />
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/7F/80/wKioL1cg3krTnq7LAAClUWLbPF8477.png" style="float:none;" title="3.png" alt="wKioL1cg3krTnq7LAAClUWLbPF8477.png" />
做警示升級功能:
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/7F/82/wKiom1cg3dzys1J-AABINtfcgt8658.png" style="float:none;" title="1.png" alt="wKiom1cg3dzys1J-AABINtfcgt8658.png" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/7F/82/wKiom1cg3dyi7DicAAByhtPVG4Q719.png" style="float:none;" title="2.png" alt="wKiom1cg3dyi7DicAAByhtPVG4Q719.png" />
下面看看效果:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/7F/82/wKiom1cg3jqhzoiPAABZYnvMIDs749.png" style="float:none;" title="1.png" alt="wKiom1cg3jqhzoiPAABZYnvMIDs749.png" />
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M01/7F/80/wKioL1cg3wnxzb0MAARWcECWEWY536.png" style="float:none;" title="2.png" alt="wKioL1cg3wnxzb0MAARWcECWEWY536.png" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/7F/82/wKiom1cg3kLQLK4WAAQ761l6Xd0596.png" style="float:none;" title="3.png" alt="wKiom1cg3kLQLK4WAAQ761l6Xd0596.png" />
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M02/7F/80/wKioL1cg3xLQpHXCAARjQVGVkIQ898.png" style="float:none;" title="4.png" alt="wKioL1cg3xLQpHXCAARjQVGVkIQ898.png" />
zabbix給外網發送郵件(QQ郵箱):
[[email protected] ~]# mkdir -p /usr/local/zabbix/share/zabbix/alertscripts
[[email protected] ~]# cat /usr/local/zabbix/share/zabbix/alertscripts/alertscripts.sh
#!/bin/bash
echo "$3" | mutt -s "$2" "$1"
[[email protected] ~]#
註:其中$3為郵件內容,$2為郵件標題,$1為郵件地址
Administration---Media Types---Create Media Type
650) this.width=650;" src="http://s4.51cto.com/wyfs02/M02/7F/80/wKioL1cg31nRHbjPAAA9euv0pwA964.png" style="float:none;" title="1.png" alt="wKioL1cg31nRHbjPAAA9euv0pwA964.png" />
650) this.width=650;" src="http://s4.51cto.com/wyfs02/M00/7F/82/wKiom1cg3o6QiqCCAABCNygQG0c555.png" style="float:none;" title="2.png" alt="wKiom1cg3o6QiqCCAABCNygQG0c555.png" />
Administration---Users---Media---Edit
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M00/7F/80/wKioL1cg332A_IzdAAAtvHtXOng395.png" style="float:none;" title="1.png" alt="wKioL1cg332A_IzdAAAtvHtXOng395.png" />
650) this.width=650;" src="http://s2.51cto.com/wyfs02/M00/7F/80/wKioL1cg333D-4RCAAAwMbHnnRE324.png" style="float:none;" title="2.png" alt="wKioL1cg333D-4RCAAAwMbHnnRE324.png" />
編輯Action的郵件發送方式:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/7F/82/wKiom1cg3uLR2XezAAA2HFX_e6g230.png" title="1.png" alt="wKiom1cg3uLR2XezAAA2HFX_e6g230.png" />
觸發警示:
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/7F/82/wKiom1cg3xWjrYSWAAKqkAHC48s592.png" style="float:none;" title="1.png" alt="wKiom1cg3xWjrYSWAAKqkAHC48s592.png" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/7F/80/wKioL1cg3-GSLWUjAAFmDbV2iF4649.png" style="float:none;" title="2.png" alt="wKioL1cg3-GSLWUjAAFmDbV2iF4649.png" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/7F/82/wKiom1cg3xfjoh2BAAFgfme4pf0231.png" style="float:none;" title="3.png" alt="wKiom1cg3xfjoh2BAAFgfme4pf0231.png" />
zabbix先執行遠程命令再發送警示郵件
650) this.width=650;" src="http://s4.51cto.com/wyfs02/M01/7F/80/wKioL1cg4BWSRYWRAABYGYN_4Z0323.png" style="float:none;" title="1.png" alt="wKioL1cg4BWSRYWRAABYGYN_4Z0323.png" />
650) this.width=650;" src="http://s4.51cto.com/wyfs02/M00/7F/82/wKiom1cg30vD0-KsAACtt_7bpKw591.png" style="float:none;" title="2.png" alt="wKiom1cg30vD0-KsAACtt_7bpKw591.png" />
650) this.width=650;" src="http://s4.51cto.com/wyfs02/M02/7F/82/wKiom1cg30vC4j_tAAAsyvlJYxE657.png" style="float:none;" title="3.png" alt="wKiom1cg30vC4j_tAAAsyvlJYxE657.png" />
zabbix ALL=NOPASSWD: ALLzabbix ALL=NOPASSWD: /etc/init.d/vsftpd restart
這樣也行的。。
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/7F/80/wKioL1cg4ELRvyYkAACPTEc8JLU386.png" style="float:none;" title="1.png" alt="wKioL1cg4ELRvyYkAACPTEc8JLU386.png" />
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/7F/80/wKioL1cg4EKRX0mOAAAeNfu3T_Q816.png" style="float:none;" title="2.png" alt="wKioL1cg4EKRX0mOAAAeNfu3T_Q816.png" />
本文出自 “鵬城-醬油瓶” 部落格,謝絕轉載!
【3】Zabbix添加Media Types、User Group、Actions、Alert