Hi Patrick,
On Thu, Jul 30, 2015 at 01:57:25PM +0000, Patrick Schleizer wrote:
> Package: needrestart
> Severity: wishlist
>
> When running 'needrestart' from a terminal or script, it would be useful
> to have some command line parameter to make it exit non-zero, in case
> any restart(s) are required.
did you give the nagios plugin mode (-p) a try (see also
README.nagios.md)? It will set the RC code to non-zero if a restart is
required. Could be combined with -l or -k to look only for outdated
libraries or kernel usage:
# needrestart -p ; echo "RC=$?"
WARN - Kernel: 4.1.3-tl1+, Services: none, Containers: none, Sessions: 1
(!)|Kernel=0;0;;0;2 Services=0;;0;0 Containers=0;;0;0 Sessions=1;0;;0
RC=1
HTH,
Thomas
--
:: WWW: https://fiasko-nw.net/~thomas/ ::
::: Jabber: xmpp:[email protected] :::
:: flickr: https://www.flickr.com/photos/laugufe/ ::