watch process procAlive 'bgs' 18 0x2 60 'Production Critical: bgs failure. Restarting bgs' '/opt/EMPsysedge/bin/sysedge.sh' #### watch process procAlive 'cron' 1 0x2 60 'Production Critical: cron failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'inetd' 2 0x2 60 'Production Critical: inetd failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'sendmail' 3 0x2 60 'Production Critical: sendmail failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'syslogd' 4 0x2 60 'Production Critical: syslogd failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'automountd' 5 0x2 60 'Production Critical: automountd failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'xntpd' 6 0x2 60 'Production Critical: xntpd failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' watch process procAlive 'itaagtd' 7 0x2 60 'Production Critical: itaagtd failure. Call USA POC' '/opt/EMPsysedge/bin/sysedge.sh' #### Use of uninitialized value at ./b.o-n line 16, chunk 86. Use of uninitialized value at ./b.o-n line 17, chunk 86. Use of uninitialized value at ./b.o-n line 16, chunk 87. Use of uninitialized value at ./b.o-n line 17, chunk 87. Use of uninitialized value at ./b.o-n line 16, chunk 88. Use of uninitialized value at ./b.o-n line 17, chunk 88. Use of uninitialized value at ./b.o-n line 16, chunk 89. #### #!/usr/bin/perl -w use strict; my $cf_dir = "/fmac/sysadm/admin/sysedge/sys/sysedge/cf/"; my $CF = "watch process procAlive 'bgs' 18 0x2 60 'Production Critical: bgs failure. Restarting bgs' '/opt/EMPsysedge/bin/sysedge.sh'"; open CF_FILES, "Servers.cf" or die "Can't Open Servers.cf file: $!"; #open CF_FILES, "Servers.test" or die "Can't Open Servers.test file: $!"; my @cf_f=; #close CF_FILES; foreach my $cf(@cf_f) { chomp $cf; open IN, "$cf_dir/$cf" or die "Can't open '$cf' for input: $!\n"; #open OUT, ">$cf_dir/$cf.tmp" or warn "Can't write '$cf_dir/$cf.tmp': $!\n"; open OUT, ">/tmp/$cf.tmp" or warn "Can't write '/tmp/$cf.tmp': $!\n"; my $file = do { local $/; }; s/^watch.*?'bgs'.*?sh'$//; s/^(watch.*?'cron'.*?sh'$)/$1\n$CF\n/; print OUT $file; } close OUT or die "Can't close filehandle OUT properly: $!\n"; chdir "/$cf_dir"; #rename "$cf.tmp", "$cf"; #}