Commit 84a2ebd9 authored by John Ferlito's avatar John Ferlito

Imported Upstream version 1.3.6p1

parents
*
* The nfdump project is distributed under the BSD license:
*
* Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of SWITCH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
2012-01-29 1.3.6p1
- Fix UNIVERSAL->import warning for new Perl 5.12
- Fix sem* bugs. semaphore moved into Nfsem - initial installation broken
- Fix IPv6 lookups
- Fix lookups of IPs in ICMP listing
- Add default values lifetime/maxsize for new profile - safty measure.
- Add experimental interrupted expire ( only with nfdump patch or nfdump > 1.6.5 )
2011-07-20 1.3.6
- Fix potential XSS bugs
- Fix email address validation in alerting. also allow ..@localhost
- Add option 'all' in rebuild command to rebuild graphs
- Extend lookup box to 400px
- Add missing stat option from v9 into details.php
- Extend too short limits from textareas from 50 to 10240
- Add a total display at the bottom of the statistics table in details.php
- Replace depricated split functions in php code
- Replace IP lookup code with new AbuseWhois
2010-07-24 1.3.5 stable version - bugfix release of nfsen-1.3.4
- fix broken reconfig, when adding new sources
- inherit 'live' channel parameters for new 1:1 profile
2010-07-03 1.3.4 stable version - bugfix release of nfsen-1.3.3
- fix installer problems with Module File::Copy make_path/mkpath
- fix optarg bug in NfSenRC.pm
- Add bigger scales in details page
- Allow rrd version 1.4.x
2010-05-01 1.3.3 stable version
- Honour profile maxsize and max lifetime while building
Abort build when either limit is reached
- Add cancal button while building a profile
- Add delayed deleting profile. Prevent annoying message
"Can not delete profile while periodic update in progress"
- Add FORMATDIR to config. Defaults to $VARDIR/fmt
- Add FILTERDIR to config. Defaults to $VARDIR/filters
- Add PIDDIR to config. Defaults to $VARDIR/run
- Add INSTALLPATH to installer
- Fix Safari 4 Lookup box issues
- Fix several small bugs/issues
2009-06-08 1.3.2 stable release
- Fix security bug - potential remote execution
2009-13-03 1.3.1 stable release
- fixing bugs from 1.3
- Add support for RRD 1.3.x
- Add parallel profiling patch
2007-11-20 1.3 stable release
- Fix bugs from last 1.3b
- Add compression configuration for nfdump-1.5.6. See nfsen-dist.conf
2007-08-24 1.3b-20070824
- Bug fixes from 1.3b-20070719
- Try to better handle Solaris Syslog
- Make install smooth on Solaris
2007-07-19 1.3b-20070719
- Release beta 1.3 for testing.
- Number of bug fixes of last snapshot
- Make nfsen clean up orphan data files when starting up.
- Make some changes in default behaviour of netflow processing. Defaults to Top 10 any IP
2007-03-06 snapshot-20070306
- Add alerting module: NfAlert.pm, alerting.php, alerting.css alerting.js
- Add shadow profiles.
- Include bug fixes from last snapshot: feedback from users
2007-01-26 snapshot-20070126
- Replace pluging END routine by Cleanup due to errornous calling at the end of the comm server process
- Make Opera work. minor change for in arg parsing
- Fix bug for IPv6 filter checks
- Fix some other small bugs reported back.
2007-01-10 snapshot-20070110
- Intermediate snapshot for developers - not for production
- Major change: Add channel based architecture
- Lots of face liftings for NfSen
2006-07-28 snapshot-20060412
- Add sub directory hierarchy support
- Add PROFILEDATADIR disk space check
- Fix various small bugs in snapshot-20060412
2006-04-12 snapshot-20060412
- Fix bug in profile rebuilder for new style profiles.
2006-04-07 snapshot-20060407
- Cleanups reported bugs from snapshot-20060325
- Remove all direct nfsen/nfdump system calls from web frontend. use socket server instead.
- Fix installation problem on Solaris 9/10 Sigh ..
- Add 'type' to source definition, to make nfsen. sflow aware
- Add nfsend socket server. Web server does not need to call nfsen command line directly
2006-03-25 snapshot-20060325
Cleanups for snapshot
2006-02-15
- More flexible source handling: Add add/delete netflow source option
on a running system. cmd line nfsen understands now 'nfsen reconfig'
- re-arrange RRD DBs: RRDs are now source based and no longer type based.
installer process needs to convert from old to new style layout.
this conversion is a nightmare, but the price for the old design ...
- fork off development tree
2006-02-11 v1.2.4
- Add IPv4 in processiing form for flow listings.
2006-01-12 v1.2.3
- Update processing form in details page to enable more nfdump 1.5
features and IPv6 output formats. Quick fix till next version becomes ready.
2006-01-03 v1.2.2
- Update NfSen to run with nfdump 1.5 tools.
2005-09-11 v1.2.1
- Bug fixed in install.pl: permission problem fixed.
Sigh .. always permissions ...
- Bug fixed in install.pl: Initial installation may lock live profile, due to
possible time overlap of installation and first run or Periodic.
- Update details tab to make use of nfdump 1.4 'order by' options.
nfdump 1.4 required now.
2005-08-31 v1.2
- New flexible directory layout.
- Change 'bytes' to 'traffic' and display bits/s instead of bytes/s.
- Add frontend plugins.
- Switch between sum and rate in the stat data display.
- Add various buttons to the processing tab for more easy working.
- A lot of small changes to make NfSen run on many *nix without changes
- Can work with rrdtool v.1.2.x
- Add peak search to position cursor in details graph
- Fix a few minor bugs.
- Have NfSen to deal better with disk full events.
- Add -X option to nfsen cmd line command to expire the profile right now.
2005-04-21 v 1.1
- Fixed some minor code html bugs
- Add php function file_get_contents to be compatible with
php version < 4.3
- Add line/stacked graph radio buttons in detailed view
- Fixed several minor bugs.
2005-03-31 v 1.1rc3
- Install privileges fixed.
- Updated docu.
2005-03-29 v 1.1rc2
- bug fix in install routine.
- correct spelling errors
2005-03-23 v 1.1rc1
First public version.
2005-02-21 v 1.0b
Internal testing version
Quick Notes:
============
This is version 1.3.6p1 of NfSen. At least nfdump 1.6.x,
or later is required! Do not use any earlier nfdump version.
Make sure you have nfdump configured with option --enable-nfprofile
If this is a new install and you want to have PortTracker installed
you need at least nfdump-1.6.5.
Upgrade is supported only for NfSen versions v1.2.x.
older NfSen versions need to be upgraded in a first step to NfSen 1.2.4.
What is NfSen:
=============
NfSen is a graphical WEB based front end for the nfdump netflow tools.
See <http://nfdump.sourceforge.net>
With NfSen, you can:
- Display your netflow data from many sources: Flows, Packets and Bytes.
- Easily navigate through the netflow data.
- Process the netflow data within the specified time span.
- Create history as well as continuous profiles.
- Set alerts based on various conditions.
- Write your own plug-ins to process and display netflow data on a regular
interval.
NfSen allows you to keep all the convenient advantages of the command
line using nfdump directly and gives you also a graphical overview over
your netflow data.
A more detailed documentation is available in the doc directory.
NfSen is distributed under the BSD license - see BSD-license.txt
Installation:
-------------
1. Prerequisites:
- PHP and Perl:
NfSen is written in PHP and Perl and should run on any *NIX system.
At least Perl 5.6.0 and PHP > 4.1 with PHP socket extension is required.
NfSen also works with PHP 5 and apache 2.
Perl modules: Mail::Header and Mail::Internet. Install these Perl modules
prior to installing NfSen.
- RRDtools
NfSen requires the RRD tools v1.0.x or > 1.2.11, at least the RRDs Perl
Module.
- nfdump tools
Make sure you have at least version 1.6.1 installed on your system.
Do not use any older nfdump version!
Make sure you have nfdump configured with option --enable-nfprofile
You can download nfdump from sourceforge nfdump.sourceforge.net.
Please note: Each netflow source requires a semaphore in the global
system table. If you have lots of different sources, check the system
documentation about the max number of semaphores, or how to increase the
this number respectively.
NfSen has a very flexible directory layout. To simplify matters,
the default layout stores everything but the html pages under BASEDIR.
However, you may configure NfSen to fit your local needs.
See the nfsen-dist.conf config file. The netflow data is stored
under PROFILEDATADIR ( BASEDIR/profiles by default ). So make sure you have
enough disk space.
To update your current NfSen installation goto point 3.
2. First installation of NfSen:
If you have installed all prerequisites, change to the etc directory and
copy the NfSen config file nfsen-dist.conf to nfsen.conf. Edit nfsen.conf
according your needs and setup. Make sure you have set the right values
for the netflow sources. For any netflow source, make an entry in the
%sources hash. The comments in nfsen.conf should guide you. When you
are done, run the install.pl script in the distribution directory:
./install.pl etc/nfsen.conf
Running install.pl will:
- Create the NfSen environment with all required directories.
- Copy the php/html files into HTMLDIR.
- Create the live profile.
- Prepares the RRD DBs for the live profile.
After the installation, you will find the nfsen.conf file in CONFDIR.
3. Update your current NfSen installation:
Upgrade is supported only for NfSen v1.2.x. Any NfSen 1.1.x installations should
be upgraded in a first step to NfSen 1.2.4.
If you upgrade from any previous NfSen installation, make sure you have
upgraded nfdump to version 1.5.5 according to this README file.
To upgrade your 1.2.x NfSen installation:
1. Stop old nfsen, due to nfprofile incompatibilities.
./nfsen.rc stop
2. Upgrade nfdump to stable 1.6.1. Do not forget to configure nfdump
with --enable-nfprofile option.
This update is required!
3. Upgrade NfSen:
./install.pl <path/to/your/nfsen/etc/nfsen.conf>
This will update your current NfSen installation. and
you're done.
4. If you have plugins installed, check the README.plugins file for some
small changes required to be changed for each plugin.
If you have PortTracker installed, you need to update to the PortTracker
version included in the contrib directory, coming with NfSen. You need
not to rebuild your current db files, just rebuild nftrack and replace
the plugin files. See the INSTALL file.
5. Start NfSen:
BINDIR/nfsen start
When updating from a newer snapshot ( > snapshot-20070110 ) or from early 1.3b
releases the normal update procedure will do:
./install.pl <path/to/your/nfsen/etc/nfsen.conf>
BINDIR/nfsen reload
4. NfSen is now ready to use.
You may want to link the start/stop file BASEDIR/bin/nfsen.rc into your
appropriate rc.d directory. Start NfSen:
BINDIR/nfsen start
Point your web browser to nfsen.php.
( Typically http://yourserver/nfsen/nfsen.php )
Notes for Solaris users:
------------------------
To make syslog work for NfSen set the appropriate parameter in nfsen.conf.
See nfsen-dist.conf for the logging socket parameter.
The Sys::Syslog perl Module on Solaris 10 is badly broken. You may want
to upgrade Sys::Syslog to the latest available on CPAN.
Notes on sub directory hierarchy support:
-----------------------------------------
As of snapshot 20060728 nfsen supports the sub directory hierarchy of nfdump.
When installing or upgrading NfSen, the layout is set to '0' ( see nfcapd(1) ),
which means no layout. If you want to make use of any sub hierarchy layout,
add '$SUBDIRLAYOUT = <num>;' to the nfsen.conf file. See nfsen-dist.conf for
more information. After changing the layout, run RebuildHierarchy.pl.
in $BINDIR to reorganize the data files to the new layout. Changing the layout
is possible at any other time later on. However, you must run
RebuildHierarchy.pl after changing $SUBDIRLAYOUT the config file.
Note: This process will stop NfSen, as the upgrade requires a silent system.
More information about NfSen as well as working with NfSen is available in
the documentation provided in the doc directory.
NfSen Plugins
=============
A detailed plugin guide is available in the doc directory. However,
to upgrade your current plugins, follow the procedure below:
Plugins of Nfsen version < snapshot-20070110 will be recognized as so called
legacy plugins, and will work with only little modifications:
Frontend Plugins:
Replace all notification Messages in your plugin:
Instead of directly setting the message with
$_SESSION['error'] = '.. ';
use the new provided function
SetMessage('error', "...");
The same is true for 'warning', 'alert' and 'info'
Backend Plugins:
Your plugins will continue to work unless you make access to profile
information such as NfSen::ReadProfile.
All Profile functions have been moved from NfSen module to NfProfile. So you
need to replace calls such es NfSen::ReadProfile(..) to NfProfile::ReadProfile
When accessing profile data, a legacy plugin runs correctly only, when the profile
is not in a subgroup. To access the profilegroup, add another parameter to your run
function:
sub run {
my $name = shift;
my $timeslot = shift;
# add here group parameter
my $profilegroup = shift;
You may also add the $profilegroup parameter to the ReadProfile(..) function in order
to access plugin information in a subgroup
** IMPORTANT **
Replace the default sub END in the plugin by sub Cleanup. This is required as otherwise
Perl will call the standard END block, every time a comm service server exits. This
could cause unexpected results.
If you are interessted in more details, have a look at the demoplugin.pm in the plugin
directory and look into the Plugin Writers guide in the doc dir.
#!%%PERL%% -w
#
#
# Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of SWITCH nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# $Author: peter $
#
# $Id: RebuildHierarchy.pl 27 2011-12-29 12:53:29Z peter $
#
# $LastChangedRevision: 27 $
require 5.6.0;
use strict;
use File::Find;
use POSIX qw(strftime);
use Time::Local;
######################################
#
# Configuration:
# The only parameter to set:
use lib "%%LIBEXECDIR%%";
#
######################################
use NfSen;
use NfProfile;
use NfSenRC;
my $profiledir;
my $source;
my ($uid, $gid);
sub ValidISO {
my $time = shift;
# strinp '-' chars
$time =~ s/\-//g;
# any non - number char is invalid
return 0 if $time =~ /[^\d]+/;
# outside required timeframe
return 0 if $time < 197001010000 || $time > 203801191414;
return 1;
} # End of ValidISO
# Convert a an ISO time value into UNIX format
sub ISO2UNIX {
my $isotime = shift;
if ( !ValidISO($isotime) ) {
return 0;
}
$isotime =~ s/\-//g; # allow '-' to structur time string
# 2004 02 13 12 45 /
my $sec = 0;
my ( $year, $mon, $mday, $hour, $min ) = $isotime =~ /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/;
$mon--;
# round down to nearest 5 min slot
my $diff = $min % 5;
if ( $diff ) {
$min -= $diff;
}
my $unixtime = Time::Local::timelocal($sec,$min,$hour,$mday,$mon,$year);
return $unixtime;
} # End of ISO2UNIX
sub CreateSubdirHierarchy {
my $t = shift; # UNIX time format
my $channel = shift;
my $layout = $NfConf::SUBDIRLAYOUT;
if ( !defined $layout || $layout == 0 ) {
return '';
}
my @subdir_def = (
"",
"%Y/%m/%d",
"%Y/%m/%d/%H",
"%Y/%W/%u",
"%Y/%W/%u/%H",
"%Y/%j",
"%Y/%j/%H",
"%F",
"%F/%H"
);
if ( $layout > $#subdir_def ) {
return undef;
}
my $subdirs = strftime $subdir_def[$layout], localtime($t);
# make sure all required sub directories exist
if ( defined $subdirs && length $subdirs > 0 ) {
if ( ! -d "$channel/$subdirs" ) {
my $path = "$channel";
foreach my $dir ( split /\//, $subdirs ) {
$path = "$path/$dir";
if ( !-d $path ) {
mkdir $path || die "mkdir $path failed: $!. Could not create new sub dir layout";
chmod 0775, $path || die "Can't chmod '$path': $!\n";
chown $uid, $gid, $path || die "Can't chown '$path': $!\n";
}
}
}
} else {
die "strftime failed! Could not create new sub dir layout";
}
return $subdirs;
} # End of SubdirHierarchy
sub wanted {
my $file = $File::Find::name;
my $dir = $File::Find::dir;
# return unless -f $_;
# return unless /^nfcapd\.\d+$/;
if ( -f $_ ) {
#print "FILE: $File::Find::name, NAME: $_\n";
my ($t_iso) = $_ =~ /nfcapd\.(\d+)/;
return unless defined $t_iso;
my $t_unix = ISO2UNIX($t_iso);
my $subdirs = CreateSubdirHierarchy($t_unix, $profiledir);
if ( $File::Find::name ne "$profiledir/$subdirs/$_" ) {
print "$_ => $subdirs/$_ \r";
rename $File::Find::name, "$profiledir/$subdirs/$_" ||
die "rename failed: $!. Could not create new sub dir layout";
} else {
print "$File::Find::name old/new file name identical\r";
}
}
if ( -d $_ ) {
#print "DIR : $File::Find::dir, NAME: $_\n";
rmdir "$File::Find::dir/$_";
}
} #
########################
#
# Main starts here
#
########################
$| = 1; # unbuffered stdout
if ( !NfConf::LoadConfig() ) {
die "$Log::ERROR\n";
}
# need to run as root
if ( !NfSen::root_process() ) {
die "nfsen setup wants to run as root\n";
}
if ( !defined $NfConf::SUBDIRLAYOUT ) {
die "No sub hierachy layout defined in config file\n";
}
my $hints = NfSen::LoadHints();
my $t = time();
my $subdirs = NfSen::SubdirHierarchy($t - ($t % 300));
if ( !defined $subdirs ) {
die "Unknown sub hierarchy layout $NfConf::SUBDIRLAYOUT\n";
}
# get confirmation
print "Current old layout is '$$$hints{'subdirlayout'}'\n";
print "Configured new layout is '$NfConf::SUBDIRLAYOUT'\n";
print "Apply new layout to all NfSen profiles:\n";
my @AllProfileGroups = NfProfile::ProfileGroups();
foreach my $profilegroup ( @AllProfileGroups ) {
my @AllProfiles = NfProfile::ProfileList($profilegroup);
foreach my $profile ( @AllProfiles ) {
print " => $profilegroup/$profile\n";
}
}
print "This will reorganize all your data files. You may again rebuild your hierarchy any time later\n";
my $ans;
do {
print "Do you want to continue yes/[no] ";
$ans = <stdin>;
chomp $ans;
# Default answer is no
if ( $ans eq '' ) {
$ans = 'no';
}
} while ( $ans !~ /^yes$/i && $ans !~ /^no$/i );
# Exit on answer 'no'
if ( $ans =~ /^no$/i ) {
print "OK - exit $0 - nothing changed.\n";
exit(0);
}
$uid = getpwnam($NfConf::USER);
$gid = getgrnam($NfConf::WWWGROUP);
if ( !defined $uid || !defined $gid ) {
die "Can't get uid/gid from system for $NfConf::USER/$NfConf::WWWGROUP";
}
# go ahead
print "Make sure NfSen is not runnig: shut down NfSen:\n";
NfSenRC::NfSen_stop();
foreach my $profilegroup ( @AllProfileGroups ) {
my @AllProfiles = NfProfile::ProfileList($profilegroup);
foreach my $profile ( @AllProfiles ) {
print "Process profile '$profilegroup/$profile'\n";
my %profileinfo = NfProfile::ReadProfile($profile, $profilegroup);
my $profilepath = NfProfile::ProfilePath($profile, $profilegroup);
if ( $profileinfo{'status'} eq 'empty' ) {
# it's an error reading this profile
print STDERR "Error reading profile '$profilegroup/$profile'";
if ( defined $Log::ERROR ) {
print STDERR ": $Log::ERROR";
}
print STDERR "\n";
die "Abort $0 - Rebuild incomplete. Fix errors and rerun $0\n";
}
my @ProfileSources = keys %{$profileinfo{'channel'}};
foreach $source ( @ProfileSources ) {
print "$source:\n";
$profiledir = "$NfConf::PROFILEDATADIR/$profilepath/$source";
find({ wanted => \&wanted, bydepth => 1 }, $profiledir);
print "\n";
}
print "\n";
}
}
print "All profiles converted.\n";
$$$hints{'subdirlayout'} = $NfConf::SUBDIRLAYOUT;
NfSen::StoreHints();
do {
print "Do you want to start NfSen right now? yes/[no] ";
$ans = <stdin>;
chomp $ans;
# Default answer is no
if ( $ans eq '' ) {
$ans = 'no';
}
} while ( $ans !~ /^yes$/i && $ans !~ /^no$/i );
# Exit on answer 'no'
if ( $ans =~ /^no$/i ) {
print "OK - You need to run '$NfConf::BINDIR/nfsen.rc start' manually\n";
exit(0);
}
NfSenRC::NfSen_start();
This diff is collapsed.
This diff is collapsed.
#!%%PERL%% -w
#
# Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of SWITCH nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# $Author: peter $
#
# $Id: testPlugin 27 2011-12-29 12:53:29Z peter $
#
# $LastChangedRevision: 27 $
use strict;
use Getopt::Std;
use Sys::Syslog;