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