Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Serverwartung erleichtern, Ideensuche
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1191
Location: Austria

PostPosted: Wed Apr 13, 2005 11:31 am    Post subject: Serverwartung erleichtern, Ideensuche Reply with quote

Mein Problem ist ein alt bekanntes - Wenn man viele Server hat (bei mir sind es im Moment 27 zu betreuende Kisten) haengt man seine Zeit dran, bis die Wartungsarbeiten erledigt sind.

Folgende Ideen habe ich schon beruecksichtigt:
- Automatische Cronscripts verwenden um den Portage zu syncen
- ntpd
- Cronscripts um GLSA Checks zu machen > Mail
- Configs in CVS verwalten
- Changetrack (um Veraenderungen in den Configs per Mail zu bekommen)

Nun arbeite ich gerade an einer Moeglichkeit um Commands auf allen Systemen auszufuehren. Dazu folgender Ansatz:

- Connect per SSH und ein Ausfuehren des Commands
- Keys zur Authentifizierung benuetzen

Code:

#!/bin/bash
# File: rx.sh
ssh -l root host1.mynet.com $*


Da diese Methode bei einer groesseren Liste von Hosts leicht unuebersichtlich ist, hier mit einer Schleife

Code:

#!/bin/bash
# File: rx.sh
HOSTS="host1.mynet.com host2.mynet.com" #Hostliste

for x in $HOME ;
  do echo 'Running Command: "$*" on: $x';
  ssh -l root $x $*;
done

echo 'Finished.
#EOF'


Das Script laesst sich mit beliebig vielen Hosts bestuecken. Der Aufruf funktioniert durch ./rx <command>.
Beispiel:

Code:
./rx echo hello world


Probleme:
- Es wird eine Queue abgearbeitet (ein Host nach dem Anderen)
- Commands wie 'screen' gehen nicht (Fehlermeldung: "Must be connected to a terminal")
- keine Fortschrittsanzeige, keine Statusmeldungen
- Fehler z.B. bei emerge gehen unter und es wird am naechsten Host weitergemacht

Ideen dazu:
Laenger dauernde Commands ausfuehren: die Ergebnisse per Mail senden: emerge sync | mail admin@somewhere.net &
Per Escape-Sequenzen die Xterm Titelleiste manipulieren um dort den Status wie bei emerge zu bauen

Hat jemand gute Ideen dazu um das Script zu erweitern?

Rei
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Wed Apr 13, 2005 12:05 pm    Post subject: Reply with quote

Hi,

schau dir doch mal

PSSH
oder
ClusterSSH

an, evtl. kannst du damit das ganze vereinfachen.

HTH
T.
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Wed Apr 13, 2005 12:34 pm    Post subject: Reply with quote

Cacti gefällt mir da ganz gut. Kann man über SNMP oder Scripts Werte auslesen und dann übersichtlich darstellen lassen oder ging es jetzt speziell um Wartungsaufgaben?
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1191
Location: Austria

PostPosted: Wed Apr 13, 2005 12:58 pm    Post subject: Reply with quote

es ging um Dinge wie ein gepflegtes etc-update oder einmal ein mass-emerge

Rei
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Wed Apr 13, 2005 5:49 pm    Post subject: Reply with quote

Wegen ...must be connected to a terminal...: versuchs mal mit ssh user@host -t screen, dann sollte das klappen.
_________________
Dinosaur week! (Ok, this thread is so last week)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum