forked from bb-Ricardo/check_redfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icinga2_hw_service_checks_example.conf
108 lines (89 loc) · 3.38 KB
/
icinga2_hw_service_checks_example.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*******************************
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",
"HW Inventory" = "inventory"
}){
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 info only four times a day
if (request_command in [ "firmware" ]) {
check_interval = 6h
}
// get system inventory only four times a day
if (request_command in [ "inventory" ]) {
check_interval = 6h
check_timeout = 180
vars.redfish_all = true
vars.redfish_inventory = true
vars.redfish_inventory_id = host.vars.inventory_source_id
// inventory file to write inventory to
vars.redfish_inventory_file = "/var/tmp/check_redfish_inventory/inventory_" + host.name + ".json"
}
/*
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 }
// ignore missing power supplies on Blade Server
if (match("HP BL*",host.vars.hw_model)) {
vars.ignore_missing_ps = true
}
assign where host.vars.hw_type == "HP_Proliant" && host.vars.console
}
// EOF