当前位置:网站首页>zabbix如何配置告警短信?(预警短信通知设置流程)
zabbix如何配置告警短信?(预警短信通知设置流程)
2022-07-01 00:42:00 【苍穹破天】
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。
更准确的将告警通知推送给运维及其他指定人员,短信因其速度快、强展现的优点,成为了告警中重要的一种通知方式。本文将介绍zabbix如何配置短信告警服务。
Zabbix短信配置流程
一、创建发送脚本
创建名为sendsms.py的Python脚本,放到zabbix脚本路径,请在配置文件中开启AlertScriptsPath=路径。
#注意事项:
* 接口类型:触发短信接口,支持发送验证码短信、订单通知短信,节日祝福等。
* 账户注册:请通过该地址开通账户 http://user.ihuyi.com/?exClaO
#(1)调试期间,请用默认的模板进行测试,默认模板详见接口文档;
#(2)请使用 用户名 及 APIkey来调用接口,APIkey在会员中心可以获取;
#(3)该代码仅供接入互亿无线短信接口参考使用,客户可根据实际需要自行编写;
#!/usr/local/bin/python
#-*- coding:utf-8 -*-
import urllib2
import urllib
#用户名 查看用户名请登录用户中心->验证码、通知短信->帐户及签名设置->APIID
account = "用户名"
#密码 查看密码请登录用户中心->验证码、通知短信->帐户及签名设置->APIKEY
password = "密码"
mobile = "138xxxxxxxx"
text = "您的验证码是:121254。请不要把验证码泄露给其他人。"
data = {'account': account, 'password' : password, 'content': text, 'mobile':mobile,'format':'json' }
req = urllib2.urlopen(
url= 'http://106.ihuyi.com/webservice/sms.php?method=Submit',
data= urllib.urlencode(data)
)
content =req.read()
登录互亿无线制台,在验证码通知概览页面,获取互亿无线APIID及APIKEY:

在zabbix中设置向脚本传递两个参数,一个是手机号,一个是内容,内容部分将在后文中 的Media types进行配置。
边栏推荐
猜你喜欢

gin 配置文件

One of the basics - overview of sta Basics

Win11安装redis 数据库以及redis desktop manager的下载

【Qt5-基础篇】随机数显示屏展示
![[问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号](/img/51/e48e222c14f4a4e9f2be91a677033f.png)
[问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号
![[go] go implements row column conversion of sets](/img/d9/6272e55b2d9c6b6fbdf2537773bb83.png)
[go] go implements row column conversion of sets

DC學習筆記正式篇之零——綜述與基本流程介紹
![[problem handled] -nvidia SMI command cannot obtain the GPU process number of its own container and the external GPU process number](/img/51/e48e222c14f4a4e9f2be91a677033f.png)
[problem handled] -nvidia SMI command cannot obtain the GPU process number of its own container and the external GPU process number

Openmv and k210 of the f question of the 2021 video game call the openmv API for line patrol, which is completely open source.

Exploration and practice of "flow batch integration" in JD
随机推荐
Green, green the reed. dew and frost gleam.
Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base
【动态规划】路径dp:931. Minimum Falling Path Sum
友盟(软件异常实时监听的好帮手:Crash)接入教程(有点基础的小白最易学的教程)
[learning notes] simple DP
[问题已处理]-nvidia-smi命令获取不到自身容器的GPU进程和外部的GPU进程号
K210 site helmet
【多源bfs】934. Shortest Bridge
用 Flutter 的 Canvas 画点有趣的图形
使用 C# 创造 ASCII 艺术
Dls-20 double position relay 220VDC
Docker deployment MySQL 8
C# 自定义并动态切换光标
Microbial safety and health, what is biological treatment?
数字IC设计流程总结
The liquor and tourism sector recovers, and Yaduo continues to dream of listing. How far is it from "the first share of the new accommodation economy"?
Draw some interesting figures with flutter's canvas
js中把数字转换成汉字输出
Pytorch programming knowledge (2)
What are the functions of soil microorganisms in microbial detection?