Zabbix Script Alarm Configuration
Note: This article is a few key configuration instructions for 5.4 configuration, not a complete step
Zabbix-agent to be configured to support the execution of remote commands:
Vim/etc/zabbix/zabbix_agentd.conf
Enableremotecommands=1
#Defaults Requiretty
Attention
(1) If the command is executed as a different user, then the command itself should be run in sudo mode:
SUDO/ETC/RC.D/INIT.D/HTTPD restart
(2) sudoers file on each agent:
Vim/etc/sudoers
Zabbix all= (All) all
To comment as follows
#Defaults Requiretty
Create: Actions actions
Premise, create the user and media types, the following steps have.
1,action
Recovery message: Returns notification, e.g. from OK---problem (notification)----OK (re-notification)
2,conditions conditions
A is not in maintenance time
B trigger value becomes problem
C trigger name (defined for which trigger, if not, all)
The condition A and B and C are all met to trigger.
3,operations
Action: Define to which user, the user group sends the message or the script way to send the message.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/79/EB/wKioL1ad-aOhgRY0AADRVMAfqnk200.png "style=" float: none; "title=" 1.png "alt=" Wkiol1ad-aohgry0aadrvmafqnk200.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/79/EC/wKiom1ad-WnyptVdAAB6OZ9WrPY100.png "style=" float: none; "title=" 2.png "alt=" Wkiom1ad-wnyptvdaab6oz9wrpy100.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/79/EB/wKioL1ad-aWTttJpAAKfWZFjmXA858.png "style=" float: none; "title=" 3.png "alt=" Wkiol1ad-awtttjpaakfwzfjmxa858.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/EC/wKiom1ad-W2DQ69vAAJGWFQfJVY827.png "style=" float: none; "title=" 4.png "alt=" Wkiom1ad-w2dq69vaajgwfqfjvy827.png "/>
Custom Script Alert messages:
creating scripts in/usr/lib/zabbix/alertscripts
Vim alerttest.sh
#!/bin/bash
echo $ | Mail-s "$" $
where the $1,$2,$3 respectively correspond to
A recipient, that is, an object of sent to.
$ $ for title, {TRIGGER. Status}:{trigger.name}
e-Mail Subject:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/79/EC/wKiom1ad-W2AKEqDAAAjZMlAeCw072.png "style=" float: none; "title=" 5.png "alt=" Wkiom1ad-w2akeqdaaajzmlaecw072.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/79/EB/wKioL1ad-afgc9UIAABE-AVxtuo146.png "style=" float: none; "title=" 6.png "alt=" Wkiol1ad-afgc9uiaabe-avxtuo146.png "/>
Create media types
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/79/EC/wKiom1ad-W7jlqCKAACFEJGpmas343.png "style=" float: none; "title=" 7.png "alt=" Wkiom1ad-w7jlqckaacfejgpmas343.png "/>
To create a user-used media:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/79/EB/wKioL1ad-anR8Sn4AAG-YxsNo_k744.png "style=" float: none; "title=" 8.png "alt=" Wkiol1ad-anr8sn4aag-yxsno_k744.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/EC/wKiom1ad-XCi49jyAACjA4NGnm0947.png "style=" float: none; "title=" 9.png "alt=" Wkiom1ad-xci49jyaacja4ngnm0947.png "/>
Actions Step settings: Set to one step at every 60 seconds. (Achieve multi-level alarm)
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/EB/wKioL1ad-arTmB5-AADgO83RTxw247.png "style=" float: none; "title=" 10.png "alt=" Wkiol1ad-artmb5-aadgo83rtxw247.png "/>
L15.3 Zabbix Custom Script execution with alarm configuration (auxiliary 5.4)