Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix add monitoring items, trigger alarm, etc.

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Add a monitoring item

Finally, choose to add and it is done.

two。 Add graphic display

3. Set trigger

4. Call the police

Script alarm-add alarm media first

Add an action (in what circumstances trigger the alarm)

Server: {HOST.NAME} occurrence: {TRIGGER.NAME} Fault alarm Host: {HOST.NAME} alarm address: {HOST.IP} Monitoring Project: {ITEM.NAME} Monitoring value: {ITEM.LASTVALUE} alarm level: {TRIGGER.SEVERITY} current status: {TRIGGER.STATUS} alarm Information: {TRIGGER.NAME} alarm time: {EVENT.DATE} {EVENT.TIME} event ID: {EVENT.ID}

Add a medium to the sender to send to the external network (here I just called a script)

Cat / etc/zabbix/zabbix_server.conf | grep alertscripts # Open the configuration file to find the location of the alarm script

Cd / usr/lib/zabbix/alertscripts # cd inside

Vim cs.sh # create an alarm script. The name of the script should be the same as that defined earlier.

#! / bin/bash/usr/bin/echo "send to: $1" > > / tmp/cs.txt/usr/bin/echo "summary: $2" > > / tmp/cs.txt/usr/bin/echo "" > > / tmp/cs.txtfor I in $3 Do/usr/bin/echo $I > > / tmp/cs.txtdone/usr/bin/echo "#" > > / tmp/cs.txt

Once you have created the script, remember to give it permission to run, and restart zabbix-server.

5. View alarm

I used a running score software to pull the cpu usage to 100%, which triggered the trigger and triggered the alarm.

Vim / tmp/cs.txt # View the alarm content generated by the script

Now that the alarm content can be generated with a script, it is easy to generate an alarm message in api that uses this script to call other alarm software.

PS: there is a small BUG in the action here. If you want to add a user, it cannot be sent without Super Admin privileges.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report