#590941 nagios-plugins-basic: check_apt -v outputs in wrong order

#590941#5
Date:
2010-07-30 11:03:35 UTC
From:
To:
The output of check_apt with the -v option is at the moment the following:

# /usr/lib/nagios/plugins/check_apt -v
Inst ldap-utils [2.4.11-1+lenny1] (2.4.11-1+lenny2 Debian-Security:5.0/stable) []
**Inst ldap-utils [2.4.11-1+lenny1] (2.4.11-1+lenny2 Debian-Security:5.0/stable) []
Inst libldap-2.4-2 [2.4.11-1+lenny1] (2.4.11-1+lenny2 Debian-Security:5.0/stable)
**Inst libldap-2.4-2 [2.4.11-1+lenny1] (2.4.11-1+lenny2 Debian-Security:5.0/stable)
Conf libldap-2.4-2 (2.4.11-1+lenny2 Debian-Security:5.0/stable)
Conf ldap-utils (2.4.11-1+lenny2 Debian-Security:5.0/stable)
APT CRITICAL: 2 packages available for upgrade (2 critical updates).

Nagios displays in the Service Status Detail page for all Hosts for
each service the *first* line of each plugins output. So it displays
for this example:

Inst ldap-utils [2.4.11-1+lenny1] (2.4.11-1+lenny2 Debian-Security:5.0/stable) []

instead of

APT CRITICAL: 2 packages available for upgrade (2 critical updates).

So, this last line should appear as first line of the output instead.

Christoph

#590941#10
Date:
2010-07-30 14:24:16 UTC
From:
To:
Hi Christoph,

what exactly is the reason for calling check_apt with "-v" when you are using
it with nagios? I mean, using just "check_apt" is providing you all
information you need, when using it via nagios.

With kind regards, Jan.

#590941#15
Date:
2010-07-30 14:32:44 UTC
From:
To:
Hi Jan,

schrieb Jan Wagner am 07/30/10 16:24:

As I said, on the overview page I get one line for each service using -v:

debianbuild64 | Package Update | CRITICAL 	2010-07-30 16:23:46 	0d 8h
42m 14s 	3/3 	Inst libldap-2.4-2 [2.4.11-1+lenny1] (2.4.11-1+lenny2
Debian-Security:5.0/stable)

or without -v:

localhost | Package Updates | CRITICAL 	2010-07-30 16:23:52 	0d 9h 8m
24s 	4/4 	APT CRITICAL: 1 packages available for upgrade (1 critical
updates).

But when you click on the Service Description "Package Updates" you get
more details about this particular service check. Here you would get all
the output lines of the plugin. A lot of plugins use this feature to
provide extended information.

For check_apt it would get a quick way to find out which patches are be
installed.

Christoph

#590941#22
Date:
2013-06-25 13:39:28 UTC
From:
To:
severity 590941 wishlist
tags 590941 + moreinfo
thanks

Hi Christoph,

Am 30.07.2010 16:32, schrieb Christoph Martin:

I had again a look into this issue.

As I understand you interest into this issue, but a verbose output is
not intended to produce a multiline output. A short look into the
source revealed that this is no one liner.

When verbose mode, the grabed data is printed raw when it's processed.
The checkresult is written later on after all data is processed. To
implement you feature request, it's needed to store all the grabed
data and write it after the check result to the output.

We and upstream are glad to accept patches/push requests here.

Cheers, Jan.