diff options
author | edwin <edwin@FreeBSD.org> | 2003-01-17 21:47:59 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2003-01-17 21:47:59 +0800 |
commit | f56c063f6ff39b5e5406e9935a5b22f53bd91280 (patch) | |
tree | 7f58151c2d1bf24ffd36f8e92ab206ae09b259a7 /net-mgmt/nrpep | |
parent | 6da43adb575947ef0efb9cdaa3c994d23bf91351 (diff) | |
download | freebsd-ports-gnome-f56c063f6ff39b5e5406e9935a5b22f53bd91280.tar.gz freebsd-ports-gnome-f56c063f6ff39b5e5406e9935a5b22f53bd91280.tar.zst freebsd-ports-gnome-f56c063f6ff39b5e5406e9935a5b22f53bd91280.zip |
New port: net/nrpep
New port for the Netsaint Remote Plugin Executor (Perl)
PR: ports/37185
Submitted by: Jon Wilson <jon@netcraft.com>
Diffstat (limited to 'net-mgmt/nrpep')
-rw-r--r-- | net-mgmt/nrpep/Makefile | 23 | ||||
-rw-r--r-- | net-mgmt/nrpep/distinfo | 1 | ||||
-rw-r--r-- | net-mgmt/nrpep/files/patch-aa | 113 | ||||
-rw-r--r-- | net-mgmt/nrpep/files/patch-ab | 99 | ||||
-rw-r--r-- | net-mgmt/nrpep/files/patch-ac | 11 | ||||
-rw-r--r-- | net-mgmt/nrpep/pkg-comment | 1 | ||||
-rw-r--r-- | net-mgmt/nrpep/pkg-descr | 10 | ||||
-rw-r--r-- | net-mgmt/nrpep/pkg-message | 17 | ||||
-rw-r--r-- | net-mgmt/nrpep/pkg-plist | 8 |
9 files changed, 283 insertions, 0 deletions
diff --git a/net-mgmt/nrpep/Makefile b/net-mgmt/nrpep/Makefile new file mode 100644 index 000000000000..60e2b61790d6 --- /dev/null +++ b/net-mgmt/nrpep/Makefile @@ -0,0 +1,23 @@ +# New ports collection makefile for: nrpep +# Date created: 10 April 2002 +# Whom: jon@netcraft.com +# +# $FreeBSD$ + +PORTNAME= nrpep +PORTVERSION= 0.2 +CATEGORIES= net +MASTER_SITES= http://www.netsaint.org/download/contrib/addons/ + +MAINTAINER= jon@netcraft.com + +# Note that this port depends on neither netsaint-plugins OR netsaint, because it +# installs both a client and a server, and so could need EITHER. Bummer. +RUN_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/5.005/Crypt/TripleDES.pm:${PORTSDIR}/security/p5-Crypt-TripleDES + +USE_PERL5_RUN= yes + +post-install: + ${CAT} pkg-message + +.include <bsd.port.mk> diff --git a/net-mgmt/nrpep/distinfo b/net-mgmt/nrpep/distinfo new file mode 100644 index 000000000000..de897e4f62b5 --- /dev/null +++ b/net-mgmt/nrpep/distinfo @@ -0,0 +1 @@ +MD5 (nrpep-0.2.tar.gz) = 6c84144892b0d552b65dd007ff8fc787 diff --git a/net-mgmt/nrpep/files/patch-aa b/net-mgmt/nrpep/files/patch-aa new file mode 100644 index 000000000000..a72ea0d7143b --- /dev/null +++ b/net-mgmt/nrpep/files/patch-aa @@ -0,0 +1,113 @@ +--- nrpep.bak Sat Jan 8 01:00:45 2000 ++++ nrpep Wed Apr 10 16:50:09 2002 +@@ -13,24 +13,39 @@ + + # Perl libs and such the program needs + use strict; +-use vars qw($opt_c $version %commands $key $cipher); ++use vars qw($opt_d $opt_c $version %commands $key $cipher); + use Getopt::Std; + use Crypt::TripleDES; + + # Global Variables +-$version = "0.2"; ++$version = "0.2-fbsd"; + + # Get the command line arguments +-getopts('c:'); ++getopts('d:c:'); ++ ++# Open a log ++if ($opt_d) { ++ open(LOG,">>$opt_d") or die "Cannot open $opt_d for logging"; ++ print LOG "\n\nNRPEP\n"; ++} ++ + # Check for the proper command line arguments, if we fail, print out an + # error message and die. + &Check_Command($opt_c); ++ + # Grab the configuration file, and parse it for all the variables we + # will need. +-&Get_Configs($opt_c); ++%commands = Get_Configs($opt_c); ++if ($opt_d) {print LOG Dumper(%commands);} ++ + # Now that I have a set of commands, go into recieve mode + &Recieve; + ++$opt_d && close(LOG); ++exit 0; ++ ++###################################################################################### ++ + sub Recieve { + my $line; + my $commandentered; +@@ -49,8 +64,10 @@ + $_ =~ s/(\r|\n)//g; + # Start a new cipher with the proper key; + $cipher = new Crypt::TripleDES; +-# Decrypt the command ++# Decrypt the command ++ $opt_d && print LOG "Decrypting $_\n"; + $commandentered = $cipher->decrypt3(pack("H*", $_), $key); ++ $opt_d && print LOG " ... got $commandentered\n"; + $commandentered =~ s/\s+$//; + # If the command entered looks like one in the config file, execute it and + # print it's return code +@@ -72,6 +89,8 @@ + } + } + ++################################################################################# ++ + sub Check_Command { + # If I don't have a config file given, barf the mini-howto + unless ($opt_c) { +@@ -89,30 +108,31 @@ + } + } + ++################################################################################### ++ + sub Get_Configs { + my $opt_c = $_[0]; +- my $line; +- my $command; +- my $plugin; +- my $garbage; ++ ++ my %commands; + + # Open the config file... + open(FILE, "$opt_c") || die "Cannot open file at $opt_c"; +- foreach $line (<FILE>) { ++ foreach my $line (<FILE>) { + chomp($line); +-# Ignore comments +- unless ($line =~ /^#/) { ++# Ignore comments and blank lines ++ unless ($line =~ /^#/ or $line =~ /^\s*$/) { + # If it's a command line, grab the command name and toss it in a name value + # hash. The value is the command to execute. +- if ($line =~ /command\[.*\]=/) { +- ($garbage, $plugin) = split(/\=/, $line); +- ($garbage, $garbage, $command) = split(/(\[|\])/, $line); ++ if (my ($command,$plugin) = $line =~ /^\s*command\[(.+)\]=(.*)$/) { + $commands{$command} = $plugin; ++ $opt_d && print LOG "Got command '$command' = $plugin\n"; + # If it's the secret, we want it! +- } elsif ($line =~ /secret=/) { +- ($garbage, $key) = split(/\=/, $line, 2); ++ } elsif ($line =~ /secret=(.+)/) { ++ $key = $1; + } + } + } + close(FILE); ++ ++ return %commands; + } + + diff --git a/net-mgmt/nrpep/files/patch-ab b/net-mgmt/nrpep/files/patch-ab new file mode 100644 index 000000000000..d8a0da71decf --- /dev/null +++ b/net-mgmt/nrpep/files/patch-ab @@ -0,0 +1,99 @@ +--- Makefile.orig Wed Jan 5 23:04:22 2000 ++++ Makefile Wed Apr 10 18:24:16 2002 +@@ -3,50 +3,57 @@ + # + + # +-# Configuration Files ++# Configuration Files + # + + # + # What directory the server program (nrpep) should live in + # +-nrpepserverdir = "/usr/sbin" ++nrpepserverdir = $(PREFIX)/sbin + + # + # What directory the plugin client should live in + # +-nrpepplugindir = "/usr/local/netsaint/libexec" ++nrpepplugindir = $(PREFIX)/libexec/netsaint + + # + # What user should own nrpep + # +-nrpepowner = "root" ++nrpepowner = root + + # + # What group should own nrpep + # +-nrpepgroup = "root" ++nrpepgroup = wheel + + # + # What user should own check_nrpep + # +-checknrpepowner = "netsaint" ++checknrpepowner = root + + # + # What group should own check_nrpep + # +-checknrpepgroup = "netsaint" ++checknrpepgroup = wheel + + # + # What directory should the nrpep config files go to + # +-nrpepconfigdir = "/usr/local/netsaint/etc" ++nrpepconfigdir = $(PREFIX)/etc/netsaint + + # *************************************** + # DO NOT CHANGE ANYTHING BELOW THIS POINT + # *************************************** + + all: +- cat README | more ++ mv nrpep.cfg nrpep.cfg.orig ++ cat nrpep.cfg.orig | sed -e 's%/usr/local/netsaint/libexec%$(PREFIX)/libexec/netsaint%' > nrpep.cfg ++ ++install: install-client install-server ++ if [ ! -d "$(PREFIX)/share/doc/nrpep" ]; then \ ++ mkdir -p $(PREFIX)/share/doc/nrpep; \ ++ fi ++ cp README $(PREFIX)/share/doc/nrpep + + install-client: + `if [ ! -d "$(nrpepplugindir)" ]; then \ +@@ -55,8 +62,8 @@ + `if [ ! -d "$(nrpepconfigdir)" ]; then \ + mkdir -p $(nrpepconfigdir); \ + fi` +- install -b -D -g $(checknrpepgroup) -o $(checknrpepowner) -m 755 check_nrpep $(nrpepplugindir); +- install -b -D -g $(checknrpepgroup) -o $(checknrpepowner) -m 644 check_nrpep.cfg $(nrpepconfigdir); ++ install -g $(checknrpepgroup) -o $(checknrpepowner) -m 755 check_nrpep $(nrpepplugindir); ++ install -g $(checknrpepgroup) -o $(checknrpepowner) -m 644 check_nrpep.cfg $(nrpepconfigdir); + + install-server: + `if [ ! -d "$(nrpepserverdir)" ]; then \ +@@ -65,8 +72,8 @@ + `if [ ! -d "$(nrpepconfigdir)" ]; then \ + mkdir -p $(nrpepconfigdir); \ + fi` +- install -b -D -g $(nrpepgroup) -o $(nrpepowner) -m 755 nrpep $(nrpepserverdir); +- install -b -D -g $(nrpepgroup) -o $(nrpepowner) -m 644 nrpep.cfg $(nrpepconfigdir); ++ install -g $(nrpepgroup) -o $(nrpepowner) -m 755 nrpep $(nrpepserverdir); ++ install -g $(nrpepgroup) -o $(nrpepowner) -m 644 nrpep.cfg $(nrpepconfigdir); + + uninstall-client: + rm $(nrpepplugindir)/check_nrpep +@@ -75,3 +82,7 @@ + uninstall-server: + rm $(nrpepserverdir)/nrpep + rm $(nrpepconfigdir)/nrpep.cfg ++ ++ ++ ++ diff --git a/net-mgmt/nrpep/files/patch-ac b/net-mgmt/nrpep/files/patch-ac new file mode 100644 index 000000000000..e89895349f03 --- /dev/null +++ b/net-mgmt/nrpep/files/patch-ac @@ -0,0 +1,11 @@ +--- check_nrpep.old Tue Apr 2 16:52:01 2002 ++++ check_nrpep Wed Apr 10 17:31:09 2002 +@@ -59,7 +59,7 @@ + if ($opts{'f'}) { + &Get_Configs($opts{'f'}); + } else { +- &Get_Configs("/usr/local/netsaint/etc/check_nrpep.cfg"); ++ &Get_Configs("/usr/local/etc/netsaint/check_nrpep.cfg"); + } + # Longer timeout? If it's given on the command line use it, otherwise + # read from the config file diff --git a/net-mgmt/nrpep/pkg-comment b/net-mgmt/nrpep/pkg-comment new file mode 100644 index 000000000000..98dd65dc1c6c --- /dev/null +++ b/net-mgmt/nrpep/pkg-comment @@ -0,0 +1 @@ +A netsaint addon for running plugins on remote hosts diff --git a/net-mgmt/nrpep/pkg-descr b/net-mgmt/nrpep/pkg-descr new file mode 100644 index 000000000000..b51726e1334b --- /dev/null +++ b/net-mgmt/nrpep/pkg-descr @@ -0,0 +1,10 @@ +This addon was designed as a replacemnt for the netsaint_statd and +nrpe addons. Although this addon is similiar in function to nrpe, it +is written in Perl and implements TripleDES encryption for the data in +transit. It is also designed to run under inetd and make use of the +TCP Wrappers package for access control. + +WWW: www.netsaint.org + +- Jon +jon@netcraft.com diff --git a/net-mgmt/nrpep/pkg-message b/net-mgmt/nrpep/pkg-message new file mode 100644 index 000000000000..a67a4c7aceba --- /dev/null +++ b/net-mgmt/nrpep/pkg-message @@ -0,0 +1,17 @@ +############################################################### + +If you are going to be running the nrpep daemon on this machine, +you will probably want something like the following in /etc/services: + + nrpep 8086/tcp # Netsaint nrpep server + +and the following in /etc/inetd.conf: + + nrpep stream tcp nowait nobody /usr/local/sbin/nrpep nrpep -c /usr/local/etc/netsaint/nrpep.cfg + +The config files are world readable. If this is a problem for you, +then sort out the file ownership and permissions yourself. + +Additional documentation in $PREFIX/share/doc/nrpep + +############################################################### diff --git a/net-mgmt/nrpep/pkg-plist b/net-mgmt/nrpep/pkg-plist new file mode 100644 index 000000000000..f480a40ce910 --- /dev/null +++ b/net-mgmt/nrpep/pkg-plist @@ -0,0 +1,8 @@ +sbin/nrpep +etc/netsaint/nrpep.cfg +libexec/netsaint/check_nrpep +etc/netsaint/check_nrpep.cfg +share/doc/nrpep/README +@dirrm share/doc/nrpep +@unexec rmdir %D/libexec/netsaint 2>/dev/null || true +@unexec rmdir %D/etc/netsaint 2>/dev/null || true |