# HG changeset patch # User Matthias Förste # Date 1539243561 -7200 # Node ID 12340919f4e909bf1b04f58ca906ffd7560bc641 # Parent 04e8bd508e9cb512718a7d719f4177338bb45e5c [savepoint] diff -r 04e8bd508e9c -r 12340919f4e9 get-all --- a/get-all Tue Apr 17 12:28:34 2012 +0200 +++ b/get-all Thu Oct 11 09:39:21 2018 +0200 @@ -1,8 +1,9 @@ -#! /usr/bin/perl -w +#! /usr/bin/perl # Grit Schlorke # zieht alle configs nacheinander # +use warnings; use strict; use Net::Ping; @@ -11,17 +12,27 @@ opendir (DIR, $dirname) or die "Can't open directory: \"$dirname\": $!\n"; -my $file; + +while (defined (my $file = readdir(DIR))) { -while (defined ($file = readdir(DIR))) { - if ($file =~ /^\./){ next}; - if ($file =~ /mailserver.innoserver.com/){next}; - if ($file =~ /heinz.dd.dtele.de/){next}; - if ($file =~ /sonne.dd.dtele.de/){next}; - if ($file =~ /gtd15.g-t-d.de/){next}; - if ($ping->ping($file, 3)) { - system ("./get-config", $file) == 0 or warn "Can't get-config (returned: $? // $!)\n"; - } + next if $file ~~ [ qw( + asterisk.is.schlittermann.de + debian.net.besico.de + debian-alt.net.besico.de + fileserver2-a.net.cms.de + fileserver2-a.net.cms.de + heinz.dd.dtele.de + sonne.dd.dtele.de + mail.ccos.de + gtd15.g-t-d.de) ]; + + (system ("./get-config", $file) == 0 or warn "Can't get-config (returned: $? // $!)\n") if $file ~~ [ qw( + emil.frey.kx.schlittermann.de + ahwinter.dyn.schlittermann.de + portal.mm.frey.kx.schlittermann.de + proxy.mm.frey.kx.schlittermann.de + webian2.sachsengarage.de) ] or $ping->ping($file, 3); + } # vim:sts=4 sw=4 ai aw sm: diff -r 04e8bd508e9c -r 12340919f4e9 get-config --- a/get-config Tue Apr 17 12:28:34 2012 +0200 +++ b/get-config Thu Oct 11 09:39:21 2018 +0200 @@ -29,6 +29,12 @@ MAIN: { +my $x = select STDOUT; +$|++; +select STDERR; +$|++; +select $x; + GetOptions( "mkdir!" => \$opt_mkdir, "verbose!" => \$opt_verbose, @@ -127,7 +133,7 @@ if ($status !~ /^OK/) { die "\t$ME: system command ended with $status" unless $opt_keepgoing; } else { - warn "[$status]\n"; + print "[$status]\n"; } last FILES if $status eq "OK"; @@ -140,8 +146,7 @@ } } - system "ssh", "root\@$host", "touch /var/tmp/get-config.stamp"; - #system "ssh", "root\@$host", "nagios-client-check"; + system "ssh", "root\@$host", "touch /var/lib/get-config.stamp"; }