[Pkg-nagios-changes] [pkg-nagios-plugins-contrib] 01/01: check_libs: fix lsof output parsing for OpenVZ

Evgeni Golov evgeni at moszumanska.debian.org
Wed Oct 1 06:46:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

evgeni pushed a commit to branch master
in repository pkg-nagios-plugins-contrib.

commit cd40ea09146dce49095de8a6bfd53bf7be96f8c4
Author: Evgeni Golov <evgeni at golov.de>
Date:   Wed Oct 1 08:43:45 2014 +0200

    check_libs: fix lsof output parsing for OpenVZ
    
    check_libs sometimes parses files incorrectly
    inside an OpenVZ container (wheezy host and guest, proxmox ve
    2.6.32 kernel):
    
    Running /usr/bin/lsof -F0 -n
    adding bash(28081) because of [ (deleted)/tmp/tmpfXKFYTG]:
    f1aul tREGG0x8002;0x0D0x6ds218i9441399k0n (deleted)/tmp/tmpfXKFYTG
    adding bash(28081) because of [ (deleted)/tmp/tmpfXKFYTG]:
    f2aul tREGG0x8002;0x0D0x6ds218i9441399k0n (deleted)/tmp/tmpfXKFYTG
    adding puppet(28244) because of [ (deleted)/tmp/tmpfXKFYTG]:
    f1aul tREGG0x8002;0x0D0x6ds218i9441399k0n (deleted)/tmp/tmpfXKFYTG
    adding puppet(28244) because of [ (deleted)/tmp/tmpfXKFYTG]:
    f2aul tREGG0x8002;0x0D0x6ds218i9441399k0n (deleted)/tmp/tmpfXKFYTG
    The following processes have libs linked that were upgraded: root: bash
    (28081), puppet (28244)
    
    So in some cases there is a space in front of "(deleted)".
    Attached is a patch that fixes this.
    
    Thanks: Felix Geyer <felix.geyer at credativ.de>
    Closes: #760373
---
 debian/patches/check_libs/space_before_deleted | 12 ++++++++++++
 debian/patches/series                          |  3 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/patches/check_libs/space_before_deleted b/debian/patches/check_libs/space_before_deleted
new file mode 100644
index 0000000..da935e8
--- /dev/null
+++ b/debian/patches/check_libs/space_before_deleted
@@ -0,0 +1,12 @@
+diff -Nur a/check_libs/nagios-check-libs b/check_libs/nagios-check-libs
+--- a/check_libs/nagios-check-libs
++++ b/check_libs/nagios-check-libs
+@@ -170,7 +170,7 @@
+ 	my $inode = $fields{i};
+ 	my $path  = $fields{n};
+ 	if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $fd eq 'DEL') {
+-		$path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string
++		$path =~ s/^ ?\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string
+ 		for my $i (@{$config->{'ignorelist'}}) {
+ 			my $ignore = eval($i);
+ 			next LINE if $ignore;
diff --git a/debian/patches/series b/debian/patches/series
index ce72cf3..fb649cc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-check_libs/lsof-nP
 check_ajp/return_critical_on_failed_connection
 check_backuppc/use_nagios_plugins
 check_bgpstate/epn
@@ -10,7 +9,9 @@ check_email_delivery/paths
 check_haproxy/epn
 check_httpd_status/epn
 check_imap_quota/syntax_error_fix
+check_libs/lsof-nP
 check_libs/config_path
+check_libs/space_before_deleted
 check_lm_sensors/manpage_whatis_fix
 check_lm_sensors/spelling_errors
 check_lm_sensors/interpreter

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins-contrib.git



More information about the Pkg-nagios-changes mailing list