]>
Commit | Line | Data |
---|---|---|
46a61a1b IB |
1 | { lib, ... }: |
2 | let | |
3 | hostFQDN = "tiboqorl.fr"; | |
4 | defaultPassiveInfo = { | |
5 | filter = lib.attrsets.filterAttrs | |
6 | (k: v: builtins.elem k ["service_description"] || builtins.substring 0 1 k == "_"); | |
7 | use = "external-passive-service"; | |
8 | contact_groups = "tiboqorl"; | |
9 | freshness_threshold = "450"; | |
05a3b252 | 10 | notification_interval = "240"; |
46a61a1b IB |
11 | retry_interval = "1"; |
12 | servicegroups = "webstatus-resources"; | |
13 | host_name = hostFQDN; | |
14 | }; | |
15 | in | |
e820134d IB |
16 | { |
17 | host = { | |
18 | "tiboqorl.fr" = { | |
19 | alias = "tiboqorl.fr"; | |
20 | address = "tiboqorl.fr"; | |
21 | use = "linux-server"; | |
46a61a1b IB |
22 | contact_groups = "tiboqorl"; |
23 | hostgroups = "webstatus-hosts"; | |
24 | _webstatus_name = "tiboqorl"; | |
25 | }; | |
26 | }; | |
27 | service = [ | |
28 | { | |
29 | passiveInfo = defaultPassiveInfo; | |
30 | service_description = "Size on root partition"; | |
31 | use = "local-service"; | |
32 | check_command = ["check_local_disk" "20%" "10%" "/"]; | |
33 | } | |
34 | { | |
35 | passiveInfo = defaultPassiveInfo; | |
36 | service_description = "Total number of process"; | |
37 | use = "local-service"; | |
38 | check_command = [ "check_local_procs" "250" "400" "RSZDT" ]; | |
39 | } | |
40 | { | |
41 | passiveInfo = defaultPassiveInfo; | |
42 | service_description = "Network bandwidth"; | |
43 | use = "local-service"; | |
44 | check_interval = "2"; | |
45 | max_check_attempts = "20"; | |
46 | retry_interval = "2"; | |
47 | check_command = [ | |
48 | "check_local_bandwidth" | |
49 | "eth0" | |
50 | "20480" # kb/s | |
51 | "51200" # kb/s | |
52 | ]; | |
53 | } | |
54 | { | |
55 | passiveInfo = defaultPassiveInfo; | |
56 | service_description = "Average load"; | |
57 | use = "local-service"; | |
58 | check_command = [ | |
59 | "check_local_load" | |
60 | "3.0,3.0,3.0" # warn | |
61 | "4.0,4.0,4.0" # alert | |
62 | ]; | |
63 | } | |
64 | { | |
65 | passiveInfo = defaultPassiveInfo; | |
66 | service_description = "Swap usage"; | |
67 | use = "local-service"; | |
68 | check_command = ["check_local_swap" "20" "10"]; | |
69 | } | |
70 | { | |
71 | passiveInfo = defaultPassiveInfo; | |
72 | service_description = "Memory usage"; | |
73 | use = "local-service"; | |
74 | check_command = ["check_memory" "80" "90"]; | |
75 | } | |
76 | { | |
77 | passiveInfo = defaultPassiveInfo; | |
78 | service_description = "NTP is activated and working"; | |
79 | use = "local-service"; | |
80 | check_command = ["check_ntp"]; | |
81 | } | |
82 | ]; | |
83 | command = { | |
84 | check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$"; | |
85 | check_local_procs = "/usr/bin/sudo $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$"; | |
86 | check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$"; | |
87 | check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$"; | |
88 | check_local_bandwidth = "/usr/bin/sudo $USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$"; | |
89 | check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$"; | |
90 | check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org"; | |
91 | ||
92 | check_host_alive = "$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5"; | |
93 | ||
94 | notify-master = "$USER2$/send_nrdp.sh -u \"$USER200$\" -t \"$USER201$\" -H \"$HOSTADDRESS$\" -s \"$SERVICEDESC$\" -S \"$SERVICESTATEID$\" -o \"$SERVICEOUTPUT$ | $SERVICEPERFDATA$\""; | |
95 | }; | |
96 | timeperiod = { | |
97 | "24x7" = { | |
98 | alias = "24 Hours A Day, 7 Days A Week"; | |
99 | monday = "00:00-24:00"; | |
100 | tuesday = "00:00-24:00"; | |
101 | wednesday = "00:00-24:00"; | |
102 | thursday = "00:00-24:00"; | |
103 | friday = "00:00-24:00"; | |
104 | saturday = "00:00-24:00"; | |
105 | sunday = "00:00-24:00"; | |
106 | }; | |
107 | }; | |
108 | servicegroup = { | |
109 | webstatus-resources = { alias = "Local resources"; }; | |
110 | }; | |
111 | hostgroup = { | |
112 | webstatus-hosts = { alias = "Hosts"; }; | |
113 | }; | |
114 | contactgroup = { | |
115 | tiboqorl = { alias = "Naemon Administrators"; }; | |
116 | }; | |
117 | templates = { | |
118 | service = { | |
119 | generic-service = { | |
120 | active_checks_enabled = "1"; | |
121 | check_freshness = "0"; | |
122 | check_interval = "10"; | |
123 | check_period = "24x7"; | |
124 | contact_groups = "tiboqorl"; | |
125 | event_handler_enabled = "1"; | |
126 | flap_detection_enabled = "1"; | |
127 | is_volatile = "0"; | |
128 | max_check_attempts = "3"; | |
129 | notification_interval = "60"; | |
130 | notification_options = "w,u,c,r,f,s"; | |
131 | notification_period = "24x7"; | |
132 | notifications_enabled = "0"; | |
133 | obsess_over_service = "1"; | |
134 | passive_checks_enabled = "1"; | |
135 | process_perf_data = "1"; | |
136 | retain_nonstatus_information = "1"; | |
137 | retain_status_information = "1"; | |
138 | retry_interval = "2"; | |
139 | }; | |
140 | local-service = { | |
141 | use = "generic-service"; | |
142 | host_name = hostFQDN; | |
143 | check_interval = "5"; | |
144 | max_check_attempts = "4"; | |
145 | retry_interval = "1"; | |
146 | servicegroups = "webstatus-resources"; | |
147 | }; | |
148 | }; | |
149 | host = { | |
150 | generic-host = { | |
151 | event_handler_enabled = "1"; | |
152 | flap_detection_enabled = "1"; | |
153 | notification_period = "24x7"; | |
154 | notifications_enabled = "1"; | |
155 | process_perf_data = "1"; | |
156 | retain_nonstatus_information = "1"; | |
157 | retain_status_information = "1"; | |
158 | }; | |
159 | linux-server = { | |
160 | check_command = "check_host_alive"; | |
161 | check_interval = "5"; | |
162 | check_period = "24x7"; | |
163 | contact_groups = "tiboqorl"; | |
164 | max_check_attempts = "10"; | |
165 | notification_interval = "120"; | |
166 | notification_options = "d,u,r,f"; | |
167 | retry_interval = "1"; | |
168 | }; | |
e820134d IB |
169 | }; |
170 | }; | |
171 | } |