python 모듈을 이용해 zabbix problem 데이터를 gethering
- Test Zabbix Version : 4.4.3
- Python Module : ZabbixAPI_py
from ZabbixAPI_py import Zabbix
from datetime import datetime
zabbix = Zabbix('url') # zabbix url
zabbix.login('id','password') # zabbix 계정정보
for x in zabbix.problem(method='get'):
print(datetime.fromtimestamp(int(x['clock'])),x['name'])
# problem 데이터 gethering
# int(x['clock']) 유닉스 time 형식이기 때문에, 일반 날짜형식으로 변환. (datetime.fromtimestamp)
----------------------------------------------------------------
2019-12-12 11:34:53 System time is out of sync (diff with Zabbix server > 60s)
2019-12-12 11:39:37 System time is out of sync (diff with Zabbix server > 60s)
2019-12-12 13:00:04 D:\\ Label: Serial Number a0d10fe2: Disk space is low (used > 80%)
'Open Source' 카테고리의 다른 글
[ Zabbix ] Zabbix server is not running : the infomation displayed may not be current Problem (0) | 2020.06.15 |
---|---|
[ Zabbix ] Zabbix Problem monitoring using Python API. (파이썬 API를 이용한 Zabbix Problem 모니터링) (0) | 2020.06.02 |
[ Zabbix ] Zabbix Windows Disk Perfomance Using Agent (0) | 2020.03.05 |
[ Zabbix ] Automatic login using Python's Selenium. (셀레니움을 이용한 zabbix 자동 로그인) (0) | 2019.12.17 |
[ Zabbix ] Zabbix-Server, Zabbix-Agent 버전 보기 (0) | 2019.12.12 |
[ metricbeat ] mariadb basic monitoring. (mariadb 기본 모니터링) (0) | 2019.12.09 |
[ Zabbix ] 4.4.1 Windows 2012 Agent (64bit) install and host setting (0) | 2019.11.18 |
mongo DB 포트 변경 (0) | 2019.10.30 |