diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
| commit | b15adb7762b6caaecaa83637abfcf5fdb4802092 (patch) | |
| tree | 64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/restrict.pl | |
| parent | c4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff) | |
| download | monitoring-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-x | contrib/restrict.pl | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/contrib/restrict.pl b/contrib/restrict.pl deleted file mode 100755 index 75ea5698..00000000 --- a/contrib/restrict.pl +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' | ||
| 4 | if 0; | ||
| 5 | |||
| 6 | # Set this to your local Nagios plugin path | ||
| 7 | my $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. | ||
| 12 | my %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 | |||
| 21 | if (!defined ($cmd = $legal_cmds{$arg[0]})) | ||
| 22 | { | ||
| 23 | $cmd = $pluginpath . $arg[0]; | ||
| 24 | } | ||
| 25 | |||
| 26 | exec { $cmd } @arg or die "Can't exec $cmd: $!"; | ||
