-
Notifications
You must be signed in to change notification settings - Fork 134
api_action
遇见王斌 edited this page Sep 8, 2017
·
3 revisions
[root@Linux ~]#zabbix_api action_get --table
1.2.2
+----------+------------------------------------------------+--------------+----------+
| actionid | name | eventsource | status |
+----------+------------------------------------------------+--------------+----------+
| 2 | Auto discovery. Linux servers. | discovery | Disabled |
| 3 | Report problems to Zabbix administrators | triggers | Disabled |
| 4 | Report not supported items | internal | Disabled |
| 5 | Report not supported low level discovery rules | internal | Disabled |
| 6 | Report unknown triggers | internal | Disabled |
| 7 | ceshi_action | registration | Enabled |
| 8 | trigger_action | triggers | Enabled |
+----------+------------------------------------------------+--------------+----------+
sum: 7
功能:Active agent主动联系zabbix server,最后由zabbix server将这些agent加到host里。对于需要部署特别多服务器的人来说,这功能相当给力。
(1)agent
修改agent配置文件
ServerActive=66.175.222.222
Hostname=auto-reg-test01
HostMetadata=Linux
(2)server
界面操作需要做以下操作
步骤:configuration>>actions>>Event source(选择Auto registration)>>CreaAction
- Action选项卡-----------定义Action名称:Action_for_autoreg
- Conditions选项卡------添加:Host metadata like Linux
- Operations选项卡-----添加:Add host,Add to host group ,Link to template
直接执行python main.py即可
执行后需要输入action_name和hostgroup_name
使用zabbix_api进行操作
zabbix_api action_autoreg_create "ceshi_action" "Linux servers"
遇到问题可以加入 Zabbix 开源社区群进行讨论 加入微信群方法如下
- (1) 微信添加 zabbix_china(Zabbix_Z小秘)备注说明:(王斌 zabbix_manager)
- (2) 然后让
Zabbix_Z小秘
拉入Zabbix 开源社区群
即可