Subversion Repositories sysadmin_scripts

Rev

Rev 168 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 168 Rev 169
Line 16... Line 16...
16
 
16
 
17
my $cwd = $FindBin::RealBin;
17
my $cwd = $FindBin::RealBin;
18
my $configFileName = $cwd . '/sync.yaml';
18
my $configFileName = $cwd . '/sync.yaml';
19
my $replicateScript = $cwd . '/replicate';
19
my $replicateScript = $cwd . '/replicate';
20
 
20
 
21
my $TESTING=1;
21
my $TESTING=0;
22
 
22
 
23
my $configuration;
23
my $configuration;
24
   
24
   
25
use Data::Dumper;
25
use Data::Dumper;
26
use Email::Simple; # cpan install Email::Simple
26
use Email::Simple; # cpan install Email::Simple
Line 161... Line 161...
161
my ( $error,$output) = &runCommand( "ping -c 1 -t 5 " . $configuration->{'remoteMachine'}->{'ip'} );
161
my ( $error,$output) = &runCommand( "ping -c 1 -t 5 " . $configuration->{'remoteMachine'}->{'ip'} );
162
$configuration->{'remoteMachine'}->{'up'} = ! $error;
162
$configuration->{'remoteMachine'}->{'up'} = ! $error;
163
 
163
 
164
push @status, "remote machine ($configuration->{'remoteMachine'}->{'ip'}) is " . ( $configuration->{'remoteMachine'}->{'up'} ? 'Up' : 'Down' ) . "\n";
164
push @status, "remote machine ($configuration->{'remoteMachine'}->{'ip'}) is " . ( $configuration->{'remoteMachine'}->{'up'} ? 'Up' : 'Down' ) . "\n";
165
# check for maintenance flags, exit if we should go into mainteannce mode
165
# check for maintenance flags, exit if we should go into mainteannce mode
166
#if ( my $result = &checkMaintenance( $configuration ) ) {
166
if ( my $result = &checkMaintenance( $configuration ) ) {
167
#   push @status,$result;
167
   push @status,$result;
168
#   &sendMail( join( "\n", @status), $configuration, "Maintenance Mode" );
168
   &sendMail( join( "\n", @status), $configuration, "Maintenance Mode" );
169
#   exit;
169
   exit;
170
#}
170
}
171
 
171
 
172
# we can not connect to the remote server, so just shut down
172
# we can not connect to the remote server, so just shut down
173
&shutdownMachine( $configuration, "No connection to remote machine", @status ) unless $configuration->{'remoteMachine'}->{'up'};
173
&shutdownMachine( $configuration, "No connection to remote machine", @status ) unless $configuration->{'remoteMachine'}->{'up'};
174
 
174
 
175
# try to mount the datasets
175
# try to mount the datasets