Describe the solution you'd like
Currently, the plugin /usr/lib64/nagios/plugins/systemd-units-failed only reports a generic message in the first output line, e.g.:
When monitoring multiple systems, this message is not very helpful, as it requires opening the plugin’s extended output or performance data to see which service actually failed.
I propose adding an optional parameter, for example --include-unit-names (or similar), that changes the first output line to include the failed unit names directly when there are only a few of them.
Example desired output:
1 failed unit: letsencrypt-wrapper.service
or if multiple:
2 failed units: letsencrypt-wrapper.service, postfix.service
This would make it easier to immediately identify failed units from dashboards or SMS alerts without needing to expand the plugin details.
Additional context
The feature should be optional to maintain backward compatibility with existing parsing or alerting setups.
Example command for new behavior:
/usr/lib64/nagios/plugins/systemd-units-failed --include-unit-names
Describe the solution you'd like
Currently, the plugin /usr/lib64/nagios/plugins/systemd-units-failed only reports a generic message in the first output line, e.g.:
When monitoring multiple systems, this message is not very helpful, as it requires opening the plugin’s extended output or performance data to see which service actually failed.
I propose adding an optional parameter, for example --include-unit-names (or similar), that changes the first output line to include the failed unit names directly when there are only a few of them.
Example desired output:
or if multiple:
This would make it easier to immediately identify failed units from dashboards or SMS alerts without needing to expand the plugin details.
Additional context
The feature should be optional to maintain backward compatibility with existing parsing or alerting setups.
Example command for new behavior: