1. Create Sample Trigger (트리거 생성)
2. Python API (ZabbixAPI_py)
# API
# pip install ZabbixAPI_py
from ZabbixAPI_py import Zabbix
from datetime import datetime
from datetime import timedelta
# Zabbix Auth
zabbix = Zabbix('host')
zabbix.login('id','password')
# before 10 Min
tenMin = datetime.today() - timedelta(minutes=10)
# get problems
for x in zabbix.problem(method='get'):
eventTime = datetime.fromtimestamp(int(x['clock'])) # Convert Unix Timestamp
if tenMin < eventTime:
msg = str(eventTime)+x['name']
print(msg)
'Open Source' 카테고리의 다른 글
[ Zabbix 5.0 ] Template DB MSSQL by ODBC Monitoring (0) | 2021.04.05 |
---|---|
[ Zabbix 5.0 ] Elasticsearch Cluster Monitoring (0) | 2021.03.26 |
[ grafana ] https 접속을 위한 보안인증서 적용 (0) | 2020.10.08 |
[ Zabbix ] Zabbix server is not running : the infomation displayed may not be current Problem (0) | 2020.06.15 |
[ Zabbix ] Zabbix Windows Disk Perfomance Using Agent (0) | 2020.03.05 |
[ Zabbix ] Automatic login using Python's Selenium. (셀레니움을 이용한 zabbix 자동 로그인) (0) | 2019.12.17 |
[ Zabbix ] Python의 ZabbixAPI_py 모듈을 이용한 problem 상태 받아오기 (0) | 2019.12.13 |
[ Zabbix ] Zabbix-Server, Zabbix-Agent 버전 보기 (0) | 2019.12.12 |