Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Software Watchdogs
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) Diskussionsforum
View previous topic :: View next topic  
Author Message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Tue Nov 29, 2005 2:08 pm    Post subject: Software Watchdogs Reply with quote

Mir ist letztens auf einer Maschine die Mysql abgeschmiert... nur dumm es es keiner sofort gemerkt hat. Ich hatte dann mal eine Zeitlang ein Script als Watchdog laufen welches einfach einen Connect versucht und ansonsten eine E-Mail verschickt.

Also mal so rein interessehalber nachgefragt:

Wie macht ihr das? Habt ihr eigene Scripte für div. Services (Mysql, Apache, Postfix, ...)? Gibt es da fertige Tools/Lösungen? Oder ist sowas überhaupt nicht sinnvoll? Was macht ihr wenn der Service anscheinend nicht mehr lebt? Nur Mail-Benachrichtigung oder versuchen den automatisch neu zu starten?
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


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

PostPosted: Tue Nov 29, 2005 2:28 pm    Post subject: Reply with quote

selbst noch nicht wirklich groß eingesetzt aber das erste was mir dazu einfällt ist app-admin/monit

- Status über Web abfragbar
- Mailbenachrichtigung
- automatischer Restart nicht antwortender daemons
- leicht verständliche Konfig
_________________
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
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Tue Nov 29, 2005 2:47 pm    Post subject: Reply with quote

Bei mir stürzte Capisuite ne zeitlang regelmässig ab.

Da hab ich das einfach in ne endlos-while-schleife geschmissen und so wurde es immer sofort wieder neugestartet. Aber schön ist das nicht.
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
schrippe
Guru
Guru


Joined: 03 Mar 2004
Posts: 556
Location: Mülheim

PostPosted: Sun Dec 18, 2005 1:19 pm    Post subject: rescue sshd gesucht (autostart script)? Reply with quote

mod-edit: folgenden Thread (2 Posts) hier angehangen --slick

hallo,

habe einen rechner per dsl im Netz und es kommt bei dem des öfteren vor, das der sshd abschmiert.

jetzt suche ich ein script, welches immer nachsieht ob er noch da ist, und bei einem fehler den sshd neu startet.

danke
_________________
for i in $(seq 1 565); do echo 'A$i: entweder rechts fahren oder rechts überholen dürfen!';done
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Sun Dec 18, 2005 1:55 pm    Post subject: Reply with quote

Wie äussert sich das denn? Wenn der Port zugeht könnte das hier helfen.
Code:
nmap -p 22 localhost | grep open > /dev/null && /etc/init.d/sshd restart

Wenn der ganze Prozess weg ist sollte auch
Code:
 ps -C sshd || /etc/init.d/sshd restart
gehen.
Wenn er noch läuft und der port noch offen ist, man sich aber nichtmehr anmelden kann.
Code:
ssh -i ~/.ssh/ckeck localhost echo hello | grep hello > /dev/null && /etc/init.d/sshd restart

Wobei check ein privater Schlüssel ist, der ein login ohne Passwort erlaubt.
Und das ganze irgendwo als cronjob rein.
Obwohl ich mich ja erstmal damit beschäftigen würde warum der abschmiert, als so ein hässliches workaround zu nutzen.
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Sun Dec 18, 2005 2:08 pm    Post subject: Reply with quote

vorherige 2 Posts zum Thema "rescue sshd gesucht (autostart script)?" hier angehangen
Back to top
View user's profile Send private message
nic0000
l33t
l33t


Joined: 25 Sep 2005
Posts: 658

PostPosted: Sun Dec 18, 2005 2:09 pm    Post subject: Reply with quote

schmutzfinger wrote:
Wie äussert sich das denn? Wenn der Port zugeht könnte das hier helfen.
Code:
nmap -p 22 localhost | grep open > /dev/null && /etc/init.d/sshd restart

Wenn der ganze Prozess weg ist sollte auch
Code:
 ps -C sshd || /etc/init.d/sshd restart
gehen.
Wenn er noch läuft und der port noch offen ist, man sich aber nichtmehr anmelden kann.
Code:
ssh -i ~/.ssh/ckeck localhost echo hello | grep hello > /dev/null && /etc/init.d/sshd restart

Wobei check ein privater Schlüssel ist, der ein login ohne Passwort erlaubt.
Und das ganze irgendwo als cronjob rein.
Obwohl ich mich ja erstmal damit beschäftigen würde warum der abschmiert, als so ein hässliches workaround zu nutzen.

Blitzschnell und ausführlich. Respekt. Gleich in meinen Notfall-Kasten eingepflanzt. ;-)
_________________
grüße
nico
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Sun Dec 18, 2005 2:12 pm    Post subject: Reply with quote

schmutzfinger wrote:
Wie äussert sich das denn? Wenn der Port zugeht könnte das hier helfen.
Code:
nmap -p 22 localhost | grep open > /dev/null && /etc/init.d/sshd restart


Ein /etc/init.d/$service restart hilft in solchen Fällen (wo der Service abschmiert) meist sehr wenig, weil das Init-System beim Restart meckert dass der Prozess noch laufen würde (weil er konnte ja nicht sauber gestoppt werden) .

Reproduzierbar wie folgt:
Code:
/etc/init.d/sshd start
killall sshd
/etc/init.d/sshd restart

Da passiert nix.

Besser wäre statt dem restart:
Code:
/etc/init.d/sshd stop ; /etc/init.d/sshd zap ; /etc/init.d/sshd start
Back to top
View user's profile Send private message
Inte
Veteran
Veteran


Joined: 15 Jul 2003
Posts: 1387
Location: Mannheim, GER

PostPosted: Sun Dec 18, 2005 11:12 pm    Post subject: Reply with quote

Interessant ist auch BigBrother.

PS.: Hab mal wieder ein paar Links gefunden :wink:

Suche passendes Tool für Statistiken im Netzwerk
Software Watchdog gesucht
server status auf website
_________________
Gentoo Linux - Die Metadistribution
Back to top
View user's profile Send private message
schrippe
Guru
Guru


Joined: 03 Mar 2004
Posts: 556
Location: Mülheim

PostPosted: Mon Dec 19, 2005 7:24 am    Post subject: Reply with quote

danke für die tips.
_________________
for i in $(seq 1 565); do echo 'A$i: entweder rechts fahren oder rechts überholen dürfen!';done
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum 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