# (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999)
# Added user-configurable escalation mechanism
#
-# $Id: spong-network.pl,v 1.46 2003/01/29 22:47:57 sljohnson Exp $
+# $Id: spong-network.pl,v 1.47 2003/05/14 05:49:46 sljohnson Exp $
use Carp;
use lib "@@LIBDIR@@";
use Spong::Status qw(status);
use Spong::Log;
+use List::Compare;
+
# Check to see if the Time::HiRes module is available
eval { require Time::HiRes; import Time::HiRes qw(time); };
if (! $@ ) { $hires = 1; } else { $hires = 0; };
# Fallback, if we didn't read things correctly...
- if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) {
- @HOSTS_LIST = sort keys %HOSTS; }
+ my $lc = List::Compare->new( \@HOSTS_LIST, \@{[keys %HOSTS]} );
+
+ if( ! $lc->is_LequivalentR ) { @HOSTS_LIST = sort keys %HOSTS; }
&debug( "host file loaded" );
}
# There are one or more update processes that listen for status updates
# from client programs.
-# $Id: spong-server.pl,v 1.57 2003/05/14 03:47:13 sljohnson Exp $
+# $Id: spong-server.pl,v 1.58 2003/05/14 05:49:46 sljohnson Exp $
use lib "@@LIBDIR@@";
use Spong::HostGroups;
use Spong::ConfigFile;
+use List::Compare;
+
use Sys::Hostname;
use File::Path;
use Socket;
eval $evalme || die "Invalid spong.hosts file: $@";
# Fallback, if we didn't read things correctly...
-
- if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) {
- @HOSTS_LIST = sort keys %HOSTS; }
+ my $lc = List::Compare->new( \@HOSTS_LIST, \@{[keys %HOSTS]} );
+ if( ! $lc->is_LequivalentR ) { @HOSTS_LIST = sort keys %HOSTS; }
# Do the same thing for the groups file.
close( GROUPS );
eval $evalme || die "Invalid spong.groups file: $@";
- if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) {
- @GROUPS_LIST = sort keys %GROUPS; }
+ $lc = List::Compare->new( \@GROUPS_LIST, \@{[keys %GROUPS]} );
+ if( ! $lc->is_LequivalentR ) { @GROUPS_LIST = sort keys %GROUPS; }
}
# (3) Re-did as a client which gets info from the spong-server (07/24/1997)
# (4) Did a whole bunch of stuff (Ed Hill, 06/18/1998)
+use lib "@@LIBDIR@@";
+
use Sys::Hostname;
use Getopt::Long;
use Socket;
use POSIX;
+use List::Compare;
+
# Load our configuration variables, including the user specified configuration
# information (spong.conf, spong.hosts, and spong.groups files).
eval $evalme || die "Invalid spong.hosts file: $@";
# Fallback, if we didn't read things correctly...
+ my $lc = List::Compare->new( \@HOSTS_LIST, \@{[keys %HOSTS]} );
+ if( ! $lc->is_LequivalentR ) { @HOSTS_LIST = sort keys %HOSTS; }
- if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) {
- @HOSTS_LIST = sort keys %HOSTS; }
# Do the same thing for the groups file.
close( GROUPS );
eval $evalme || die "Invalid spong.groups file: $@";
- if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) {
- @GROUPS_LIST = sort keys %GROUPS; }
+ $lc = List::Compare->new( \@GROUPS_LIST, \@{[keys %GROUPS]} );
+ if( ! $lc->is_LequivalentR ) { @GROUPS_LIST = sort keys %GROUPS; }
}
# (3) Re-did as a client which gets info from the spong-server (07/24/1997)
# (4) Did a whole bunch of stuff (Ed Hill, 06/18/1998)
#
-# $Id: www-spong.pl,v 1.21 2003/01/29 23:00:12 sljohnson Exp $
+# $Id: www-spong.pl,v 1.22 2003/05/14 05:49:46 sljohnson Exp $
+
+use lib "@@@LIBDIR@@";
use Sys::Hostname;
use Getopt::Long;
use Socket;
use POSIX;
+use List::Compare;
+
# Load our configuration variables, including the user specified configuration
# information (spong.conf, spong.hosts, and spong.groups files).
eval $evalme || die "Invalid spong.hosts file: $@";
# Fallback, if we didn't read things correctly...
+ my $lc = List::Compare->new( \@HOSTS_LIST, \@{[keys %HOSTS]} );
+ if( ! $lc->is_LequivalentR ) { @HOSTS_LIST = sort keys %HOSTS; }
- if( sort ( @HOSTS_LIST ) != sort ( keys %HOSTS ) ) {
- @HOSTS_LIST = sort keys %HOSTS; }
-
# Do the same thing for the groups file.
$evalme = "";
close( GROUPS );
eval $evalme || die "Invalid spong.groups file: $@";
- if( sort ( @GROUPS_LIST ) != sort ( keys %GROUPS ) ) {
- @GROUPS_LIST = sort keys %GROUPS; }
+ $lc = List::Compare->new( \@GROUPS_LIST, \@{[keys %GROUPS]} );
+ if( ! $lc->is_LequivalentR ) { @GROUPS_LIST = sort keys %GROUPS; }
+
}