Zabbix自动化监控之私有云
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix自动化监控之私有云相关的知识,希望对你有一定的参考价值。
1,自动注册
1.1 Zabbix agent 自动添加
2,主动发现
2.1 自动发现 Discover
2.2 zabbix api
vim /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pi
LogFile=/var/log/zabbix/zabbix_agentd.log
DebugLevel=3
StartAgents=0
ServerActive=192.168.1.1
Hostname=locahost.localhost
HostMetadataItem=system.uname
Include=/etc/zabbix/zabbix_agentd.d/
systemctl restart zabbix-agent
Add host
Add to host group
add to template
API
登录
curl -s -X POST -H ‘Content-Type:application/json‘ -d ‘
{
"jsonrpc": "2.0",
"method": "user.login",
"params": {
"user": "Admin",
"password": "zabbix"
},
"id": 1
}
‘ http://192.168.1.1/zabbix/api_jsonrpc.php |python -m json.tool
查询:
curl -s -X POST -H ‘Content-Type:application/json‘ -d ‘
{
"jsonrpc": "2.0",
"method": "host.get",
"params": {
"output": "extend",
"filter": {
"host": [
"Zabbix server",
"Linux server"
]
}
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}‘ http://192.168.1.1/zabbix/api_jsonrpc.php |python -m json.tool
yum install -y python-pip
pip install requests
本文出自 “运维自动化” 博客,请务必保留此出处http://shower.blog.51cto.com/4926872/1902622
以上是关于Zabbix自动化监控之私有云的主要内容,如果未能解决你的问题,请参考以下文章