needrestart
needrestart copied to clipboard
nagios plugin: easier to read overview output
we have just switched from a home-made solution to needrestart for monitoring restarts, and we're quite happy with the results. one thing we're finding difficult to use, however, is that the overview summary is a little confusing.
for example, say we have:
WARN - Kernel: 4.19.0-18-amd64, Services: 1 (!), Containers: none, Sessions: none
Now I know this means there are two services to restart, but it's not really obvious. I need to "scan" for the (!)
symbol to see where the problem is. I think a much easier to read version would simply be:
WARN - Services: 1
... or, even better:
WARN - Services 1 (gitlab-runner.service)
... yes, actually listing the services in there. I understand there are space constraints, but the way we use needrestart, it actually restarts most stuff on its own and it's only a handful of small things that need to be restarted by hand.
I've looked at the source to implement this and it's not super trivial, but should be possible. I figured I would ask here before working on a PR.
Thanks!
ping? would you be open to a PR for this?
Improving the status line sounds like a good idea (I don't use the nagios plugin at all). Your first proposal looks good. The list of services could be enabled by a cli parameter (something like the max. # of services to be shown, defaulting to 0
?).
I would accept such a PR!
Adding an option to print service list would solve #154.