diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-07-17 11:33:57 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-07-17 11:33:57 +0200 |
commit | 3bc32d9ebd9b0900eeef756122ad28f8857f8bfe (patch) | |
tree | ff92459e654fde6fe559dfd383d6a76e05a347cf /modules/private/monitoring/conf | |
parent | e886ea19877fa0d4de32d35939f69e9c18681d59 (diff) | |
download | Nix-3bc32d9ebd9b0900eeef756122ad28f8857f8bfe.tar.gz Nix-3bc32d9ebd9b0900eeef756122ad28f8857f8bfe.tar.zst Nix-3bc32d9ebd9b0900eeef756122ad28f8857f8bfe.zip |
Add monitoring modules via naemon
Diffstat (limited to 'modules/private/monitoring/conf')
-rw-r--r-- | modules/private/monitoring/conf/contacts.cfg | 41 | ||||
-rw-r--r-- | modules/private/monitoring/conf/hosts.cfg | 32 | ||||
-rw-r--r-- | modules/private/monitoring/conf/local_services.cfg | 68 | ||||
-rw-r--r-- | modules/private/monitoring/conf/notify.cfg | 8 | ||||
-rw-r--r-- | modules/private/monitoring/conf/objects.cfg | 84 | ||||
-rw-r--r-- | modules/private/monitoring/conf/services.cfg | 27 | ||||
-rw-r--r-- | modules/private/monitoring/conf/timeperiods.cfg | 15 |
7 files changed, 275 insertions, 0 deletions
diff --git a/modules/private/monitoring/conf/contacts.cfg b/modules/private/monitoring/conf/contacts.cfg new file mode 100644 index 0000000..e088f69 --- /dev/null +++ b/modules/private/monitoring/conf/contacts.cfg | |||
@@ -0,0 +1,41 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | # CONTACT GROUPS | ||
4 | define contactgroup { | ||
5 | contactgroup_name admins | ||
6 | alias Naemon Administrators | ||
7 | # members immae | ||
8 | } | ||
9 | |||
10 | # No contact, we go through master | ||
11 | # define contact { | ||
12 | # contact_name immae | ||
13 | # alias Immae | ||
14 | # use generic-contact | ||
15 | # email ismael@bouya.org | ||
16 | # } | ||
17 | # | ||
18 | # define contact { | ||
19 | # name generic-contact | ||
20 | # host_notification_commands notify-host-by-email | ||
21 | # host_notification_options d,u,r,f,s | ||
22 | # host_notification_period 24x7 | ||
23 | # register 0 | ||
24 | # service_notification_commands notify-service-by-email | ||
25 | # service_notification_options w,u,c,r,f,s | ||
26 | # service_notification_period 24x7 | ||
27 | # } | ||
28 | # | ||
29 | # define command { | ||
30 | # command_name notify-host-by-email | ||
31 | # command_line SERVICENOTIFICATIONID="$SERVICENOTIFICATIONID$" HOSTSTATE="$HOSTSTATE$" HOSTOUTPUT="$HOSTOUTPUT$" $USER2$/notify_by_email host "$NOTIFICATIONTYPE$" "$HOSTALIAS$" "$LONGDATETIME$" "$CONTACTEMAIL$" $OVE | ||
32 | # #$OVE is to force naemon to run via shell instead of execve which fails here | ||
33 | # } | ||
34 | # | ||
35 | # # 'notify-service-by-email' command definition | ||
36 | # define command { | ||
37 | # command_name notify-service-by-email | ||
38 | # command_line SERVICENOTIFICATIONID="$SERVICENOTIFICATIONID$" SERVICEDESC="$SERVICEDESC$" SERVICESTATE="$SERVICESTATE$" SERVICEOUTPUT="$SERVICEOUTPUT$" $USER2$/notify_by_email service "$NOTIFICATIONTYPE$" "$HOSTALIAS$" "$LONGDATETIME$" "$CONTACTEMAIL$" $OVE | ||
39 | # # command_line sudo /usr/bin/strace -o /tmp/foo -vf -s 256 -u naemon $USER2$/notify_by_email | ||
40 | # #$OVE is to force naemon to run via shell instead of execve which fails here | ||
41 | # } | ||
diff --git a/modules/private/monitoring/conf/hosts.cfg b/modules/private/monitoring/conf/hosts.cfg new file mode 100644 index 0000000..d903b0a --- /dev/null +++ b/modules/private/monitoring/conf/hosts.cfg | |||
@@ -0,0 +1,32 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | define host { | ||
4 | name generic-host | ||
5 | event_handler_enabled 1 | ||
6 | flap_detection_enabled 1 | ||
7 | notification_period 24x7 | ||
8 | notifications_enabled 1 | ||
9 | process_perf_data 1 | ||
10 | register 0 | ||
11 | retain_nonstatus_information 1 | ||
12 | retain_status_information 1 | ||
13 | } | ||
14 | |||
15 | define host { | ||
16 | name linux-server | ||
17 | use generic-host | ||
18 | check_command check-host-alive | ||
19 | check_interval 5 | ||
20 | check_period 24x7 | ||
21 | contact_groups admins | ||
22 | max_check_attempts 10 | ||
23 | notification_interval 120 | ||
24 | notification_options d,u,r,f | ||
25 | register 0 | ||
26 | retry_interval 1 | ||
27 | } | ||
28 | |||
29 | define command { | ||
30 | command_name check-host-alive | ||
31 | command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 | ||
32 | } | ||
diff --git a/modules/private/monitoring/conf/local_services.cfg b/modules/private/monitoring/conf/local_services.cfg new file mode 100644 index 0000000..56bc8f6 --- /dev/null +++ b/modules/private/monitoring/conf/local_services.cfg | |||
@@ -0,0 +1,68 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | # System usage | ||
4 | define service { | ||
5 | service_description Size on root partition | ||
6 | use local-service | ||
7 | check_command check_local_disk!20%!10%!/ | ||
8 | } | ||
9 | define command { | ||
10 | command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ | ||
11 | command_name check_local_disk | ||
12 | } | ||
13 | |||
14 | define service { | ||
15 | service_description Total number of process | ||
16 | use local-service | ||
17 | check_command check_local_procs!250!400!RSZDT | ||
18 | } | ||
19 | define command { | ||
20 | command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ | ||
21 | command_name check_local_procs | ||
22 | } | ||
23 | |||
24 | define service { | ||
25 | service_description Average load | ||
26 | use local-service | ||
27 | check_command check_local_load!8.0,8.0,8.0!10.0,10.0,10.0 | ||
28 | } | ||
29 | define command { | ||
30 | command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ | ||
31 | command_name check_local_load | ||
32 | } | ||
33 | |||
34 | define service { | ||
35 | service_description Swap usage | ||
36 | use local-service | ||
37 | check_command check_local_swap!20!10 | ||
38 | } | ||
39 | define command { | ||
40 | command_line $USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$ | ||
41 | command_name check_local_swap | ||
42 | } | ||
43 | |||
44 | define service { | ||
45 | service_description Memory usage | ||
46 | use local-service | ||
47 | check_command check_memory!80!90 | ||
48 | } | ||
49 | define command { | ||
50 | command_line $USER2$/check_mem.sh -w $ARG1$ -c $ARG2$ | ||
51 | command_name check_memory | ||
52 | } | ||
53 | |||
54 | define command { | ||
55 | command_line $USER2$/check_command -c "$ARG1$" -s 0 -o "$ARG2$" $ARG3$ | ||
56 | command_name check_command_output | ||
57 | } | ||
58 | |||
59 | # Network dependent local services | ||
60 | define service { | ||
61 | service_description NTP is activated and working | ||
62 | use local-service | ||
63 | check_command check_ntp | ||
64 | } | ||
65 | define command { | ||
66 | command_line $USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org | ||
67 | command_name check_ntp | ||
68 | } | ||
diff --git a/modules/private/monitoring/conf/notify.cfg b/modules/private/monitoring/conf/notify.cfg new file mode 100644 index 0000000..63b380d --- /dev/null +++ b/modules/private/monitoring/conf/notify.cfg | |||
@@ -0,0 +1,8 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | define command { | ||
4 | command_line /etc/naemon/send_nrdp.sh -H "$HOSTADDRESS$" -s "$SERVICEDESC$" -S "$SERVICESTATEID$" -o "$SERVICEOUTPUT$" | ||
5 | command_name notify-master | ||
6 | } | ||
7 | |||
8 | |||
diff --git a/modules/private/monitoring/conf/objects.cfg b/modules/private/monitoring/conf/objects.cfg new file mode 100644 index 0000000..653477f --- /dev/null +++ b/modules/private/monitoring/conf/objects.cfg | |||
@@ -0,0 +1,84 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | define command { | ||
4 | command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 | ||
5 | command_name check-host-alive | ||
6 | } | ||
7 | |||
8 | define command { | ||
9 | command_line $USER2$/check_md_raid | ||
10 | command_name check_md_raid | ||
11 | } | ||
12 | |||
13 | define command { | ||
14 | command_line $USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$ | ||
15 | command_name check_command_output | ||
16 | } | ||
17 | |||
18 | |||
19 | define command { | ||
20 | command_line /usr/bin/sudo -u postgres $USER2$/check_postgres_replication "$ARG1$" "$ARG2$" "$ARG3$" | ||
21 | command_name check_postgresql_replication | ||
22 | } | ||
23 | |||
24 | define service { | ||
25 | ## --PUPPET_NAME-- (called '_naginator_name' in the manifest) Databases are present in postgresql | ||
26 | active_checks_enabled 1 | ||
27 | check_command check_command_output!psql -c 'select nspname from pg_catalog.pg_namespace'!public!-r postgres | ||
28 | check_freshness 0 | ||
29 | check_interval 5 | ||
30 | check_period 24x7 | ||
31 | contact_groups admins | ||
32 | event_handler_enabled 1 | ||
33 | flap_detection_enabled 1 | ||
34 | host_name caldance-1.v.immae.eu | ||
35 | is_volatile 0 | ||
36 | max_check_attempts 4 | ||
37 | notification_interval 60 | ||
38 | notification_options w,u,c,r | ||
39 | notification_period 24x7 | ||
40 | notifications_enabled 0 | ||
41 | obsess_over_service 1 | ||
42 | passive_checks_enabled 1 | ||
43 | process_perf_data 1 | ||
44 | retain_nonstatus_information 1 | ||
45 | retain_status_information 1 | ||
46 | retry_interval 1 | ||
47 | service_description Databases are present in postgresql | ||
48 | } | ||
49 | |||
50 | define command { | ||
51 | command_line $USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$" | ||
52 | command_name check_last_file_date | ||
53 | } | ||
54 | |||
55 | define command { | ||
56 | command_line $USER2$/check_date "$ARG1$" "$ARG2$" "$ARG3$" | ||
57 | command_name check_date | ||
58 | } | ||
59 | |||
60 | define service { | ||
61 | ## --PUPPET_NAME-- (called '_naginator_name' in the manifest) Postgresql replication for backup-1 is up to date | ||
62 | active_checks_enabled 1 | ||
63 | check_command check_postgresql_replication!backup-1!/run/postgresql!5432 | ||
64 | check_freshness 0 | ||
65 | check_interval 5 | ||
66 | check_period 24x7 | ||
67 | contact_groups admins | ||
68 | event_handler_enabled 1 | ||
69 | flap_detection_enabled 1 | ||
70 | host_name caldance-1.v.immae.eu | ||
71 | is_volatile 0 | ||
72 | max_check_attempts 4 | ||
73 | notification_interval 60 | ||
74 | notification_options w,u,c,r | ||
75 | notification_period 24x7 | ||
76 | notifications_enabled 0 | ||
77 | obsess_over_service 1 | ||
78 | passive_checks_enabled 1 | ||
79 | process_perf_data 1 | ||
80 | retain_nonstatus_information 1 | ||
81 | retain_status_information 1 | ||
82 | retry_interval 1 | ||
83 | service_description Postgresql replication for backup-1 is up to date | ||
84 | } | ||
diff --git a/modules/private/monitoring/conf/services.cfg b/modules/private/monitoring/conf/services.cfg new file mode 100644 index 0000000..0740dc7 --- /dev/null +++ b/modules/private/monitoring/conf/services.cfg | |||
@@ -0,0 +1,27 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | define service { | ||
4 | name generic-service | ||
5 | active_checks_enabled 1 | ||
6 | check_freshness 0 | ||
7 | check_interval 10 | ||
8 | check_period 24x7 | ||
9 | contact_groups admins | ||
10 | event_handler_enabled 1 | ||
11 | flap_detection_enabled 1 | ||
12 | is_volatile 0 | ||
13 | max_check_attempts 3 | ||
14 | notification_interval 60 | ||
15 | notification_options w,u,c,r,f | ||
16 | notification_period 24x7 | ||
17 | # no notification since we send them to master | ||
18 | notifications_enabled 0 | ||
19 | obsess_over_service 1 | ||
20 | passive_checks_enabled 1 | ||
21 | process_perf_data 1 | ||
22 | register 0 | ||
23 | retain_nonstatus_information 1 | ||
24 | retain_status_information 1 | ||
25 | retry_interval 2 | ||
26 | } | ||
27 | |||
diff --git a/modules/private/monitoring/conf/timeperiods.cfg b/modules/private/monitoring/conf/timeperiods.cfg new file mode 100644 index 0000000..5ffe4ca --- /dev/null +++ b/modules/private/monitoring/conf/timeperiods.cfg | |||
@@ -0,0 +1,15 @@ | |||
1 | # vim: filetype=nagios | ||
2 | |||
3 | define timeperiod { | ||
4 | alias 24 Hours A Day, 7 Days A Week | ||
5 | friday 00:00-24:00 | ||
6 | monday 00:00-24:00 | ||
7 | saturday 00:00-24:00 | ||
8 | sunday 00:00-24:00 | ||
9 | thursday 00:00-24:00 | ||
10 | timeperiod_name 24x7 | ||
11 | tuesday 00:00-24:00 | ||
12 | wednesday 00:00-24:00 | ||
13 | } | ||
14 | |||
15 | |||