[pkg-nagios-changes] [Git][nagios-team/pkg-monitoring-plugins][master] 2 commits: Adding d/p/11_check_icmp_source_ip (Closes: #997849)
Jan Wagner (@waja)
gitlab at salsa.debian.org
Sun Jan 30 10:15:07 GMT 2022
Jan Wagner pushed to branch master at Debian Nagios Maintainer Group / pkg-monitoring-plugins
Commits:
3ac1baa9 by Jan Wagner at 2022-01-30T10:52:36+01:00
Adding d/p/11_check_icmp_source_ip (Closes: #997849)
- - - - -
9e925419 by Jan Wagner at 2022-01-30T11:03:02+01:00
d/rules: Fix debhelper compat 12 by using '-a' instead '-s'
- - - - -
3 changed files:
- + debian/patches/11_check_icmp_source_ip
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/patches/11_check_icmp_source_ip
=====================================
@@ -0,0 +1,64 @@
+From 72c51d367e851dc7b6e2f66d89fc118ab72dc356 Mon Sep 17 00:00:00 2001
+From: ghciv6 <ghciv6 at localhost>
+Date: Mon, 20 Dec 2021 22:39:57 +0000
+Subject: [PATCH] - delay set_source_ip() until address_family is detected -
+ add a test to check '-s'
+
+---
+ plugins-root/check_icmp.c | 5 ++++-
+ plugins-root/t/check_icmp.t | 8 +++++++-
+ 2 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
+index 01ae174ad..f97b0ed7e 100644
+--- a/plugins-root/check_icmp.c
++++ b/plugins-root/check_icmp.c
+@@ -410,6 +410,7 @@ main(int argc, char **argv)
+ #ifdef SO_TIMESTAMP
+ int on = 1;
+ #endif
++ char *source_ip = NULL;
+ char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:64";
+
+ setlocale (LC_ALL, "");
+@@ -542,7 +543,7 @@ main(int argc, char **argv)
+ }
+ break;
+ case 's': /* specify source IP address */
+- set_source_ip(optarg);
++ source_ip = optarg;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+@@ -597,6 +598,8 @@ main(int argc, char **argv)
+ sockets |= HAVE_ICMP;
+ else icmp_sockerrno = errno;
+
++ if( source_ip )
++ set_source_ip(source_ip);
+
+ #ifdef SO_TIMESTAMP
+ if(setsockopt(icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)))
+diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t
+index e043d4edd..55edc31b3 100644
+--- a/plugins-root/t/check_icmp.t
++++ b/plugins-root/t/check_icmp.t
+@@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO",
+ "no" );
+
+ if ($allow_sudo eq "yes" or $> == 0) {
+- plan tests => 16;
++ plan tests => 18;
+ } else {
+ plan skip_all => "Need sudo to test check_icmp";
+ }
+@@ -83,3 +83,9 @@ $res = NPTest->testCmd(
+ is( $res->return_code, 2, "One of two host nonresponsive - two required" );
+ like( $res->output, $failureOutput, "Output OK" );
+
++$res = NPTest->testCmd(
++ "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2"
++ );
++is( $res->return_code, 0, "IPv4 source_ip accepted" );
++like( $res->output, $successOutput, "Output OK" );
++
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@
03_epn
# commited upstream
10_check_curl_header
+11_check_icmp_source_ip
=====================================
debian/rules
=====================================
@@ -205,19 +205,19 @@ binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
- dh_testdir -s
- dh_testroot -s
- dh_installchangelogs -p monitoring-plugins-basic -s ChangeLog
+ dh_testdir -a
+ dh_testroot -a
+ dh_installchangelogs -p monitoring-plugins-basic -a ChangeLog
dh_installchangelogs -Nmonitoring-plugins-basic
- dh_installdocs -s
- dh_link -s
- dh_installexamples -s
- dh_installman -s
- dh_strip -s
- dh_compress -s
- dh_fixperms -s -X utils.pm
- dh_installdeb -s
- dh_shlibdeps -s -Nmonitoring-plugins-standard
+ dh_installdocs -a
+ dh_link -a
+ dh_installexamples -a
+ dh_installman -a
+ dh_strip -a
+ dh_compress -a
+ dh_fixperms -a -X utils.pm
+ dh_installdeb -a
+ dh_shlibdeps -a -Nmonitoring-plugins-standard
dpkg-shlibdeps -Tdebian/monitoring-plugins-standard.substvars \
${NP_STD_DIR}/${NP_LIBEXEC}/check_dns
dpkg-shlibdeps -Tdebian/monitoring-plugins-standard.substvars.in \
@@ -225,9 +225,9 @@ binary-arch: build install
grep shlibs:Suggests debian/monitoring-plugins-standard.substvars.in \
| sed -e 's/shlibs:Suggests/shlibs:Recommends/' \
>> debian/monitoring-plugins-standard.substvars
- dh_gencontrol -s
- dh_md5sums -s
- dh_builddeb -s
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-monitoring-plugins/-/compare/1fe8724bfef4d82dde5e4b1402858be680ef689d...9e92541924767e7a213842c547be6ab7be923571
--
View it on GitLab: https://salsa.debian.org/nagios-team/pkg-monitoring-plugins/-/compare/1fe8724bfef4d82dde5e4b1402858be680ef689d...9e92541924767e7a213842c547be6ab7be923571
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20220130/56ec82dd/attachment-0001.htm>
More information about the pkg-nagios-changes
mailing list