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