zabbix 监控jenkins url状态

2020-01-13  本文已影响0人  博翼腾飞

1.写脚本监控http返回值
vim /etc/zabbix/script/jenkins-http-status.py

#!/bin/env python
#_*_ coding:UTF-8 _*_
import requests
import sys
try:
        object_status = request.get("http://192.168.101.113:8081/login")
        print(object_status.status_code)
except:
        print(1)
        sys.exit(0)

2.添加zabbix配置文件

vim /etc/zabbix/zabbix_agentd.d/monitor_jenkins_http_status.conf
UserParameter=jenkins-status,/etc/zabbix/zabbix_agentd.d/jenkins-http-status.py

3.重启zabbix-agent

systemctl restart zabbix-agent

4.基于zabbix UI界面基于对应主机创建监控项-- 创建触发器

上一篇下一篇

猜你喜欢

热点阅读