diff --git a/changelogs/fragments/fping.yml b/changelogs/fragments/fping.yml new file mode 100644 index 000000000..d60b8a6de --- /dev/null +++ b/changelogs/fragments/fping.yml @@ -0,0 +1,2 @@ +bugfixes: + - proxy and server roles - Defaulted location of fping and fping6 based on OS. diff --git a/docs/ZABBIX_PROXY_ROLE.md b/docs/ZABBIX_PROXY_ROLE.md index 8ffb81628..13706a8a3 100644 --- a/docs/ZABBIX_PROXY_ROLE.md +++ b/docs/ZABBIX_PROXY_ROLE.md @@ -312,8 +312,8 @@ The following table lists all variables that are exposed to modify the configura | DebugLevel | zabbix_proxy_debuglevel |3| | | EnableRemoteCommands | zabbix_proxy_enableremotecommands |0| | | ExternalScripts | zabbix_proxy_externalscripts | /usr/lib/zabbix/externalscripts| | -| Fping6Location | zabbix_proxy_fping6location | /usr/sbin/fping6| | -| FpingLocation | zabbix_proxy_fpinglocation | /usr/sbin/fping| | +| Fping6Location | zabbix_proxy_fping6location | OS Specific Value | | +| FpingLocation | zabbix_proxy_fpinglocation | OS Specific Value | | | HeartbeatFrequency | zabbix_proxy_heartbeatfrequency |60| Version 6.2 or Lower| | HistoryCacheSize | zabbix_proxy_historycachesize | 8M| | | HistoryIndexCacheSize | zabbix_proxy_historyindexcachesize | 4M| | diff --git a/docs/ZABBIX_SERVER_ROLE.md b/docs/ZABBIX_SERVER_ROLE.md index d7571bcb7..7953d1eb7 100644 --- a/docs/ZABBIX_SERVER_ROLE.md +++ b/docs/ZABBIX_SERVER_ROLE.md @@ -306,8 +306,8 @@ The following table lists all variables that are exposed to modify the configura |ExportFileSize | zabbix_server_exportfilesize | 1G | | |ExportType | zabbix_server_exporttype | | | |ExternalScripts | zabbix_server_externalscriptspath | /usr/lib/zabbix/externalscripts | | -|Fping6Location | zabbix_server_fping6location | /usr/sbin/fping6 | | -|FpingLocation | zabbix_server_fpinglocation | /usr/sbin/fping | | +|Fping6Location | zabbix_server_fping6location | OS Specific Value | | +|FpingLocation | zabbix_server_fpinglocation | OS Specific Value | | |HANodeName | zabbix_server_hanodename | | | |HistoryCacheSize | zabbix_server_historycachesize | | | |HistoryIndexCacheSize | zabbix_server_historyindexcachesize | | | diff --git a/molecule/zabbix_proxy/tests/test_default.py b/molecule/zabbix_proxy/tests/test_default.py index 9140e1edc..f96874740 100644 --- a/molecule/zabbix_proxy/tests/test_default.py +++ b/molecule/zabbix_proxy/tests/test_default.py @@ -49,5 +49,6 @@ def test_zabbix_proxy_logfile(host): assert zabbix_logfile.exists assert not zabbix_logfile.contains("Access denied for user") assert not zabbix_logfile.contains("database is down: reconnecting") + assert not zabbix_logfile.contains("Both are missing in the system.") # Missing fping assert zabbix_logfile.contains("current database version") assert zabbix_logfile.contains(r"proxy #0 started \[main process\]") diff --git a/molecule/zabbix_server/tests/test_default.py b/molecule/zabbix_server/tests/test_default.py index 11051926f..ee43ad2a3 100644 --- a/molecule/zabbix_server/tests/test_default.py +++ b/molecule/zabbix_server/tests/test_default.py @@ -51,5 +51,6 @@ def test_zabbix_server_logfile(host): assert zabbix_logfile.exists assert not zabbix_logfile.contains("Access denied for user") assert not zabbix_logfile.contains("database is down: reconnecting") + assert not zabbix_logfile.contains("Both are missing in the system.") # Missing fping assert zabbix_logfile.contains("current database version") assert zabbix_logfile.contains(r"server #0 started \[main process\]") diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index f827a3a55..5eded372c 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -71,8 +71,6 @@ zabbix_proxy_dbport: 5432 zabbix_proxy_debuglevel: 3 zabbix_proxy_enableremotecommands: 0 zabbix_proxy_externalscripts: /usr/lib/zabbix/externalscripts -zabbix_proxy_fping6location: /usr/sbin/fping6 -zabbix_proxy_fpinglocation: /usr/sbin/fping zabbix_proxy_heartbeatfrequency: 60 zabbix_proxy_historycachesize: 8M zabbix_proxy_historyindexcachesize: 4M diff --git a/roles/zabbix_proxy/tasks/main.yml b/roles/zabbix_proxy/tasks/main.yml index ee19e04db..f564635b1 100644 --- a/roles/zabbix_proxy/tasks/main.yml +++ b/roles/zabbix_proxy/tasks/main.yml @@ -17,6 +17,8 @@ zabbix_proxy_db_long: "{{ 'postgresql' if zabbix_proxy_database == 'pgsql' else zabbix_proxy_database }}" zabbix_valid_version: "{{ zabbix_proxy_version|float in zabbix_valid_proxy_versions[ansible_distribution_major_version] }}" zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}" + zabbix_proxy_fpinglocation: "{{ zabbix_proxy_fpinglocation if zabbix_proxy_fpinglocation is defined else _zabbix_proxy_fpinglocation}}" + zabbix_proxy_fping6location: "{{ zabbix_proxy_fping6location if zabbix_proxy_fping6location is defined else _zabbix_proxy_fping6location}}" tags: - always diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index 449f928b2..182b1109a 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -53,3 +53,5 @@ mysql_plugin: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}" +_zabbix_proxy_fping6location: /usr/bin/fping6 +_zabbix_proxy_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_proxy/vars/RedHat.yml b/roles/zabbix_proxy/vars/RedHat.yml index 1753dc9bd..e8ee7e2ae 100644 --- a/roles/zabbix_proxy/vars/RedHat.yml +++ b/roles/zabbix_proxy/vars/RedHat.yml @@ -50,3 +50,6 @@ selinux_pkgs: mysql_plugin: "7": mysql_native_password + +_zabbix_proxy_fping6location: /usr/sbin/fping6 +_zabbix_proxy_fpinglocation: /usr/sbin/fping diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index ff334474b..d54f92e9a 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -68,8 +68,6 @@ zabbix_server_allowunsupporteddbversions: 0 zabbix_server_debuglevel: 3 zabbix_server_exportfilesize: 1G zabbix_server_externalscriptspath: /usr/lib/zabbix/externalscripts -zabbix_server_fping6location: /usr/sbin/fping6 -zabbix_server_fpinglocation: /usr/sbin/fping zabbix_server_historystoragedateindex: 0 zabbix_server_historystoragetypes: uint,dbl,str,log,text zabbix_server_housekeepingfrequency: 1 diff --git a/roles/zabbix_server/tasks/main.yml b/roles/zabbix_server/tasks/main.yml index ac520aa50..62674a7ff 100644 --- a/roles/zabbix_server/tasks/main.yml +++ b/roles/zabbix_server/tasks/main.yml @@ -15,6 +15,8 @@ ansible.builtin.set_fact: zabbix_db_type_long: "{{ 'postgresql' if zabbix_server_database == 'pgsql' else 'mysql' }}" zabbix_valid_version: "{{ zabbix_server_version|float in zabbix_valid_server_versions[ansible_distribution_major_version] }}" + zabbix_server_fpinglocation: "{{ zabbix_server_fpinglocation if zabbix_server_fpinglocation is defined else _zabbix_server_fpinglocation}}" + zabbix_server_fping6location: "{{ zabbix_server_fping6location if zabbix_server_fping6location is defined else _zabbix_server_fping6location}}" tags: - always diff --git a/roles/zabbix_server/vars/Debian.yml b/roles/zabbix_server/vars/Debian.yml index 4c74370cb..2b566e8a1 100644 --- a/roles/zabbix_server/vars/Debian.yml +++ b/roles/zabbix_server/vars/Debian.yml @@ -31,3 +31,5 @@ zabbix_valid_server_versions: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}/{{ ansible_distribution.lower() }}" +_zabbix_server_fping6location: /usr/bin/fping6 +_zabbix_server_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_server/vars/RedHat.yml b/roles/zabbix_server/vars/RedHat.yml index 923dba1fe..c2e0f14f3 100644 --- a/roles/zabbix_server/vars/RedHat.yml +++ b/roles/zabbix_server/vars/RedHat.yml @@ -31,3 +31,6 @@ mysql_client_pkgs: "8": - mysql - python3-PyMySQL + +_zabbix_server_fping6location: /usr/sbin/fping6 +_zabbix_server_fpinglocation: /usr/sbin/fping