summaryrefslogtreecommitdiffstats
path: root/contrib/restrict.pl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-02 11:16:24 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-02 11:16:24 (GMT)
commitb15adb7762b6caaecaa83637abfcf5fdb4802092 (patch)
tree64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/restrict.pl
parentc4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff)
downloadmonitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/restrict.pl')
-rwxr-xr-xcontrib/restrict.pl26
1 files changed, 0 insertions, 26 deletions
diff --git a/contrib/restrict.pl b/contrib/restrict.pl
deleted file mode 100755
index 75ea569..0000000
--- a/contrib/restrict.pl
+++ /dev/null
@@ -1,26 +0,0 @@
1#!/usr/bin/perl
2
3eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
4 if 0;
5
6# Set this to your local Nagios plugin path
7my $pluginpath = "/usr/libexec/nagios/plugins/";
8
9# Put all the legal commands (i.e. the commands that are
10# not Nagios checks but are allowed to be executed anyway)
11# in the following associative array.
12my %legal_cmds = ("nc" => "/usr/sbin/nc");
13
14# This will not work on OpenSSH
15# It does work on ssh-1.2.27-1i
16@arg = split ' ',$ENV{'SSH_ORIGINAL_COMMAND'};
17
18$arg[0] =~ s/.*\///; # strip leading path
19$arg[0] =~ tr/-_.a-zA-Z0-9/X/c; # change atypical chars to X
20
21if (!defined ($cmd = $legal_cmds{$arg[0]}))
22{
23 $cmd = $pluginpath . $arg[0];
24}
25
26exec { $cmd } @arg or die "Can't exec $cmd: $!";