feat(host_agent): each drive's health, read with smartctl, alertable (#5789)
The root helper gains one read-only action, `drives`: it finds the drives itself (smartctl --scan-open), reads each as JSON, and writes a summary the agent carries on every sample (agent 1.20.0). Steward judges the figures in drives.py (failing / worn / watch / ok / no SMART / unreadable), records them per drive and as host roll-ups for covering rules, keeps the newest report on the registration and lists it on the host page. install-deps.sh installs smartmontools with apt, dnf, yum, zypper, pacman or apk, run by install.sh and every agent playbook; one it can't install is reported, never fatal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# description: Update the Steward host agent (refresh agent.py, its units and the maintenance helper, then restart) on hosts already running it.
|
||||
# description: Update the Steward host agent (refresh agent.py, its units, the maintenance helper and its packages, then restart) on hosts already running it.
|
||||
# steward:category: host-agent
|
||||
# Update an already-installed Steward host agent: refresh agent.py, its systemd
|
||||
# units and the maintenance helper (#5766), then restart.
|
||||
@@ -66,6 +66,27 @@
|
||||
mode: "0755"
|
||||
force: true
|
||||
|
||||
# The helper's packages (smartctl for drive health, #5789), with whichever
|
||||
# package manager the host has. One that can't be installed is said, never
|
||||
# fatal: the host page then reads "smartctl not installed".
|
||||
- name: Download the dependency installer
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ steward_url }}/plugins/host_agent/files/install-deps.sh"
|
||||
dest: /usr/local/lib/steward-agent/install-deps.sh
|
||||
owner: root
|
||||
mode: "0755"
|
||||
force: true
|
||||
|
||||
- name: Install the helper's packages
|
||||
ansible.builtin.command: /usr/local/lib/steward-agent/install-deps.sh
|
||||
register: helper_deps
|
||||
changed_when: "'installed:' in helper_deps.stdout"
|
||||
|
||||
- name: Say what couldn't be installed
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ helper_deps.stdout_lines | select('search', 'WARNING') | list }}"
|
||||
when: "'WARNING' in helper_deps.stdout"
|
||||
|
||||
- name: Install the agent and maintenance units
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ steward_url }}/plugins/host_agent/files/{{ item }}"
|
||||
|
||||
Reference in New Issue
Block a user