Build precise queries to find exactly what you need
Press ESC to close
Patch: — check_debian_packages 2017-11-09 13:17:39.528526651 +0100 +++ check_ubuntu_packages 2017-11-09 13:27:51.926197425 +0100 @@ -109,7 +109,7 @@ sub run_apt { my ($pkg,$ver,$type,$release); open APT,”$CMD_APT 2>&1|” or exit_unknown($!); – my (%stable,%security,%other); + my (%updates,%backports,%security,%other); while () { print “APT: $_” if $DEBUG; exit_unknown($_) if /(Could not open lock file)|(Could not get lock)/; @@ -117,12 +117,16 @@ ($pkg,$ver,$release) = /Inst (.*?) .*((.*?) (.*?))/; print “$_npkg=$pkg ver=$ver release=$releasen” if $DEBUG; die “$_n” unless defined $release; – $release = ‘stable’ – if $release =~ /stable$/ && $release !~/security/i; + $release = ‘updates’ + if $release =~ /updates/; + $release = ‘backports’ + if $release =~ /backports/; $release = ‘security’ if $release =~ /security/i; – if ($release eq ‘stable’) { – $stable{$pkg} = $ver; + if ($release eq ‘updates’) { + $updates{$pkg} = $ver; + } elsif ($release eq ‘backports’) { + $backports{$pkg} = $ver; } elsif ($release eq ‘security’) { $security{$pkg} = $ver; } else { @@ -134,9 +138,10 @@ if (keys (%security)) { $RET = ‘CRITICAL’; add_info($info,’security’,%security); – } elsif (keys (%other) or keys(%stable)) { – $RET = ‘WARNING’; – add_info($info,’stable’,%stable); + } elsif (keys (%other) or keys(%updates)) { + $RET = ‘WARNING’; + add_info($info,’updates’,%updates); + add_info($info,’backports’,%backports) if keys %backports; add_info($info,’other’,%other) if keys %other; } print “$RET: $infon”;
HOW TO PATCH: – Save the previous diff to file check_ubuntu_packages.patch – Put check_debian_packages in the same directory as this patch – Execute: patch check_debian_packages check_ubuntu_packages.patch -o check_ubuntu_packages
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!