Skip to content

Commit

Permalink
Set OS Specific values for fping
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrodie18 committed Nov 13, 2023
1 parent f3b041d commit fb73b4d
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 8 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/fping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- proxy and server roles - Defaulted location of fping and fping6 based on OS.
4 changes: 2 additions & 2 deletions docs/ZABBIX_PROXY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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| |
Expand Down
4 changes: 2 additions & 2 deletions docs/ZABBIX_SERVER_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | | |
Expand Down
1 change: 1 addition & 0 deletions molecule/zabbix_proxy/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\]")
1 change: 1 addition & 0 deletions molecule/zabbix_server/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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\]")
2 changes: 0 additions & 2 deletions roles/zabbix_proxy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions roles/zabbix_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions roles/zabbix_proxy/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions roles/zabbix_proxy/vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ selinux_pkgs:

mysql_plugin:
"7": mysql_native_password

_zabbix_proxy_fping6location: /usr/sbin/fping6
_zabbix_proxy_fpinglocation: /usr/sbin/fping
2 changes: 0 additions & 2 deletions roles/zabbix_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions roles/zabbix_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions roles/zabbix_server/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions roles/zabbix_server/vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ mysql_client_pkgs:
"8":
- mysql
- python3-PyMySQL

_zabbix_server_fping6location: /usr/sbin/fping6
_zabbix_server_fpinglocation: /usr/sbin/fping

0 comments on commit fb73b4d

Please sign in to comment.