1
0
Fork 0
forked from infra/ansible

Zabbix: use regex instead, more flexible

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
Greg Sutcliffe 2026-05-26 14:22:13 +01:00
commit 6ed762bb29
Signed by: gwmngilfen
SSH key fingerprint: SHA256:dNHcz65ApR68w2TkCIAXDBdt4oNL62Fyx48U7dXWuk0
2 changed files with 6 additions and 5 deletions

View file

@ -15,12 +15,12 @@
block:
- name: Create {{ item.name }} http connection item
community.zabbix.zabbix_item:
name: "{{ item.name }}
name: "{{ item.name }}"
host_name: "{{ inventory_hostname }}"
params:
type: zabbix_agent_active
key: "net.tcp.service[tcp,{{ item.name }},{{ item.port }}]"
value_type: numeric_unsigned
key: "web.page.regexp[{{ item.name }},,,{{ item.string }}]"
value_type: character
tags:
- tag: component
value: tcp
value: http

View file

@ -33,7 +33,8 @@
- name: Create HTTP checks for other hosts
include_tasks: httpcheck.yml
loop:
- { name: 'certgetter01.rdu3.fedoraproject.org', port: '80' }
- { name: 'http://certgetter01.rdu3.fedoraproject.org', string: 'Index' }
- { name: 'https://lists.fedoraproject.org/archives', string: 'Fedora Mailing-Lists' }
tags:
- zabbix_api
when: inventory_hostname == 'zabbix01.rdu3.fedoraproject.org'