Übersicht über die Möglichkeiten:
apt-get install lshw
lshw
apt-get install monit
set mailserver mail.domaim.de # // Mailserver über den die Mails verschickt werden
set mail-format { from: absender@domain.de } # // Mailadresse Absender
set alert empfaenger@domain.de # // Empfänger der Mails
check system localhost # // Lokalen Server überwachen
if loadavg (5min) > 1 then alert # // Wenn Loadaverage über 5 Minuten größer 1 ist, Alarm versenden
if memory usage > 75% then alert # // Wenn mehr als 75% des Speichers benötigt werden, Alarm versenden
if cpu usage (user) > 70% then alert # // Wenn mehr als 70% CPU Leistung benötigt wird, Alarm versenden (User)
if cpu usage (system) > 30% then alert # // Wenn mehr als 30% CPU Leistung benötigt wird, Alarm versenden (System)
if cpu usage (wait) > 20% then alert # // Wenn mehr als 20% CPU Leistung benötigt wird, Alarm versenden (Wait)
check process sshd with pidfile /var/run/sshd.pid # // Dienst SSH durch PID File überwachen
start program "/etc/init.d/ssh start" # // Wie kann SSH im Fehlerfall gestartet werden
stop program "/etc/init.d/ssh stop" # // Wie kann SSH im Fehlerfall beendet werden
if failed port 22 protocol ssh then restart # // Wenn der SSH Dienst nicht läuft, neu starten
if 5 restarts within 5 cycles then timeout # // Wenn nach 5 Versuchen der Dienst nicht gestartet werden kann, mit Timeout beenden
check process apache2 with pidfile /var/run/apache2.pid # apache webserver
start program "/etc/init.d/apache2 start"
stop program "/etc/init.d/apache2 stop"
if failed host 127.0.01 port 80 then restart
if 5 restarts within 5 cycles then timeout
# check process mysql with pidfile /var/run/mysqld/mysqld.pid # // Dienst Mysql durch PID File überwachen
# group database # // Gruppe definieren
# start program = "/etc/init.d/mysql start" # // Wie kann der MySQL Server im Fehlerfall gestartet werden
# stop program = "/etc/init.d/mysql stop" # // Wie kann der MySQL Server im Fehlerfall gestopt werden
# if failed host 127.0.0.1 port 3306 then restart # // Wenn Port 3306 (MySql) auf dem Lokalen Server nicht läuft, neu starten
# if 5 restarts within 5 cycles then timeout # // Wenn nach 5 Versuchen der Dienst nicht gestartet werden kann, mit Timeout beenden
# quelle: http://www.thomas-krenn.com/de/wiki/Absicherung_eines_Debian_Servers
# ping test
check host www1 with address www1
if failed icmp type echo count 5 with timeout 15 seconds then alert
/etc/init.d/monit restart
cat /var/log/monit.log betrachtet
nano /etc/monit/monitrc
set httpd port 2812 and
# use address localhost # only accept connection from localhost
# allow localhost # allow localhost to connect to the server and
allow 192.168.100.49 # ubuntu client zur Betrachtung
allow admin:monit # require user 'admin' with password 'monit'
# allow @monit # allow users of group 'monit' to connect (rw)
# allow @users readonly # allow users of group 'users' to connect readonly
dmesg
cat /proc/cpuinfo
lshw -C cpu
top
cat /proc/meminfo
sudo lshw -C memory
free
free -m
fdisk -l
apt-get install smartmontools
smartctl -i /dev/sda
root@www2:/# smartctl -i /dev/sdb
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-4-486] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
Smartctl open device: /dev/sdb failed: No such device
root@www2:/# smartctl -i /dev/sda
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-4-486] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
smartctl -H /dev/sda
lspci | grep -i net
apt-get install apticron
EMAIL=„root“ mit einem # auskommentieren und eine neue Zeile mit der gewünschten Mailadresse eintragen. Beispiel: EMAIL=„ich@anbieter.landkürzel“
ps -ef
ps -ef | grep apache2