From 0ee08563c5f4a7eba7151539211a732d943ab291 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:34:14 +0200 Subject: Add dynamic path to snmpget to perl utils diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in index 386831e..c84769f 100644 --- a/plugins-scripts/utils.pm.in +++ b/plugins-scripts/utils.pm.in @@ -23,6 +23,7 @@ $PATH_TO_LMSTAT = "@PATH_TO_LMSTAT@" ; $PATH_TO_SMBCLIENT = "@PATH_TO_SMBCLIENT@" ; $PATH_TO_MAILQ = "@PATH_TO_MAILQ@"; $PATH_TO_QMAIL_QSTAT = "@PATH_TO_QMAIL_QSTAT@"; +$PATH_TO_SNMPGET = "@PATH_TO_SNMPGET@"; ## common variables $TIMEOUT = 15; -- cgit v0.10-9-g596f From 4b58104107a9287556db78204ed9c5b10bc88bdc Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:37:34 +0200 Subject: Use compile time determined path to snmpget in check_wave diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index 41e15f5..663a83d 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl @@ -50,34 +50,34 @@ my $critical = $1 if ($opt_c =~ /([0-9]+)/); ($opt_w) || ($opt_w = shift) || ($opt_w = 60); my $warning = $1 if ($opt_w =~ /([0-9]+)/); -$low1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; +$low1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; @test = split(/ /,$low1); $low1 = $test[2]; -$med1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; +$med1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; @test = split(/ /,$med1); $med1 = $test[2]; -$high1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; +$high1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; @test = split(/ /,$high1); $high1 = $test[2]; sleep(2); -$snr = `snmpget $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`; +$snr = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`; @test = split(/ /,$snr); $snr = $test[2]; $snr = int($snr*25); -$low2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; +$low2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`; @test = split(/ /,$low2); $low2 = $test[2]; -$med2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; +$med2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`; @test = split(/ /,$med2); $med2 = $test[2]; -$high2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; +$high2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`; @test = split(/ /,$high2); $high2 = $test[2]; -- cgit v0.10-9-g596f From 42f593c5f2ec18ec435d56d5ba29d9317afdf6b4 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 7 Sep 2023 20:56:15 +0200 Subject: check_breeze, check_wave, unset CDPATH env var diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl index 05b9920..531625c 100755 --- a/plugins-scripts/check_breeze.pl +++ b/plugins-scripts/check_breeze.pl @@ -14,8 +14,9 @@ sub print_help (); sub print_usage (); $ENV{'PATH'}='@TRUSTED_PATH@'; -$ENV{'BASH_ENV'}=''; +$ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; +$ENV{'CDPATH'}=''; Getopt::Long::Configure('bundling'); GetOptions diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index 663a83d..c24015c 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl @@ -19,6 +19,7 @@ sub print_usage (); $ENV{'PATH'}='@TRUSTED_PATH@'; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; +$ENV{'CDPATH'}=''; Getopt::Long::Configure('bundling'); GetOptions -- cgit v0.10-9-g596f