matteocorti / nagios_plugins

18 stars 7 forks source link

Security updates always critical #129

Closed matteocorti closed 8 years ago

matteocorti commented 8 years ago

Original reporter: florent.lartet@univ-tlse2.fr

Hi, with any -w -c option, CRITICAL is returned.

It looks strange, in the source, line 486, you have $status = CRITICAL and then, no status modifying.

I copied your file and turned it into if ( @security_updates > 0 ) { if ( @security_updates >= $options->get('warning') ) { $status = WARNING; } if ( @security_updates >= $options->get('critical') ) { $status = CRITICAL; } and now it looks better. As I'm not the file coder I'm not sure about the right solution, is it more or less like that ? Thanks for your files.

matteocorti commented 8 years ago

Original reporter: anonymous

The behavior is correct. A security update is always critical regardless of how many there are.

--critical and --warning are only for non-security related updates:

     -w, --warning=INTEGER                    Exit with WARNING status if more than INTEGER non-security updates are available

     -c, --critical=INTEGER                   Exit with CRITICAL status if more than INTEGER non-security updates are available