Strange output issue with check_apt

Eric Schoeller eric.schoeller at colorado.edu
Mon Mar 18 18:42:10 CET 2024


Hello,

This is a corner-case problem and I'm not entirely sure if it's 
something anyone will want to address. But I figured I'd mention it. I 
still use the text-based Nagios UI "cnagios" and it's having trouble 
parsing the output from check_apt in a way that I've never seen before. 
The hostname is gone and most of the status text is missing. Here are 
some examples, I'm not sure if images will come through on this list so 
if they don't I'll try to re-send as text only.

Here is a host that has updates pending:



You can see "sark" is missing from the "System Updates" check output.

Here is a system that has no pending updates:



Again, the hostname is missing, and most of the script output is also 
gone as well.

Here is the actual plugin output from the command line for both:

clu: /usr/lib/nagios/plugins/check_apt --critical="^[^\(]*\(.* 
(Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" -o
APT OK: 1 packages available for upgrade (0 critical updates). 
|available_upgrades=1;;;0 critical_updates=0;;;0

sark: /usr/lib/nagios/plugins/check_apt --critical="^[^\(]*\(.* 
(Debian-Security:|Ubuntu:[^/]*/[^-]*-security)" -o
APT CRITICAL: 46 packages available for upgrade (46 critical updates). 
|available_upgrades=46;;;0 critical_updates=46;;;0

I "borrowed" that regex from the plugin help. I realize that cnagios is 
ancient and largely no longer supported so I can easily see this as 
being a problem with that software that won't get resolved, however, it 
processes plugin output from just about everything else OK so it leads 
me to believe there may be something buried within the check_apt output 
that may not be entirely nagios-friendly. It could simply be that it 
includes a newline at the end of the output, which as I recall is not 
exactly "compliant". cnagios doesn't wrap the plugin output onto 
additional lines, instead it just displays only what it can given the 
width of the window. I've stretched my window as wide as I can across 
two monitors and none of the missing text ever shows up.

Thanks!

Eric Schoeller
Office of Information Technology
University of Colorado Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20240318/65f9f62b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnnFqD0Eh0v4gyIT.png
Type: image/png
Size: 30457 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20240318/65f9f62b/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3tKG8fQy0u0ksWKu.png
Type: image/png
Size: 26770 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20240318/65f9f62b/attachment-0003.png>


More information about the Help mailing list