Hello community,
here is the log from the commit of package nagios-plugins-zypper for
openSUSE:Factory checked in at 2014-06-30 21:45:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nagios-plugins-zypper (Old)
and /work/SRC/openSUSE:Factory/.nagios-plugins-zypper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nagios-plugins-zypper"
Changes:
--------
---
/work/SRC/openSUSE:Factory/nagios-plugins-zypper/nagios-plugins-zypper.changes
2014-06-16 21:28:19.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.nagios-plugins-zypper.new/nagios-plugins-zypper.changes
2014-06-30 21:45:38.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Jun 26 15:09:33 UTC 2014 - [email protected]
+
+- update to 1.80:
+ + invent new option for the local package check: -l, --check-local
+ otherwise packages from OBS repos will become local after each
+ rebuild as zypper just checks for packages with same version-
+ release in repos
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nagios-plugins-zypper.spec ++++++
--- /var/tmp/diff_new_pack.DX9fda/_old 2014-06-30 21:45:39.000000000 +0200
+++ /var/tmp/diff_new_pack.DX9fda/_new 2014-06-30 21:45:39.000000000 +0200
@@ -20,7 +20,7 @@
Summary: Nagios plugin for checking software updates
License: BSD-4-Clause
Group: System/Monitoring
-Version: 1.76
+Version: 1.80
Release: 0
Url: http://en.opensuse.org/Nagios-plugins-zypper
Source0: check_zypper.pl
++++++ check_zypper.pl ++++++
--- /var/tmp/diff_new_pack.DX9fda/_old 2014-06-30 21:45:39.000000000 +0200
+++ /var/tmp/diff_new_pack.DX9fda/_new 2014-06-30 21:45:39.000000000 +0200
@@ -50,11 +50,11 @@
# constants
$PROGNAME = "check_zypper";
-$VERSION = '1.76';
+$VERSION = '1.80';
$DEBUG = 0;
# variables
-our ( $opt_V, $opt_h, $opt_i, $opt_w, $opt_c, $opt_f, $opt_o, $opt_p, $opt_r,
$opt_s, $opt_t, $opt_u, $opt_v );
+our ( $opt_V, $opt_h, $opt_i, $opt_w, $opt_c, $opt_f, $opt_l, $opt_o, $opt_p,
$opt_r, $opt_s, $opt_t, $opt_u, $opt_v );
our $zypper = '/usr/bin/zypper';
our $zypperopt = '--non-interactive --no-gpg-checks xml-updates';
our $sudo = '/usr/bin/sudo';
@@ -123,26 +123,26 @@
sub get_distribution($) {
my ($file) = @_;
- my %dist = (
- 'name' => '',
- 'version' => '',
- 'release' => '0',
- );
+ my %dist = (
+ 'name' => '',
+ 'version' => '',
+ 'release' => '0',
+ );
open( RELEASE, "<$file" ) || warn("Could not open $file\n");
while (<RELEASE>) {
if (/^SUSE Linux Enterprise/) {
$dist{'name'} = 'SLE';
}
- elsif (/^openSUSE/){
- $dist{'name'} = 'openSUSE';
- }
+ elsif (/^openSUSE/){
+ $dist{'name'} = 'openSUSE';
+ }
if (/^VERSION/) {
my ($version) = $_ =~ m/VERSION = (.*)/;
- $dist{'version'}=trim($version);
+ $dist{'version'}=trim($version);
}
if (/^PATCHLEVEL/) {
my ($release) = $_ =~ m/PATCHLEVEL = (.*)/;
- $dist{'release'}=trim($release);
+ $dist{'release'}=trim($release);
}
}
close(RELEASE);
@@ -206,6 +206,11 @@
print " Default value is: $opt_t seconds\n";
print " -u, --check-vendor\n";
print " Check if installed packages are not from a supported
vendor.\n";
+ print " -l, --check-local\n";
+ print " Check for local packages that are not in any repository.
NOTE: zypper just searches for\n";
+ print " exact the same version-release in the repositories, so if the
repositories do not contain\n";
+ print " old versions of the packages, this check may always produce a
warning.\n";
+ print " This check does not work on SLE-10\n";
print " -v, --verbose_output\n";
print " Print more information (useful only with Nagios v3.x).\n";
print " -w, --warning\n";
@@ -249,7 +254,7 @@
chomp $line;
print STDERR "LINE: $line\n" if ($DEBUG);
# error handling
- return ( "ERROR: " . xml_re_escape($line), $ERRORS{'CRITICAL'}
) if ( $line =~ /Could not access the package manager engine.*/ );
+ return ( "ERROR: " . xml_re_escape($line), $ERRORS{'CRITICAL'}
) if ( $line =~ /Could not access the package manager engine.*/ );
return ( "ERROR: " . xml_re_escape($line), $ERRORS{'CRITICAL'}
) if ( $line =~ /Could not refresh repository.*/ );
return ( "ERROR: " . xml_re_escape($line), $ERRORS{'CRITICAL'}
) if ( $line =~ /There are no enabled repositories defined.*/ );
return ( "ERROR: " . xml_re_escape($line), $ERRORS{'CRITICAL'}
) if ( $line =~ /Digest verification failed.*/ );
@@ -346,6 +351,7 @@
my @loc_packagelist = ();
if ($opt_u) {
+ print STDERR "INFO: checking for unsupported packages installed on the
system\n" if ($DEBUG);
@unsup_packagelist = `$rpm -qa --qf "%{NAME} %{VENDOR}\n" | $grep -v
'SUSE LINUX Products GmbH, Nuernberg, Germany' | $grep -v 'openSUSE' | $grep -v
'SUSE LLC <https://www.suse.com/>' | $grep -v gpg-pubkey | $awk '" " { print
\$1 }'`;
my $category = 'unsupported';
my $status = 'new';
@@ -359,22 +365,25 @@
$packagelist{"$category"}{"$name"}{'name'} = "$name";
$packagelist{"$category"}{"$name"}{'status'} = "$status";
}
- if ( $dist->{'version'} gt 10.4 ){
- @loc_packagelist = `$zypper search --details --installed-only |
$grep '(System Packages)' | $awk '" " { print \$3 }'`;
- my $category = 'local_package';
- my $status = 'new';
- foreach my $name ( sort(@loc_packagelist) ) {
- chomp($name);
- if ( grep {$_ eq $name} @localwhitelist ) {
- print STDERR "WARINING: ignoring $name as it is in
\@localwhitelist\n" if ($DEBUG);
- next;
- }
- $packagelist{"$category"}{"$name"}{'category'} = "$category";
- $packagelist{"$category"}{"$name"}{'name'} = "$name";
- $packagelist{"$category"}{"$name"}{'status'} = "$status";
+ }
+
+ if (($opt_l) && ( $dist->{'version'} gt 10.4 )){
+ print STDERR "INFO: checking for local packages not referenced in
repositories\n" if ($DEBUG);
+ @loc_packagelist = `$zypper search --details --installed-only | $grep
'(System Packages)' | $awk '" " { print \$3 }'`;
+ my $category = 'local_package';
+ my $status = 'new';
+ foreach my $name ( sort(@loc_packagelist) ) {
+ chomp($name);
+ if ( grep {$_ eq $name} @localwhitelist ) {
+ print STDERR "WARINING: ignoring $name as it is in
\@localwhitelist\n" if ($DEBUG);
+ next;
}
+ $packagelist{"$category"}{"$name"}{'category'} = "$category";
+ $packagelist{"$category"}{"$name"}{'name'} = "$name";
+ $packagelist{"$category"}{"$name"}{'status'} = "$status";
}
}
+
print STDERR "INFO: Trying $use_sudo $zypper $zypperopt\n" if ($DEBUG);
if ( open( FH, "$use_sudo $zypper $zypperopt 2>&1 |" ) ) {
@@ -534,8 +543,8 @@
else {
$ret_str .= "\nUnsupported, ignored Packages:
$#packagewhitelist ";
}
- if ( $#localwhitelist lt 11 ) {
- $ret_str .= "\nLocal, ignored Packages: " . join( ' ',
sort(@localwhitelist)). " " if @localwhitelist;
+ if ( $#localwhitelist lt 11 ) {
+ $ret_str .= "\nLocal, ignored Packages: " . join( ' ',
sort(@localwhitelist)). " " if @localwhitelist;
}
else {
$ret_str .= "\nLocal, ignored Packages: $#localwhitelist ";
@@ -555,12 +564,12 @@
else {
$ret_str .= "\nUnsupported, ignored Packages:
$#packagewhitelist ";
}
- if ( $#localwhitelist lt 11 ) {
- $ret_str .= "\nLocal, ignored Packages: " . join( ' ',
@localwhitelist ). " " if @localwhitelist;
- }
- else {
- $ret_str .= "\nLocal, ignored Packages: $#localwhitelist ";
- }
+ if ( $#localwhitelist lt 11 ) {
+ $ret_str .= "\nLocal, ignored Packages: " . join( ' ',
@localwhitelist ). " " if @localwhitelist;
+ }
+ else {
+ $ret_str .= "\nLocal, ignored Packages: $#localwhitelist ";
+ }
}
}
$ret_str
@@ -607,6 +616,8 @@
"refresh_repos" => \$opt_r,
"t=i" => \$opt_t,
"timeout=i" => \$opt_t,
+ "l" => \$opt_l,
+ "check-local" => \$opt_l,
"u" => \$opt_u,
"check-vendor" => \$opt_u,
"v" => \$opt_v,
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]