ZabbixAgentMixin.configure_zabbix_agent(settings): a native Zabbix agent for a host without a container engine (NetOrk/netork#2571).
Steps: load the package index where the driver can (refresh_available_updates), install ZABBIX_AGENT_PACKAGE from the host's own packages, and where those have none and settings["release"] names the server's release line, add Zabbix's repository (the driver's _add_zabbix_repository) and try again. Then configure (the driver's _write_zabbix_agent_config), firewall (_allow_zabbix_agent_sources), and enable and restart (manage_service). Settings that do not hold raise ValueError before anything changes.
Without I/O, in zabbix_agent.py:
check_zabbix_agent_settings;
zabbix_agent_config(text, settings): sets Server, ServerActive, ListenPort and Hostname, and keeps the rest;
zabbix_repository_command(os_release, release): covers Debian, Ubuntu, Raspberry Pi OS, RHEL, CentOS, Oracle, Alma and Rocky, in the layout since 7.2 (<release>/release/<distro>/…) and before it. The URLs were checked against repo.zabbix.com.
LldpAgentMixin and ZabbixAgentMixin share the start step (enable_and_restart). The drivers' steps come in napalm-linux, napalm-openwrt and napalm-proxmox, which need this as 4.40.0.
Checks: ruff, mypy, napalm-standard ratchet and check are green. 1763 tests pass. Two tests in test_host_status.py::TestThePackageManagerCommandOnARealShell fail on my workstation, on a clean origin/main too; that is unrelated to this change.
`ZabbixAgentMixin.configure_zabbix_agent(settings)`: a native Zabbix agent for a host without a container engine (NetOrk/netork#2571).
**Steps:** load the package index where the driver can (`refresh_available_updates`), install `ZABBIX_AGENT_PACKAGE` from the host's own packages, and where those have none and `settings["release"]` names the server's release line, add Zabbix's repository (the driver's `_add_zabbix_repository`) and try again. Then configure (the driver's `_write_zabbix_agent_config`), firewall (`_allow_zabbix_agent_sources`), and enable and restart (`manage_service`). Settings that do not hold raise `ValueError` before anything changes.
**Without I/O, in `zabbix_agent.py`:**
- `check_zabbix_agent_settings`;
- `zabbix_agent_config(text, settings)`: sets `Server`, `ServerActive`, `ListenPort` and `Hostname`, and keeps the rest;
- `zabbix_repository_command(os_release, release)`: covers Debian, Ubuntu, Raspberry Pi OS, RHEL, CentOS, Oracle, Alma and Rocky, in the layout since 7.2 (`<release>/release/<distro>/…`) and before it. The URLs were checked against repo.zabbix.com.
`LldpAgentMixin` and `ZabbixAgentMixin` share the start step (`enable_and_restart`). The drivers' steps come in napalm-linux, napalm-openwrt and napalm-proxmox, which need this as **4.40.0**.
**Checks:** ruff, mypy, `napalm-standard ratchet` and `check` are green. 1763 tests pass. Two tests in `test_host_status.py::TestThePackageManagerCommandOnARealShell` fail on my workstation, on a clean `origin/main` too; that is unrelated to this change.
configure_zabbix_agent(settings) loads the package index where the driver can,
installs ZABBIX_AGENT_PACKAGE from the host's own packages and, where those have
none and settings["release"] names the server's release line, from Zabbix's
repository (the driver's _add_zabbix_repository); then the driver writes the
configuration and opens the firewall, and the service is enabled and restarted.
Settings that do not hold raise ValueError before anything changes.
zabbix_agent.py holds what is the same on every host, without I/O: the settings
check, the agent's configuration with Server, ServerActive, ListenPort and
Hostname set and the rest kept, and the root command that adds Zabbix's
repository for Debian, Ubuntu, Raspberry Pi OS and the RHEL family, in the
layout before and since 7.2. LldpAgentMixin and ZabbixAgentMixin share the
start step (enable_and_restart).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
ZabbixAgentMixin.configure_zabbix_agent(settings): a native Zabbix agent for a host without a container engine (NetOrk/netork#2571).Steps: load the package index where the driver can (
refresh_available_updates), installZABBIX_AGENT_PACKAGEfrom the host's own packages, and where those have none andsettings["release"]names the server's release line, add Zabbix's repository (the driver's_add_zabbix_repository) and try again. Then configure (the driver's_write_zabbix_agent_config), firewall (_allow_zabbix_agent_sources), and enable and restart (manage_service). Settings that do not hold raiseValueErrorbefore anything changes.Without I/O, in
zabbix_agent.py:check_zabbix_agent_settings;zabbix_agent_config(text, settings): setsServer,ServerActive,ListenPortandHostname, and keeps the rest;zabbix_repository_command(os_release, release): covers Debian, Ubuntu, Raspberry Pi OS, RHEL, CentOS, Oracle, Alma and Rocky, in the layout since 7.2 (<release>/release/<distro>/…) and before it. The URLs were checked against repo.zabbix.com.LldpAgentMixinandZabbixAgentMixinshare the start step (enable_and_restart). The drivers' steps come in napalm-linux, napalm-openwrt and napalm-proxmox, which need this as 4.40.0.Checks: ruff, mypy,
napalm-standard ratchetandcheckare green. 1763 tests pass. Two tests intest_host_status.py::TestThePackageManagerCommandOnARealShellfail on my workstation, on a cleanorigin/maintoo; that is unrelated to this change.