Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (76 sloc) 2.9 KB
/*******************************
Server Hardware Checks
*******************************/
apply Service for (service => request_command in {
"HW Storage" = "storage",
"HW Processor" = "proc",
"HW DIMM" = "memory",
"HW Power" = "power",
"HW Temperature" = "temp",
"HW Fan" = "fan",
"HW NICs" = "nic",
"HW BMC" = "bmc",
"HW System Summary" = "info",
"HW Firmware" = "firmware",
"HW Management Log" = "mel",
"HW System Event Log" = "sel"
}){
import "generic-service"
check_command = "redfish"
// increase timeout, older BMCs can be very slow
check_timeout = 60
vars.redfish_retries = 3
vars.redfish_timeout = 13
max_check_attempts = 10
retry_interval = 1m
vars.redfish_detailed = false
// enable Perfdata
if (request_command in [ "temp", "fan", "power" ] ) {
enable_perfdata = true
}
// add detailed view
if (request_command in [ "bmc", "firmware", "mel", "sel", "storage" ] ) {
vars.redfish_detailed = true
}
// request logs only every 30 minutes
if ( request_command in [ "mel", "sel" ]) {
check_interval = 30m
}
// update firmware infos only four times a day
if (request_command in [ "firmware" ] ) {
check_interval = 6h
}
/*
set warning and critical
log entries > info which are occurred within the last 24h are reported as CRITICAL
log entries > info which occurred between the last 24h and 72h are reported as WARNING
*/
if (request_command in [ "mel", "sel" ]) {
vars.warning = 3
vars.critical = 1
}
// credentials
if (match("ntp*", host.name)) {
vars.redfish_env_username = "icinga"
vars.redfish_env_password = "SUPERSECRET"
} else {
vars.redfish_authfile = "/etc/icinga2/check_redfish_icinga.login"
}
vars.redfish_hostname = host.vars.console
if (request_command == "storage") { vars.redfish_storage = true }
if (request_command == "proc") { vars.redfish_proc = true }
if (request_command == "memory") { vars.redfish_memory = true }
if (request_command == "power") { vars.redfish_power = true }
if (request_command == "temp") { vars.redfish_temp = true }
if (request_command == "fan") { vars.redfish_fan = true }
if (request_command == "nic") { vars.redfish_nic = true }
if (request_command == "bmc") { vars.redfish_bmc = true }
if (request_command == "info") { vars.redfish_info = true }
if (request_command == "firmware") { vars.redfish_firmware = true }
if (request_command == "mel") { vars.redfish_mel = true }
if (request_command == "sel") { vars.redfish_sel = true }
assign where host.vars.hw_type == "HP_Proliant" && host.vars.console
// ignore power checks on Blade Server
ignore where match("HP BL*",host.vars.hw_model) && request_command in [ "power" ]
}
// EOF
You can’t perform that action at this time.