matteocorti / nagios_plugins

18 stars 7 forks source link

extra output makes check fails #105

Closed matteocorti closed 8 years ago

matteocorti commented 8 years ago

Original reporter: stroetgen@gei.de

The plugin check_updates makes some extra output before status message:

[root@vmhost2 ~]# /usr/local/nagios/libexec/check_updates
Unable to read consumer identity
Unable to read consumer identity
CHECK_UPDATES CRITICAL - 7 non-critical updates available | total_updates=7;0;0 security_updates=0;0;0
ftp.x86_64
mlocate.x86_64
python-mako.noarch
python-zope-interface.x86_64
wget.x86_64
Obsoleting
python-zope-interface.x86_64

This makes nagios checks fail:

Remote command execution failed: Unable to read consumer identity

The command is


$USER1$/check_by_ssh -H $HOSTADDRESS$ -C "sudo /usr/local/nagios/plugins/check_updates"
matteocorti commented 8 years ago

Original reporter: matteo@corti.li

Hi,

the problem is that you is generating some error messages I am not filtering out. Could you please run

yum check_updates > check_updates.out 2> check_updates.err

and

yum --security check_updates > check_updates_security.out 2> check_updates_security.err

And attach the four files to the ticket?

As a temporary fix I think that you can just substitute the line

my $command = "yum $arguments check-update";

with

my $command = "yum $arguments check-update 2>&1";

Matteo

matteocorti commented 8 years ago

Original reporter: matteo@corti.li

Problem solved by fixing the local configuration.

The plugin could be more robust but for the moment I'll close the ticket