Linux

check_ubuntu_packages.patch

Description:

A patch to make the check_debian_packages plugin suitable for use with Ubuntu.

Current Version

Last Release Date

January 31, 2010

Compatible With

Owner


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
This patch should be applied to the check_debian_packages plugin at http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check-debian-packages/details - Written by Tony Yarusso
Reviews (1) Add a Review
Patch in universal diff for easier patching
by jorgegv, November 30, 2017
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
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4 (1)
Favorites
0
Views
98,953