5.6.3. Anpassung der Konfiguration
Dienste, welche auf Schwellwerte reagieren sollen (CPULoad,
Mailqueue,o.ä.) können in der Datei
/etc/linuxmuster/nagios.conf angepasst werden.
Diese Datei ist entsprechend kommentiert. Hier sehen Sie einen
Auszug:
# Main configuration for linuxmuster-nagios
# Frank Schiebel <schiebel@aeg-reutlingen.de>
# descriptions for the servers
DESC_SERVER="Server der paedML Linux 4.0"
DESC_FW="Firewall der paedML Linux 4.0"
# description for servergroup
DESC_SERVERGROUP="Server der paedML Linux 4.0"
# check interval: nagios checks all defined services
# asynchronous with the given interval in minutes.
# intensive checking can take a big amount of system
# performance!
# default: 15 Minutes
GENERIC_CHECK_INTERVAL = 15
# escalation settings: nagios can escalate notifications
# to external support.
# To enable external notifications, set an appropriate email-address
REMOTE_SUPPORT_EMAIL = ""
# which services should be notificated remotley? service names must match
# exactly and be seperated by pipes (|)
# Disk space currently is always notificated remotely.
REMOTE_SUPPORT_SERVICES = "SYS - memory/swap | SYS - memory/application mem | SYS - CPU Load"
# hard disk monitoring devices
# auto:20:10 Tries to examine the system an sets up
# monitoring for all recognized devices. In this
# example warning level ist 20%, critical
# level is 10% free on all devices. You can change
# these values accordingly - be shure to set
# critical less than emergency
# /usr/local:20:10
# List of *mount points* to monitor seperated by
# whitespaces. You can set warning and critical
# free space on a per device basis
#
#DISK_DEVICES="/usr/local:30:20 /home:20:10"
DISK_DEVICES="auto:20:10"
# SWAP usage warning & critical levels
# amount of FREE space to change the
# state into warning/emergency
SWAP_WARN="70"
SWAP_CRIT="40"
# Memory usage warning & critical levels
# amount of space to change the
# state into warning/emergency
MEM_WARN="90"
MEM_CRIT="95"
# CPU Load warning & critical levels
# cpu load to change state into warning/emergency.
# Format: <1-min-load-avg>!<5-min-load-avg>!<15-min-load-avg>
# For help on the meaning of these values refere to top/uptime
# man pages
# Whenever one of the limits is overridden, state changes
# to warnig/critical
LOAD_WARN="6!5!4"
LOAD_CRIT="15!12!8"
Nach jeder Änderung in der Datei
/etc/linuxmuster/nagios.conf muss das
Skript
# linuxmuster-nagios-setup
ausgeführt werden und
nagios neu gestartet werden:
# /etc/init.d/nagios2 stop
# /etc/init.d/nagios2 start
Die eigentliche nagios-Konfiguration wird dabei in die Datei
/etc/nagios2/conf.d/linuxmuster_main.cfg
geschrieben. Diese Datei sollten Sie keinesfalls manuell ändern, da
diese Datei bei jedem Skriptlauf von linuxmuster-nagios-setup neu erzeugt wird. Eigene
Anpassungen, die über die Möglichkeiten der automatisierten
Konfiguration hinausgehen sollten Sie in der Datei
/etc/nagios2/conf.d/linuxmuster_custom.cfg
vornehmen.
Mit Hilfe von linuxmuster-nagios-setup können Sie die
Konfiguration in /etc/nagios2/ in den
Ausgangszustand zurücksetzen. Rufen Sie dazu das Skript mit der Option
linuxmuster-nagios-setup --first
auf:
# linuxmuster-nagios-setup --first
This command resets the nagios configuration to a default state.
*** ALL CONFIGURATION FILES IN THE DIRECTORY /etc/nagios2/ WILL BE LOST! ***
Do you really want to proceed [yes/no]? yes
OK - configuration reset to default.
In case of emergency, you will find a tarfile of your last
configuration in /var/backup/linuxmuster/nagios/lastconfig.tgz
Der Befehl löscht das gesamte Verzeichnis /etc/nagios2/ und
erstellt eine neue Ausgangskonfiguration aus der Datei
/etc/linuxmuster/nagios.conf. Parameter und
Schwellwerte, die Sie dort zuvor angepasst haben, bleiben also erhalten,
nicht aber Anpassungen in der Datei
/etc/nagios2/conf.d/linuxmuster_custom.cfg. Auch
alle anderen mögflicherweise vorhandenen Konfigurationsdateien werden
gelöscht.