From e016dc6130d8eba453ec016ddc68bb63c87131a4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Sep 2022 11:45:51 +0200 Subject: [PATCH] Nagios 2 --- Sio2/CYBER/10-Nagios/cgi.cfg | 2 +- Sio2/CYBER/10-Nagios/localhost.cfg | 37 ++++++++++++++++++++++++++---- Sio2/CYBER/10-Nagios/nagios.cfg | 1 + 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Sio2/CYBER/10-Nagios/cgi.cfg b/Sio2/CYBER/10-Nagios/cgi.cfg index 593c1a0..783e042 100644 --- a/Sio2/CYBER/10-Nagios/cgi.cfg +++ b/Sio2/CYBER/10-Nagios/cgi.cfg @@ -73,7 +73,7 @@ use_pending_states=1 # authentication (bad idea), while any other value will make them # use the authentication functions (the default). -use_authentication=0 +use_authentication=1 diff --git a/Sio2/CYBER/10-Nagios/localhost.cfg b/Sio2/CYBER/10-Nagios/localhost.cfg index c25001b..a4f10f5 100644 --- a/Sio2/CYBER/10-Nagios/localhost.cfg +++ b/Sio2/CYBER/10-Nagios/localhost.cfg @@ -42,7 +42,7 @@ define hostgroup { hostgroup_name linux-servers ; The name of the hostgroup alias Linux Servers ; Long name of the group - members localhost, srv, gwsio5 ; Comma separated list of hosts that belong to this group + members localhost, srv, gwsio5, ns ; Comma separated list of hosts that belong to this group } @@ -58,9 +58,11 @@ define hostgroup { define service { use local-service ; Name of service template to use - host_name localhost + hostgroup_name linux-servers service_description PING check_command check_ping!100.0,20%!500.0,60% + notifications_enabled 1 + } @@ -142,7 +144,7 @@ define service { hostgroup_name linux-servers service_description SSH check_command check_ssh - notifications_enabled 0 + notifications_enabled 1 } @@ -153,9 +155,34 @@ define service { define service { use local-service ; Name of service template to use - host_name localhost + #host_name localhost hostgroup_name linux-servers service_description HTTP check_command check_http - notifications_enabled 0 + notifications_enabled 1 } + + +define service { + + use generic-service ;Use generic-service template + hostgroup_name linux-servers ; S'applique au groupe en question + service_description chk-lin-load ; Nom du service + check_command check_lin_load!public!--v2c!netsl!3,2,2!3,2,2 ; Command +} + +define service { + + use generic-service ;Use generic-service template + hostgroup_name linux-servers ; S'applique au groupe en question + service_description chk-lin-mem ; Nom du service + check_command check_lin_mem!public!--v2c!70%,80%!90%,95% ; Command +} + + +define service{ + use generic-service + hostgroup_name linux-servers + service_description chk-dns-ext + check_command check_dns_ext + } diff --git a/Sio2/CYBER/10-Nagios/nagios.cfg b/Sio2/CYBER/10-Nagios/nagios.cfg index bf74c7a..153f634 100644 --- a/Sio2/CYBER/10-Nagios/nagios.cfg +++ b/Sio2/CYBER/10-Nagios/nagios.cfg @@ -46,6 +46,7 @@ cfg_file=/etc/nagios4/objects/templates.cfg cfg_file=/etc/nagios4/objects/localhost.cfg cfg_file=/etc/nagios4/objects/srv.cfg cfg_file=/etc/nagios4/objects/gwsio5.cfg +cfg_file=/etc/nagios4/objects/ns.cfg # Definitions for monitoring a Windows machine #cfg_file=/etc/nagios4/objects/windows.cfg