Lippe:Icinga commands services
Zur Navigation springen
Zur Suche springen
Da Freifunk Lippe per Icinga gemonitort wird hier nun die Service und Command Definitionen
define service {
hostgroup_name check_nrpe_bandwidth_bat0
service_description Check_Bandwidth_bat0_ssh
check_command check_by_ssh!'/usr/lib/nagios/plugins/check_bandwidth.sh gw01.freifunk-lippe.de linux bat0 15 30 50 1000'
use generic-service
notification_interval 0
}
Die Übergabe Parameter erlklären sich so:
$1 Servername $2 Linux oder Cisco $3 Interface name $4 max Poll Period in Sekunden $5 Warming $6 Critical $7 Connection Speed
define service {
hostgroup_name check_by_ssh_cpu_load
service_description Check_CPU_Load_ssh
# check_command check_by_ssh!'/usr/lib/nagios/plugins/check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0'
check_command check_by_ssh!"/usr/lib/nagios/plugins/check_load --warning='5.0,3.0,3.0' --critical='10.0,6.0,4.0'"
use generic-service
notification_interval 0
}
define command{
command_name check_by_ssh
command_line $USER1$/check_by_ssh -l nagios -H $HOSTADDRESS$ -p <SSH Port> -t 30 -C $ARG1$
}
define command {
command_name check_freifunk
command_line /usr/lib64/nagios/plugins/check_freifunk -w 20 -c 10
}
define command {
command_name check_linux_memory
command_line /usr/lib64/nagios/plugins/check_linux_memory -w 20 -c 10 -d M -f
}
Der Parameter -d stehen für die Masseinheit Mega Kilo,.. Der Parameter -f steht dafür, dass der Cache Speicher auch mit für den freien Speicher berechnet wird.
Service Definitionen:
define service {
hostgroup_name check_nrpe_bandwidth_eth0
service_description Check_Bandwidth_eth0_ssh
check_command check_by_ssh!'/usr/lib/nagios/plugins/check_bandwidth.sh vpn2.freifunk-bielefeld.de linux eth0 15 60 80 1000'
use generic-service
notification_interval 0
}
define service {
hostgroup_name check_by_ssh_cpu_load
service_description Check_CPU_Load_ssh
# check_command check_by_ssh!'/usr/lib/nagios/plugins/check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4.0'
check_command check_by_ssh!"/usr/lib/nagios/plugins/check_load --warning='5.0,3.0,3.0' --critical='10.0,6.0,4.0'"
use generic-service
notification_interval 0
}
define service {
hostgroup_name check_freifunk
service_description Check_Anzahl_Verbindungen
check_command check_by_ssh!'/usr/lib/nagios/plugins/check_freifunk.sh'
use generic-service
notification_interval 0
}
define service {
hostgroup_name check_linux_memory
service_description Check_Linux_Memory_ssh
check_command check_by_ssh!'/usr/lib/nagios/plugins/check_linux_memory -w 10 -c 5 -d M -f'
use generic-service
notification_interval 0
}
define service {
hostgroup_name check_procs_alfred
service_description Check_Alfred
check_command check_by_ssh!'/usr/lib/nagios/plugins/check_procs -c 1:1 -C <Prozess Name>'
use generic-service
notification_interval 0
}
Mit dem Parameter -c 1:1 wird geprüft, ob der Prozess genau 1 mal im Speicher ist. Wenn ja ist alles in Ordnung. Der Name Prozess Name sollte selbsterlärend sein. Damit könne ndie Prozese DHCPD NAMED BIRD ALFRED getestet werden