Sie sind auf Seite 1von 12

check_mk

Ein einfacher Start ins Nagios-Monitoring

check_mk
general purpose nagios plugin for data
retrieval

Reduktion der:
Anzahl der Client requests
CPU-Last auf dem Nagios Host
Automatisches Inventory

Struktur

1.

aktiver Check/Host

2.

check_mk connection zum Client (holt alle Daten)

3.

check_mk analysiert die Daten und extrahiert Performancedaten

4.

erzeugt check-results fr Nagios

Features
Tagging
Auto-Inventory
Erzeugung der notwendigen Nagios-Configs
Einbindung von Legacy-Nagios-Checks
Clustering
SNMP
eigenes GUI (multisite)

Clientsoftware
python Script oder exe fr Windows
Pakete verfgbar fr verschiedene LinuXDerivate (oder .tar.gz)

ber xinetd ansprechbar oder einfach per ssh


script auch auf anderen Platformen einsetzbar
(AIX, HP-UX ...)

Doku
http://mathias-kettner.de/check_mk.html
auf check_mk aufbauend: OMD
Enthlt: check_mk, Nagios, pnp4nagios,
nagvis, rrd-cache

http://mathias-kettner.de/omd_intro.html

Zentrale Config
all_hosts = [
#
# alle Rechner sollte fuer V1.1.9i ein Hosttag tragen, dass angibt wie der Host
kontaktiert wird tcp|snmp|ping
# Linux-Rechner
#
"localhost|tcp|tsmclient",
"ftp|tcp|ftp",
"jabber|tcp",
"idisplaysql|tcp|sql|tsmclient",
"ikm-alf|tcp",
"mail|tcp|smtpserver",
"mysql5|tcp|sql|tsmclient",
"moodlesql|tcp|sql|moodle",
"moodlesql-backup|tcp|sql|moodle",
"rorvic|tcp",
"scan2mail|tcp|smtpserver|tsmclient",
"secmail|tcp|smtpserver",
"studipmysql|tcp|sql|tsmclient",
"tsm01|tcp|aix|tsmserver",

Demo

https://zivnagios03.uni-muenster.de/nagios/

main.mk Details
clusters = {
"maildisp|tcp|mailcluster|lvs" : [ "zivmaildisp1", "zivmaildisp2" ],
"webdisp|tcp|web|lvs" : [ "zivwebdisp1", "zivwebdisp2" ],
}
host_groups = [
( 'webapplication-server', [ 'webapp' ] ,
ALL_HOSTS ),
( 'cups-server', [ 'cupsserver' ],
! ALL_HOSTS ),
...
service_groups = [
( "postfix-smtp" , ALL_HOSTS, ["Postfix smtp"] ),
( "apache-back" , [ "webbackend" ] , ALL_HOSTS, ["Apache Status"] ),
...
define_hostgroups = {
!
!
!
'webapplication-server' : 'Application Server',
!
!
!
'cups-server' : 'CUPS Server',
host_contactgroups = [
!
( "ftpadmins" , ['ftp'], ALL_HOSTS ),

main.mk Details
host_contactgroups = [
!
( "ftpadmins" , ['ftp'], ALL_HOSTS ),
...
service_contactgroups = [
# general ones
( "sysadmins" , ALL_HOSTS, ["proc_dsmc"] ),
# for the mail system
( "mailadmins" , ['mailcluster'], ALL_HOSTS, ["CPU load"] ),
...
ignored_services = [
( [ '!cupsserver' ], ALL_HOSTS, [ "CUPS" ] ),
...
legacy_checks = [
( ( "check_apachestatus_auto!20!10", "Apache Status", True ), [ "webbackend" ] , ALL_HOSTS ),
( ( "check_smtp!-w 1 -c 5", "Postfix smtp", True ), [ "smtpserver" ], ALL_HOSTS ),
( ( "check_nrpe!check_ipvs!128.176.188.161 993 5000 7000 500 1000","IPVS IMAPConnections",True ), [ "mailcluster" , "lvs" ], PHYSICAL_HOSTS ),

main.mk Details
datasource_programs = [
( "ssh tsmlm -l root /usr/bin/check_mk_agent", [ 'tsmlm' ] ),
( "ssh zivmailback -l root mmsh zivmailav1g check_mk_agent", [ 'zivmailav1' ] ),
...

checks += !
[
# make sure for lvs dispatchers there is exactly one pulse and one lvsd running
( ["lvs"], PHYSICAL_HOSTS , "ps", "pulse", ( "pulse", 1, 1, 1, 1 ) ),
( ["lvs"], CLUSTER_HOSTS , "ps", "lvsd", ( "/usr/sbin/lvsd", 1, 1, 1, 1 ) ),
( ["tsmclient"], ALL_HOSTS , "ps", "dsmc", ( "/opt/tivoli/tsm/client/ba/bin/dsmc", 1, 1, 1, 1 ) ),
( ["av"], ALL_HOSTS , "ps.perf" , "savdid", ("/usr/local/bin/savdid", 1, 1, 90, 100 ) ),
( ["av"], ALL_HOSTS , "ps.perf" , "savscand", ("savscand", 0, 0, 90, 100 ) ),

# Do an inventory check every 12 hours


inventory_check_interval = 720 # minutes
# failing inventory checks should just warn
inventory_check_severity = 1

main.mk Details
check_parameters = [
( (100, 2500), [ "mail" , "secmail" , "zivlistserv" ] , [ "Postfix Queue" ] ),
( (50, 150), [ 'smtpserver' ] , ALL_HOSTS , [ "Postfix Queue" ] ),
( (4000, 5000), [ "zivmailuser06" ] , [ "Number of threads" ] ),
( (250, 1000, 86400 , 31536000 ), [ 'cupsserver' ], ALL_HOSTS , [ "CUPS Queue cm8060" ] ),
( (25, 100, 86400 , 31536000 ), [ 'cupsserver' ], ALL_HOSTS , [ "CUPS Queue" ] ),
( ( 96, 97), [ 'webproxy' ], ALL_HOSTS , [ "fs_/" ] ),