diff --git a/roles/zabbix/sslchecks/tasks/httpcheck.yml b/roles/zabbix/sslchecks/tasks/httpcheck.yml new file mode 100644 index 0000000000..a522b12888 --- /dev/null +++ b/roles/zabbix/sslchecks/tasks/httpcheck.yml @@ -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 diff --git a/roles/zabbix/sslchecks/tasks/main.yml b/roles/zabbix/sslchecks/tasks/main.yml index ca23babc2d..b3743084fa 100644 --- a/roles/zabbix/sslchecks/tasks/main.yml +++ b/roles/zabbix/sslchecks/tasks/main.yml @@ -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'