needrestart icon indicating copy to clipboard operation
needrestart copied to clipboard

nagios plugin: easier to read overview output

Open anarcat opened this issue 2 years ago • 3 comments

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!

anarcat avatar Nov 24 '21 16:11 anarcat

ping? would you be open to a PR for this?

anarcat avatar Jan 26 '22 02:01 anarcat

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!

liske avatar Jan 27 '22 21:01 liske

Adding an option to print service list would solve #154.

liske avatar Jan 27 '22 22:01 liske