agent.yaml
Four keys to reach the central, and the reporters you add yourself. It lives at /etc/ziix-observer/agent.yaml and the installer writes it with mode 0600.
The whole file
This is all of it. One key per line, # for comments, and nothing nested - so a mistake costs one line and names it.
# /etc/ziix-observer/agent.yaml
central_url: https://ziix.observer
enroll_token: smt_...
# Optional. Only if the name cannot be resolved from this host.
#central_ip: 192.168.1.60
# Optional. A name you would like; the central may assign its own.
#host_id: srv01
# ---- What you want watched -------------------------------------------
# The nightly backup, by its unit. No script, no change to the backup.
reporter.srv01-backup.unit: srv01-backup.service
reporter.srv01-backup.expect_within: 26h
# A database dump, by the newest file the glob matches.
reporter.forgejo-dump.file: /data/backups/forgejo/*.sql.gz
reporter.forgejo-dump.expect_within: 26h
# The numbers the backup script already logs.
reporter.backup-log.file: /home/hurup/backup/log/srv01-to-nas-*.log
reporter.backup-log.expect_within: 26h
reporter.backup-log.extract.transferred: filer overfoert: (\d+)
reporter.backup-log.extract.deleted: slettet: (\d+)
# Anything else, as a command.
reporter.cert-check.command: /usr/local/bin/check-cert.sh
reporter.cert-check.interval: 6hAfter enrollment the file needs only central_url - the real token lives in the state file, not here. The rest of this page is what each line means.
The shortest it gets
A host that is enrolled and watches nothing needs one line.
central_url: https://ziix.observerAnd a fresh machine, before it has been approved, needs two:
central_url: https://ziix.observer
enroll_token: smt_...The install command writes both for you, so in practice you only open this file to add a reporter.
The keys
One key per line, with # for comments. An unknown key is rejected at startup rather than ignored, so a typo stops the agent instead of quietly costing you a setting.
| KEY | NEEDED | WHAT IT DOES |
|---|---|---|
central_url | Always | Where the central is. The only key with no default. |
enroll_token | Until enrolled | The join token from Settings → Hosts. Read only while enrolling: once the host is approved it has a real token of its own, and this key is never read again. You may delete it afterwards, and a -enroll-token flag beats the file. |
central_ip | If DNS cannot resolve | Skips name resolution. Worth knowing why it exists: in our own fleet the name is resolved by the Pi-hole hosts the system itself watches, so a Pi-hole that is down cannot report that it is down. |
host_id | Optional | A name you would like. Only a request: the central may assign its own at enrollment, and that one wins - it is written to the state file and identifies every batch afterwards. Left out, the hostname is used. |
Which ones you need when
With four keys the question is never which exist, but which are required right now.
| SITUATION | THE FILE NEEDS |
|---|---|
| A fresh machine, before enrollment | central_url + enroll_token |
| The same, where DNS cannot resolve the central | plus central_ip |
| After enrollment | only central_url. The real token lives in the state file, not here |
| Upgrading the agent | nothing. install.sh keeps an existing file and only rewrites the keys you pass it |
Two files, and only one of them is yours
Both hold configuration, so they get mixed up. The difference matters when something goes wrong.
| FILE | WHAT IS IN IT | WHO WRITES IT |
|---|---|---|
| /etc/ziix-observer/agent.yaml | The keys on this page. Mode 0600, because the join token is a secret. | You, or install.sh |
| /var/lib/ziix-observer/state.json | The real token, the assigned host id, log offsets and the send buffer. Mode 0600, directory 0700. | The agent itself. Never edit it |
What is deliberately not in the file
This is the most common question about agent.yaml, and the answer is that the file is short on purpose.
Collection intervals, log patterns, which containers to read, rate limits and the file watchlist all come from the central, versioned, so they can be tuned in the dashboard for a whole fleet rather than edited on every machine. If you are looking for your collection interval here, it is under the host in the app - not in this file.
The one exception is reporters, below. They are the things the central must never be able to set.
Reporters: what you want watched
Everything else the agent collects is something we decided to measure. A reporter is something you decided matters on this machine.
# A systemd unit: did it run, and did it go well
reporter.srv01-backup.unit: srv01-backup.service
reporter.srv01-backup.expect_within: 26h
# A file: is the newest match fresh enough
reporter.forgejo-dump.file: /data/backups/forgejo/*.sql.gz
reporter.forgejo-dump.expect_within: 26h| FIELD | WHAT IT MEANS |
|---|---|
reporter.<name>.unit | A systemd unit. Its result and when it last ran. Needs expect_within. |
reporter.<name>.file | A glob. The newest file it matches. Needs expect_within. |
reporter.<name>.command | An absolute path the agent runs. No arguments - write a wrapper script if you need them. Needs interval. |
reporter.<name>.expect_within | How old the answer may be. Required for unit and file, and not allowed with command. Units are s, m, h, d and w - so a weekly job is 8d rather than 192h. |
reporter.<name>.interval | How often to run a command. Required for command, with a floor of one minute. There is no default, because the agent cannot know how expensive your script is. |
reporter.<name>.timeout | The ceiling on one run of a command. Optional, and 20s if you leave it out. A command that hangs is reported as blind, not failed: we did not get an answer. |
reporter.<name>.extract | Named expressions against the newest matching file: extract.<name>. Each needs exactly one capture group. Only the last megabyte is read, because a script writes its summary at the end. |
reporter.<name>.severity | warning or critical, when the default is wrong for this one. By default a missed run is critical and a failure is a warning - but we cannot know whether your reporter watches a missing dump or a webshell in an upload directory. |
The name may be letters, digits, dash and underscore - not a dot, which separates the name from the field. Each reporter needs exactly one of unit, file and command.
Durations take s, m, h, d and w. A day is 24 hours here, not a calendar day: the difference is two hours a year on a deadline that already has a grace period, and the alternative is timezones in a parser that runs at startup.
Reading numbers out of a log
The job already writes what you want to know. You should not have to change it to be able to see it.
# The nightly backup already logs this line:
# enheder: 20 (ok 19) · filer overfoert: 10831 · slettet: 8299
reporter.backup-log.file: /home/hurup/backup/log/srv01-to-nas-*.log
reporter.backup-log.expect_within: 26h
reporter.backup-log.extract.transferred: filer overfoert: (\d+)
reporter.backup-log.extract.deleted: slettet: (\d+)An expression that finds nothing makes the reporter blind, not ok. If someone changes the script output, the expression stops matching - and a reporter that then reported green would be the worst thing a check can do. Blind rather than failed, because it is not a statement about the job: we could not read the answer.
That example path is inside a home directory, which is where a backup script usually writes its log - and it is the one place this goes wrong. The next section is why.
The numbers get a history and can carry a rule
A number a reporter found is kept like any other measurement: a graph on the host, and a threshold you set in the dashboard rather than in your script.
Every reading that is a number becomes a measurement named reporter.<name>.<key>. It shows up as its own graph on the host's History tab, it is rolled up hourly and kept for a year, and it appears in the measurement list under Settings → Alert rules, so a rule can be written against it:
# The wrapper already prints this:
# iLO OK - system health OK|intake=28 fans_ok=6 fans=6
# So the inlet temperature is: reporter.ilo.intake
# and a rule on it reads: above 35 for 1440 minutesThis is the difference between a threshold you can change and one you have to edit a script for. A server that has sat at 38 degrees for a week is not failing yet - the exit code is still 0 - and that is exactly the case a level in your wrapper cannot express.
Three things decide what becomes a measurement, and each of them is a direction we chose on purpose:
| THE READING | WHAT HAPPENS |
|---|---|
| A number | a measurement and the text on the reporter row |
Anything else, including Nagios' U | text only. (float) "U" is zero, and zero degrees is an answer about something nobody measured |
| A name over 64 characters in total | text only. The column is that wide, and a shortened name could collide with another key from the same reporter - two readings in one series is a number that looks right and is two things mixed together |
A rule on one of these can be measured over up to seven days, where the agent's own measurements stop at four hours. The reason is cost, not taste: CPU arrives every thirty seconds, so a day of it is thousands of rows every minute for every rule, while a reporter arrives with the inventory round. Two readings six hours apart cannot fit inside four hours, so without the longer window every rule on a reporter number would be impossible to save.
And such a rule needs two readings inside the window, not one per minute as the dense measurements do. One reading is a snapshot, and the rule claims something about a span. What the stricter rule guards against - the reporter going quiet halfway through the window - already has its own alert: a reporter that misses its deadline is job.missed, and that one is critical.
A path under a home directory
The agent runs as root, and under its own unit that is less than you think. Ordinary file permissions apply to it, and a home directory is closed by default.
$ ls -ld /home /home/hurup
drwxr-xr-x root root /home
drwxr-x--- hurup hurup /home/hurup <- no o+xMeasured on two of our own hosts on 8 November 2026: the agent reported nothing matches /home/hurup/backup/log/nas-to-backup-*.log while the same glob, run by hand, matched a file from that morning. The agent runs as root, but its unit sets an empty capability set - and root without CAP_DAC_READ_SEARCH may not pass through a directory it does not own. sudo has that capability, which is exactly why the path looks reachable when you check it by hand.
| WHAT IS NEEDED | ON WHAT | WHY |
|---|---|---|
o+x | every directory on the path | search. Without it the path cannot be walked at all |
o+rx | the directory the glob matches in | a glob has to list the directory, and listing is read |
o+r | the file itself | the newest match is stat-ed, and extract reads its tail |
Two ways out, and the first is the one we would choose. Write the log where the agent can read it - /var/log/ and a directory of its own - which is one changed line in the script. Or open the path: chmod o+x /home/hurup and chmod o+rx /home/hurup/backup/log. Search on a home directory lets anything pass through it without being able to list it, so it is a small permission - but it is still one you are giving to every account on the machine.
A command reporter is in the same position and not a way around it: the command runs with the same empty capability set, so a wrapper of yours cannot read what the agent cannot.
ziix-observer-agent -check gives up its own capabilities before it collects, so it answers the way the agent does. Until 8 November 2026 it did not, and on these two hosts it reported both backup reporters ok while the running agent reported them failed and blind.
Running a command
The universal key. Anything you can write as a script can be watched - and the finished Nagios plugins work as they are.
reporter.cert-check.command: /usr/local/bin/check-cert.sh
reporter.cert-check.interval: 6h
reporter.cert-check.timeout: 20s| THE SCRIPT SAYS | AND THE AGENT REPORTS |
|---|---|
| exit 0 | ok, with the first line of stdout as the message |
| exit 1 or 2 | failed. Both, so a Nagios WARNING and CRITICAL are not told apart by the state - the exit code travels with the alert, and the severity is set on the rule |
| exit 3 | blind. Nagios calls it UNKNOWN, and that is exactly the fourth state: the check could not determine anything |
|days=61;30;7 | Numbers. Thresholds and units after the value are the plugin language for limits, and the central has its own, so only the first part is kept |
{"message":"…","days":61} | JSON works too, for a script written for the purpose rather than borrowed |
| nothing, and it hangs | blind at the timeout. We did not get an answer, and that is not a statement about the job |
The command inherits the agents hardening - an empty capability set, a read-only filesystem, a private /dev and a system call filter. A plugin that pings will therefore fail, because ICMP needs a raw socket. Its stderr is sent along so that looks like what it is rather than like a broken script.
Why expect_within is required
Because systemd says success when nothing happened at all.
$ systemctl show -p LoadState,Result,ExecMainExitTimestamp fstrim.service
Result=success
ExecMainExitTimestamp= # empty: it has never run
$ systemctl show -p LoadState,Result no-such.service
Result=success
LoadState=not-found # it does not exist at allA unit that has never run reports success. A unit that does not exist reports success too. Without a deadline, it went well, it never ran and you misspelled the name all look the same - and the one thing a reporter must never do is report green for a line you typed wrong.
What the central is told
Four states, and the three that are not green are three different messages.
| STATE | MEANS | RULE |
|---|---|---|
| ok | Ran within the deadline | - |
| failed | Ran and ended badly - or the target does not exist | job.failed, warning |
| missed | It did not happen: never ran, or older than the deadline | job.missed, critical |
| blind | We could not look: no systemd, a bad glob, an unreadable file | job.blind, warning |
missed is the critical one because it is the one that costs data. A run that failed shouted about it; one that stopped happening is silent until the day you need the result.
Watching borg and restic - without the passphrase
The central must never be able to read your backup repository. These two can be watched anyway, because both tools leave a readable trace of their last write outside the encrypted repo.
# borg writes this file itself, in plain text, on every write.
reporter.borg.file: /root/.config/borg/security/*/manifest-timestamp
reporter.borg.expect_within: 26h
# restic caches one file per snapshot, in a subdirectory by prefix.
reporter.restic.file: /root/.cache/restic/*/snapshots/*/*
reporter.restic.expect_within: 26hThe measurement that makes borg's file trustworthy: in a Debian 13 container, manifest-timestamp did not move when borg list ran, and did move on a new borg create. So it is the last write, not the last time anyone ran borg - which is the difference between “a backup happened” and “somebody looked”.
Both paths are per user. A backup that runs as root leaves them under /root; one that runs as a service user leaves them under that user's home. And a repository on the far end of ssh or S3 is still covered, because these files are written on the client.
What this does not give you is verification. borg check and restic check need the passphrase, and the passphrase stays on the host - so that belongs in a command reporter with a wrapper of your own, where the secret never leaves the machine.
Watching a virus or rootkit scanner
The product does not scan. It reports what your scanner found - and, just as importantly, when your scanner has not run.
Every exit code below was measured in a Debian 13 container, because guessing them is how you end up with a check that reports green for a find.
| CLAMSCAN SAYS | EXIT | WHICH MEANS |
|---|---|---|
/tmp/x: OK | 0 | clean |
Eicar-Test-Signature FOUND | 1 | a find |
No supported database files found | 2 | no signatures - it scanned nothing |
Can't access file | 2 | the path was wrong - it scanned nothing |
Exit 1 and 2 are the two things that must never be confused, and clamav numbers them the opposite way round from Nagios. So a wrapper translates them - and that wrapper is the whole integration:
#!/bin/sh
# /usr/local/bin/sf-clamav
#
# clamscan: 0 clean, 1 found, 2 could not scan.
# Nagios: 0 ok, 2 critical, 3 unknown.
OUT=$(clamscan -ri --no-summary \
/data/docker/owncloud \
/data/PlantGeekz/storage/uploads 2>&1)
case $? in
0) echo "clamav OK - nothing found" ; exit 0 ;;
1) echo "$OUT" | head -1 ; exit 2 ;;
*) echo "could not scan: $(echo "$OUT" | tail -1)" ; exit 3 ;;
esacreporter.clamav.command: /usr/local/bin/sf-clamav
reporter.clamav.interval: 24h
reporter.clamav.timeout: 30m
reporter.clamav.severity: critical
# Signatures that stopped updating: a scanner with last years
# definitions reports clean. The file is written by freshclam.
reporter.clamav-signatures.file: /var/lib/clamav/daily.cvd
reporter.clamav-signatures.expect_within: 48hThe second one is the reporter people forget. A scanner whose signatures stopped updating three months ago answers clean, and nothing else in the system can tell. It is the same lie as a firmware list from last year, or no findings on an image that was never scanned.
| SCANNER | WHAT IT SHIPS ON DEBIAN 13 | SO THE REPORTER IS |
|---|---|---|
| clamav | a freshclam service for signatures, and no scan unit at all | command for the scan, file for the signature age |
| chkrootkit | chkrootkit.service and chkrootkit.timer | unit for whether it ran - and a wrapper for findings, because its exit code does not report them |
| rkhunter | only a cron.daily entry, with no unit | a wrapper. There is no unit to ask, so unit cannot be used |
| yara | nothing - it is a command line tool | a wrapper. It has no log, no summary and exits 0 whatever it finds |
Set the severity yourself here. A find from clamav or yara points at a file with a signature on it. rkhunter and chkrootkit are heuristic and warn about harmless things on a healthy machine, so leaving those at the default is usually right - a warning that arrives from ordinary maintenance is one you stop reading, and then it does not cover the day it says something else.
And the reporter that matters most is the one that fires when nothing is reported. A find can be suppressed by whoever holds the machine; an absence cannot. Nobody reported is not the same as nothing is wrong.
A server's other computer, as four lines
The agent can read a management controller itself - an iLO, an iDRAC, a BMC. It runs while the machine is off, and it sees things the agent never can, because the agent needs an operating system to run in.
bmc.srv01.address: 192.0.2.10
bmc.srv01.user: monitor
bmc.srv01.password: "the password, in quotes"
bmc.srv01.fingerprint: 17:8c:6c:a1:27:ba:ce:50:be:6c:0c:76:b0:08:e9:e0:22:bd:28:7f:8c:aa:ae:8b:bf:2f:bc:cd:1d:78:0c:3f| FIELD | WHAT IT MEANS |
|---|---|
bmc.<name>.address | The controller, as a host or host:port. The scheme is always https, so this is not a URL. |
bmc.<name>.user | An account on the controller itself. Make it read-only - it is enough for everything on this page, and this product never does anything else. It reads. It does not power machines on or off, and there is no button here that would. |
bmc.<name>.password | That account's password. Quote it if it has a space in it: the file is read as a plain key and value. |
bmc.<name>.fingerprint | The sha256 of the controller's certificate. Required, and it is what makes this safe - see below. |
bmc.<name>.interval | How often to ask. Optional, 15 minutes by default, with a floor of one minute. A controller is a small management processor, not a server. |
Four things come back that nothing else in the product can answer: the power state of a machine with no agent, because a machine that is off has nothing to ask; the arrays behind a hardware RAID controller, which the operating system shows as one healthy block device; the inlet temperature and fan state; and what the machine draws at the wall. The arrays become storage pools like any other, so every rule and page that already covers ZFS, mdraid, btrfs and LVM covers them too.
A RAID0 volume is marked as having no redundancy, and that is not the same as degraded. Measured on our own DL380: all four volumes behind its Smart Array are RAID0, and the controller answers OK for every one. That is true about the drives and it is not an answer to the question a storage pool exists to answer - one disk lost is everything lost. It is deliberately not an alert, because RAID0 is a choice somebody made, and an alert that fires forever on a choice is one you switch off. It is written next to the state instead.
The fingerprint is required, and it is why this is safe
A controller has a self-signed certificate whose name rarely matches its address, so ordinary certificate checking cannot be used - and turning verification off would make anyone on the network a man in the middle for an account that can power-cycle the server. The agent pins the certificate instead, which is stricter than a certificate authority: no issuer anywhere can produce one that matches. Without a fingerprint the agent refuses to start rather than connect without one.
openssl s_client -connect <bmc>:443 </dev/null 2>/dev/null |
openssl x509 -fingerprint -sha256 -nooutAny of the forms the tools print is accepted - with colons or without, upper or lower case, with or without a sha256 prefix. A mistyped fingerprint looks exactly like a wrong certificate, so the agent takes the shape the tool hands you.
Two ways in, and the agent picks
Redfish over HTTPS where the controller has it, and ipmitool where it does not. That is not a detail: measured across our own fleet, two of three controllers only speak IPMI. An older board often has no HTTPS at all, so there is no Redfish to read - and no certificate you could install would change that, because the firmware has no such service. ipmitool is not installed by the agent; if it is missing, the controller is reported as a blind spot that says exactly that.
What IPMI cannot answer, it says rather than leaving blank. There is no way to see an array behind a RAID controller, and no sensor carries a context, so no reading can be called the inlet without guessing which one sits at the front. A sensor with no reading is not a fan that failed - an empty fan slot reads that way forever - and a machine whose sensors all read nothing gets no health verdict at all, which is what a powered-off machine answers.
Zero watts is treated the same way. One of our boards answers the power query with zero on a running machine, because the supply is not wired to the board for monitoring - on a Supermicro that is a 5-pin PMBus cable. A zero stored as a measurement would be a graph saying the server draws nothing, so it is reported as not measured, with that sentence.
It only reads
The agent cannot power a machine on, off or through a restart. That is not a setting you could turn on: there is no code in it that writes to a controller at all - no HTTP verb other than GET, and none of the words a controller would need to hear - and a test parses the source and fails if one appears. A monitoring agent that can power-cycle a fleet is a different kind of thing from one that watches it.
The credentials stay on the host. The central never learns the address or the account, so the most it can ever ask for is turn on the controller you call srv01 - it cannot point somewhere new. Same line as for reporters, and here it is what makes such a request safe to send at all.
The switch, as six lines
One agent reads one device. Write the block on the host you want doing the talking - there is no discovery, and nothing scans your network.
netdev.core-switch-01.vendor: mikrotik
netdev.core-switch-01.address: 10.0.0.2
netdev.core-switch-01.user: monitor
netdev.core-switch-01.password: "the password, in quotes"
netdev.core-switch-01.fingerprint: 17:8c:6c:a1:27:ba:ce:50:be:6c:0c:76:b0:08:e9:e0:22:bd:28:7f:8c:aa:ae:8b:bf:2f:bc:cd:1d:78:0c:3f| FIELD | WHAT IT MEANS |
|---|---|
netdev.<name>.vendor | Which field map to read the answer with. Required: mikrotik or unifi. The agent does not probe - an unknown vendor stops it at startup rather than becoming a device that never answers and never says why. |
netdev.<name>.address | The device, as a host or host:port. The scheme is always https, so this is not a URL. |
netdev.<name>.user | An account on the device itself. It must be read-only. On RouterOS that is a group with policy=read,api,rest-api - and api alone is not enough. The agent has no code path that writes to a network device; a request that changes something cannot be built. |
netdev.<name>.password | That account's password. Quote it if it has a space in it. |
netdev.<name>.fingerprint | The sha256 of the device's certificate. Required, for the same reason as a controller's. |
netdev.<name>.interval | How often to ask. Optional, 5 minutes by default, with a floor of one minute. Link state does not change faster than that is worth reading. |
Until now the product has seen the network from the host's end of the cable only. What the switch itself knows was invisible: which port a machine hangs on, a dying SFP, the PoE budget, the port somebody disabled at 23:00.
And the case you hope never happens. When a switch loses power, every host behind it goes quiet in the same second - so the product reports N dead machines and not one word about the one thing that actually failed. The signal was always there; it pointed at the wrong thing.
It reads. It cannot write. That is not a promise in a document - the agent talks to a device through a client that has exactly one method, so there is no request to build that would change anything. Turning a port off is taking the network away from whatever is on it, and this product does not do that.
Nothing is discovered. An agent that scanned its own network to find equipment would be a port scanner in software people install as root. Devices are written by hand, one block each, like a controller.
A UniFi block is the controller, not a device
MikroTik is one address for one box. A UniFi Network Application is one address for every box it has adopted - so you write the controller, and the switches, gateways and access points arrive from it. Each one still gets its own row, and each row says which block it came from.
Use a local account with the View Only role. A Ubiquiti SSO login does not work against the local API at all.
One POST, and only one. A self-hosted controller has no Integrations page to make an API key on - that belongs to the UniFi OS console, which a self-hosted install does not have. Measured on Network Application 10.6.101: the integration endpoints answer 404 and the old API answers 401. So the account is exchanged for a session cookie through POST /api/login, and that is the only request in the agent that is not a GET. It carries a username and a password and gets a cookie back; it changes nothing on the device, exactly like the handshake an IPMI session needs. The client can reach one path with it, fixed when the client is built, and three tests fail if that stops being true.
Or through a wrapper, if you would rather
This recipe predates the four lines above and still works. It is worth keeping if you want thresholds of your own, or something the agent does not read.
Four things it knows that nothing else in the product does: power state on a machine with no agent; hardware faults the kernel never logged - a dead PSU in a redundant pair, a fan on its way out, a DIMM taken out of service at POST; disks behind a hardware RAID controller, which show the operating system one block device and hide a degraded array completely; and inlet temperature.
Measured on a ProLiant DL380 Gen10 with iLO 5, firmware 2.96: the Redfish service root answers 200 without credentials and reports RedfishVersion 1.6.0. Everything useful - /redfish/v1/Systems/1/, /Chassis/1/Thermal/, /Managers/1/, the integrated management log - answers 401. That is the correct answer, and it means this needs an account.
Make it a read-only iLO user. It is enough for all four, and a monitoring system that can power-cycle a fleet is a different blast radius.
The account goes in a file of its own, owned by root and mode 0600, because the wrapper is run as root by the agent:
# /etc/ziix-observer/ilo.env chown root:root, chmod 0600
BMC_HOST=192.0.2.10
BMC_USER=monitor
BMC_PASS="the password, in quotes"Quote the password. The wrapper sources this file, so an unquoted value with a space in it makes the shell try to run the rest of the line - and the reporter then goes blind with no health status, which points at the BMC rather than at the file that is actually wrong.
#!/bin/sh
# /usr/local/bin/sf-ilo - measured against an iLO 5, firmware 2.96.
set -u
# Root-owned on purpose. The agent runs as root, so an env file in a
# user-writable place would be a path from that account to the BMC:
# change BMC_HOST, and root's curl sends the account to someone else.
ENV_FILE=${ILO_ENV:-/etc/ziix-observer/ilo.env}
[ -r "$ENV_FILE" ] || { echo "cannot read $ENV_FILE"; exit 3; }
. "$ENV_FILE"
# The credential goes in on stdin and never in argv: a command line is
# readable in the process table by every user on the host, and this one
# can power-cycle the machine.
get() {
printf 'user = "%s:%s"\n' "$BMC_USER" "$BMC_PASS" |
curl -sk --max-time 10 -K - "https://$BMC_HOST$1"
}
HEALTH=$(get /redfish/v1/Systems/1/ | jq -r '.Status.Health // empty')
# No answer is unknown, not ok: a BMC you cannot reach is a blind spot on
# the one thing that can see the machine while it is off.
[ -n "${HEALTH:-}" ] || { echo "no health status from $BMC_HOST"; exit 3; }
TH=$(get /redfish/v1/Chassis/1/Thermal/)
INTAKE=$(printf '%s' "$TH" | jq -r '[.Temperatures[]?
| select(.PhysicalContext == "Intake") | .ReadingCelsius] | first // empty')
FANS=$(printf '%s' "$TH" | jq -r '[.Fans[]?] | length')
OK=$(printf '%s' "$TH" | jq -r '[.Fans[]? | select(.Status.Health == "OK")] | length')
PERF="|intake=${INTAKE:-U} fans_ok=$OK fans=$FANS"
case "$HEALTH" in
OK) echo "iLO OK - system health OK$PERF" ; exit 0 ;;
Warning) echo "iLO WARNING - system health Warning$PERF" ; exit 1 ;;
Critical) echo "iLO CRITICAL - system health Critical$PERF"; exit 2 ;;
*) echo "iLO reported health $HEALTH$PERF" ; exit 3 ;;
esacOn our own DL380 that answers iLO OK - system health OK|intake=28 fans_ok=6 fans=6. A wrong account, an address that does not answer and a missing env file all exit 3, so none of them can be mistaken for a healthy machine.
One limit worth knowing before you set the severity: iLO's Warning and Critical both become failed, because Nagios 1 and 2 are not told apart by the state. So a Warning alerts at whatever you chose. On a single production server, hardware that is degraded is usually worth the noise.
reporter.ilo.command: /usr/local/bin/sf-ilo
reporter.ilo.interval: 15m
reporter.ilo.timeout: 30s
reporter.ilo.severity: criticalThe call belongs on a host, not on the central. The central deliberately cannot reach a private address - the same fence that stops an alert webhook from being pointed at your internal network - so a BMC address typed into a form would be a way to make the central probe its own infrastructure. An agent already on that network has no such problem, and the credential never leaves the machine it was typed on.
For a BMC on a machine that has no agent at all, point the reporter at the neighbour's address from a host that can reach it. The BMC answers while the machine is off, which is the only way to see such a machine.
Plain IPMI, and the two things we measured
Not every BMC speaks Redfish. On a Supermicro board in our own fleet, https://<bmc>/redfish/v1/ did not answer at all, so the wrapper calls ipmitool -I lanplus ... sdr instead. Two measurements changed what the rule could be:
| WHAT WE FOUND | WHAT IT MEANT |
|---|---|
Of 34 sensors, three were not ok: FAN4, FAN5 and FAN6, all in state ns | ns is “no reading” - empty fan slots, and they will read that way forever. A rule on “not ok” would be red for good. Only nc, cr and nr are faults. |
| The event log held 208 entries, most of them marked Pre-Init | Logged before the clock was set, which is to say at power-on: voltages ramp and fans spin up from zero, crossing their thresholds every single boot. So the log grows on every power cycle, and its size cannot be a rule without a baseline of which entries are normal. We send the count as a number with no threshold, so a growing log is visible without alerting. |
Neither tool may take the password as an argument. A command line is readable in the process table by every user on the host, and this credential reaches a controller that can power-cycle the machine - so ipmitool gets it through IPMI_PASSWORD and -E, and curl gets it on stdin through -K - rather than through -u. The agent runs the wrapper as root every interval, so this is a loop on ps away, not a theoretical leak.
And set the BMC clock. Ours was an hour out after a CMOS battery change, and a hardware fault whose timestamp is wrong is most of the way to being no record at all.
Reporters can only be set on the host
The central can show you a reporter. It cannot define one.
The central already pushes configuration down to the agent - intervals, log patterns, the watchlist. If reporters could arrive that way, a reporter that ran a command would turn a monitoring agent into a way to run commands as root on every machine in every organisation, from one place. So the file is the only source, and a reporter you add takes effect on the next collection round without restarting the agent.
If the file becomes invalid, the agent keeps running and tells the central why. It does not close the alarms for reporters it can no longer read: nobody reported is not the same as nothing is wrong.