Admin-Toolkit: Difference between revisions

From Chaosdorf Wiki
Jump to navigation Jump to search
No edit summary
(tranz-latz-i-ohn)
Line 1: Line 1:
[[File:Admin_Icinga.png]]
[[File:Admin_Icinga.png]]


Zur einfacheren Verwaltung der Chaosdorf-Server (und in Zukunft weiterer
For easier management of Chaosdorf hosts.
Hosts) existiert das Chaosdorf-Admin-Toolkit.


Dieses ist ein in [http://git-scm.com/ git] getracktes Debian-Paket, welches
The admin toolkit is a [http://git-scm.com/ git] tracked Debian package, which is installed on any host administrated by us (like the chaosdorf.de servers and the space's router). It provides the hosts with most of the required scripts and configs, which saves a lot of fiddling around in /usr/local and especially ensures that all hosts are up-to-date.
einfach auf jedem Host installiert wird und somit einen Teil der nötigen
zusätzlichen Konfigurationsdateien, Skripte etc. bereitstellt. Im Vergleich zu
manuellem Rumgefrickel in /usr/local senkt dies den Administrationsaufwand
deutlich. Vor allem muss man sich nicht mehr darum sorgen, dass diese Dateien
auf den verschiedenen Hosts auf dem gleichen Stand sind.


[http://github.com/chaosdorf/chaosdorf-admin-toolkit Das Repository auf GitHub]
[http://github.com/chaosdorf/chaosdorf-admin-toolkit chaosdorf-admin-toolkit on github]


= Inhalt =
= Fabric =


== Fabric ==
We use [http://fabfile.org/ fabric] to roll out package updates. The software still got some problems, but "fab configs deploy:2011.09.07" is way more comfortable than running scp and ssh for every host.


Zum Ausrollen des neuesten Admin-Toolkit-Releases benutzen wir
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/fabfile.py fabfile.py]
[http://fabfile.org/ fabric]. Die Software hat leider noch ein paar Macken,
aber insgesamt ist `fab configs deploy:2011.04.07` deutlich angenehmer zu
tippen, als jedes mal die entsprechenden Befehle aus der Shell-History zu
fischen und anzupassen. [[!gh_at fabfile.py]]


== NSCA-Helfer ==
= NSCA helpers =


Unsere Nagios-Checks werden lokal per cron ausgefühl und dann per `nsca_send`
Our nagios checks run locally via cron, the results are transmitted via "send_nsca". They are configured for all hosts in one central file, which is parsed by a custom perl script.
auf unseren Monitoringserver geschoben. Damit wir nicht die gemeinsamen Checks
doppelt definiert haben, sind sie zentral [[!gh_at_np passive_checks.cfg
desc="konfiguriert"]] und werden dann von einem weiteren kleinen [[!gh_at_np
submit_checks desc="Perlskript"]] ausgeführt.


== Checkskripte ==
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-passive/passive_checks.cfg passive_checks.cfg]
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-passive/submit_checks submit_checks]


Diverse nicht in Debian enthaltene und ein paar eigene. Zum Beispiel:
= Nagios checks =


[[!gh_at_nl check_cert_expire desc="check\_cert\_expire"]]
Custom or not shipped by Debian.
erinnert uns rechtzeitig, unsere SSL-Zertifikate zu erneuern. Deutlich
komfortabler als Kalendereinträge.


[[!gh_at_nl check_git_status desc="check\_git\_status"]]
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-checks/local/check_cert_expire check_cert_expire] reminds us when it's time to renew our SSL certificate. Much better than calendar entries.
überprüft, ob in `/etc` (etckeeper) oder `/usr/local` (normales git-repo)
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-checks/local/check_git_status check_git_status] makes sure noone forgot to commit their changes in /etc (etckeeper) or /usr/local (plain git repo). The check intervals are pretty long, so it doesn't interfere with administrative work.
irgendwelche Änderungen liegen, die noch nicht commitet wurden. Durch
* [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-checks/remote/check_websites check_websites] reads a little [https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/nagios-checks/remote/chaosdorf_websites.ini config] to see if all URL / VHost combinations work or redirect as expected.
ausreichend hohe Check- und Retry-Intervalle in der Icinga-Config stört es auch
nicht bei üblichen Adminarbeiten.


Insbesondere die CGI- und Git-Wrapper von Ikiwiki sind eine beliebte
= Icinga goodies =
Fehlerquelle (falsche Berechtigungen, nicht richtig geupdated etc.).
[[!gh_at_nl check_ikiwiki desc="check_ikiwiki"]]
liest daher die Configs unserer ikiwiki-Instanzen aus und überprüft, ob darin
denn auch alles mit rechten Dingen zugeht.


[[!gh_at_nr check_websites desc="check_websites"]]
We have a bot called '''icinga''' in #chaosdorf. It's a simple perl script connected to Icinga, which immediately spams service alerts / recoveries into the channel. Handy if you check IRC more frequently than mail and if people wonder if something is b0rked or not.
überprüft auf basis einer [[!gh_at_nr chaosdorf_websites.ini desc="Config"]],
ob diverse URLs auf unseren diversen vhosts den richtigen Status liefern (401
Authorization required, 200 OK oder 301 Redirect auf spezifische andere URL).


== Icinga-Goodies ==
= checkrestart hook =


Wir haben einen Bot mit dem Namen icinga in #chaosdorf. Es ist ein simples,
After every system upgrade, a dpkg hook runs checkrestart to find daemons running with outdated library versions.
an das Icinga angeschlossenes Perlskript, welches uns sofort mit irgendwelchen
Meldungen versorgt. Einerseits weiß dann sofort jeder Bescheid, und
andererseits entstehen dadurch so schöne Situationen wie diese:


    20:59          <--  mete!~mete@shells.chaosdorf.de [Remote host closed the connection]
= Backups =
    20:59          <--  penma_!~penma@shells.chaosdorf.de [Read error: Connection reset by peer]
    20:59          <--  muzy!~muzy@shells.chaosdorf.de [Remote host closed the connection]
    [ ... und noch ein paar mehr ... ]
    21:09        icinga  PROBLEM host alert: shells.chaosdorf.de is DOWN


O'RLY? :-)
[https://github.com/chaosdorf/chaosdorf-admin-toolkit/blob/master/backup/backup_external backup_external] locally collects, compresses and encrypts important data and then transmits it to a remote host via SFTP. The backups are encrypted with a dedicated Admin key.


(for the record: Es war eine geplante Downtime,
= Dependencies =
die wir nur nicht im Icinga eingetragen hatten)


== checkrestart-Hook ==
Like vim, etckeeper, git, zsh. So we don't need to install our standard software by hand (or maybe forget a package).
 
Nach jedem Systemupdate wird über einen `dpkg`-Hook nachgeschaut, ob noch
Daemons mit veralteten Libraryversionen laufen, so dass man diese ggf.
neustarten kann.
 
== Backups ==
 
Auch Backups werden über das Debianpaket geregelt. Sie werden von [[!gh_at
backup/backup_external]] lokal generiert, komprimiert und verschlüsselt,
anschließend per SFTP auf einen anderen Host übertragen.
 
Geplant ist, sie in Zukunft mit einem speziellen Adminkey zu verschlüsseln und
auf mehreren Hosts zu speichern. Das vorhandene Skript ist darauf bereits
ausgelegt.
 
== Dependencies ==
 
Als Hilfe zum Aufsetzen neuer Systeme gibt's noch ein paar Dependencies auf
Debianpakete, u.a. etckeeper, git, vim und zsh.
 
= Pläne =
 
* Bei Installation automatisch den Nagios-User anlegen


[[Category:Projects]]
[[Category:Projects]]

Revision as of 22:29, 12 February 2012

Admin Icinga.png

For easier management of Chaosdorf hosts.

The admin toolkit is a git tracked Debian package, which is installed on any host administrated by us (like the chaosdorf.de servers and the space's router). It provides the hosts with most of the required scripts and configs, which saves a lot of fiddling around in /usr/local and especially ensures that all hosts are up-to-date.

chaosdorf-admin-toolkit on github

Fabric

We use fabric to roll out package updates. The software still got some problems, but "fab configs deploy:2011.09.07" is way more comfortable than running scp and ssh for every host.

NSCA helpers

Our nagios checks run locally via cron, the results are transmitted via "send_nsca". They are configured for all hosts in one central file, which is parsed by a custom perl script.

Nagios checks

Custom or not shipped by Debian.

  • check_cert_expire reminds us when it's time to renew our SSL certificate. Much better than calendar entries.
  • check_git_status makes sure noone forgot to commit their changes in /etc (etckeeper) or /usr/local (plain git repo). The check intervals are pretty long, so it doesn't interfere with administrative work.
  • check_websites reads a little config to see if all URL / VHost combinations work or redirect as expected.

Icinga goodies

We have a bot called icinga in #chaosdorf. It's a simple perl script connected to Icinga, which immediately spams service alerts / recoveries into the channel. Handy if you check IRC more frequently than mail and if people wonder if something is b0rked or not.

checkrestart hook

After every system upgrade, a dpkg hook runs checkrestart to find daemons running with outdated library versions.

Backups

backup_external locally collects, compresses and encrypts important data and then transmits it to a remote host via SFTP. The backups are encrypted with a dedicated Admin key.

Dependencies

Like vim, etckeeper, git, zsh. So we don't need to install our standard software by hand (or maybe forget a package).