1
0
Fork 0
forked from infra/ansible

Zabbix: Add some basic non-host HTTP checking to zabbix01

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

View file

@ -0,0 +1,26 @@
---
- name: Zabbix API Block
vars:
ansible_zabbix_auth_key: "{{ zabbix_auth_key }}"
ansible_network_os: "{{ zabbix_network_os }}"
ansible_connection: "{{ zabbix_connection }}"
ansible_httpapi_port: "{{ zabbix_httpapi_port }}"
ansible_httpapi_use_ssl: "{{ zabbix_httpapi_use_ssl }}"
ansible_httpapi_validate_certs: "{{ zabbix_httpapi_validate_certs }}"
ansible_host: "{{ zabbix_server }}"
ansible_zabbix_url_path: "{{ zabbix_url_path }}"
tags:
- zabbix_agent
- zabbix_api
block:
- name: Create {{ item.name }} http connection item
community.zabbix.zabbix_item:
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
tags:
- tag: component
value: tcp

View file

@ -28,3 +28,12 @@
tags:
- zabbix_api
when: inventory_hostname == 'zabbix01.stg.rdu3.fedoraproject.org'
# HTTP service checks on DNS names
- name: Create HTTP checks for other hosts
include_tasks: httpcheck.yml
loop:
- { name: 'certgetter01.rdu3.fedoraproject.org', port: '80' }
tags:
- zabbix_api
when: inventory_hostname == 'zabbix01.rdu3.fedoraproject.org'