X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fobjects_common.nix;h=10cc1495e0c5703c9471c65fbe025fca958b76c6;hb=c41d0de83b1841097c6be8d8baeed557b065657b;hp=2585c389cd7343bf495b9b93f8b4c439542bc71e;hpb=a97118c489a59d723538292214efaa10dfcb96df;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/objects_common.nix b/modules/private/monitoring/objects_common.nix index 2585c38..10cc149 100644 --- a/modules/private/monitoring/objects_common.nix +++ b/modules/private/monitoring/objects_common.nix @@ -1,9 +1,14 @@ { hostFQDN , hostName +, interface ? "eth0" , processWarn ? "250" , processAlert ? "400" -, loadWarn ? "8.0" -, loadAlert ? "10.0" +, loadWarn ? "0.9" +, load5Warn ? loadWarn +, load15Warn ? load5Warn +, loadAlert ? "1.0" +, load5Alert ? loadAlert +, load15Alert ? load5Alert , mdadm , sudo , master @@ -29,6 +34,7 @@ in use = "linux-server"; hostgroups = "webstatus-hosts"; _webstatus_name = hostName; + _webstatus_vhost = "status.immae.eu"; }; }; service = [ @@ -49,14 +55,28 @@ in "RSZDT" ]; } + { + passiveInfo = defaultPassiveInfo; + service_description = "Network bandwidth"; + use = "local-service"; + check_interval = "2"; + max_check_attempts = "20"; + retry_interval = "2"; + check_command = [ + "check_local_bandwidth" + interface + "20480" # kb/s + "51200" # kb/s + ]; + } { passiveInfo = defaultPassiveInfo; service_description = "Average load"; use = "local-service"; check_command = [ "check_local_load" - "${loadWarn},${loadWarn},${loadWarn}" - "${loadAlert},${loadAlert},${loadAlert}" + "${loadWarn},${load5Warn},${load15Warn}" + "${loadAlert},${load5Alert},${load15Alert}" ]; } { @@ -93,7 +113,9 @@ in check_dns = "$USER1$/check_dns -H $ARG1$ -s $HOSTADDRESS$ $ARG2$"; check_emails = "$USER2$/check_emails -H $HOSTADDRESS$ -i $USER203$ -l $ARG1$ -p $ARG2$ -s $ARG3$ -f $ARG4$"; check_emails_local = "$USER2$/check_emails -H $HOSTADDRESS$ -n $ARG1$ -r $ADMINEMAIL$ -s $ARG2$ -f $ARG3$"; - check_eriomem = "$USER2$/check_eriomem $USER208$"; + check_backup_eriomem = "$USER2$/check_eriomem $USER208$"; + check_backup_eriomem_age = "$USER2$/check_backup_eriomem_age $ARG1$"; + check_backup_ovh_age = "$USER2$/check_backup_ovh_age $ARG1$"; check_external_dns = "$USER1$/check_dns -H $ARG2$ -s $ARG1$ $ARG3$"; check_ftp_database = "$USER2$/check_ftp_database"; check_git = "$USER2$/check_git $USER203$"; @@ -105,14 +127,16 @@ in check_imap_connection = "$USER2$/check_imap_connection -u \"$USER204$\" -p \"$USER205$\" -H \"imap.immae.eu:143\""; check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$"; check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$"; - check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$"; + check_local_load = "$USER1$/check_load -r -w $ARG1$ -c $ARG2$"; check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$"; + check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$"; check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$"; check_command_match = "$USER2$/check_command -c \"$ARG1$\" -C \"$ARG2$\" $ARG3$"; check_command_output = "$USER2$/check_command -c \"$ARG1$\" -s 0 -o \"$ARG2$\" $ARG3$"; check_command_status = "$USER2$/check_command -c \"$ARG1$\" -s \"$ARG2$\" $ARG3$"; check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org"; check_mailq = "$USER1$/check_mailq -s -w 1 -c 2"; + check_megaraid = "$USER2$/check_megaraid_sas --sudo"; check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\""; check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\""; check_openldap_replication = "${sudo} -u openldap $USER2$/check_openldap_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\" \"$ARG4$\" \"$ARG5$\""; @@ -121,6 +145,7 @@ in check_smtp = "$USER1$/check_smtp -H $HOSTADDRESS$ -p 25 -S -D 21,15"; check_tcp = "$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -e \"$ARG2$\" -Mcrit"; check_tcp_ssl = "$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -S -D 21,15"; + check_zfs = "$USER2$/check_zpool.sh -p ALL -w 80 -c 90"; check_host_alive = "$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5"; check_last_file_date = "${sudo} -u \"$ARG3$\" $USER2$/check_last_file_date \"$ARG1$\" \"$ARG2$\""; @@ -132,6 +157,8 @@ in # $OVE is to force naemon to run via shell instead of execve which fails here notify-service-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_email service \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE"; notify-by-slack = "HOST=\"$HOSTALIAS$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_slack \"$ARG1$\" \"$ARG2$\""; + notify-host-eban-url = "STATUS_NAME=\"Server\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" HOSTSTATE=\"$HOSTSTATE$\" $USER2$/notify_eban_url"; + notify-service-eban-url = "STATUS_NAME=\"$_SERVICEWEBSTATUS_NAME$\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" SERVICESTATE=\"$SERVICESTATE$\" $USER2$/notify_eban_url"; notify-master = "$USER2$/send_nrdp.sh -u \"$USER200$\" -t \"$USER201$\" -H \"$HOSTADDRESS$\" -s \"$SERVICEDESC$\" -S \"$SERVICESTATEID$\" -o \"$SERVICEOUTPUT$ | $SERVICEPERFDATA$\""; }; @@ -160,7 +187,7 @@ in webstatus-backup = { alias = "Backup resources"; }; }; hostgroup = { - webstatus-hosts = { alias = "Hosts"; }; + webstatus-hosts = { alias = "Hosts"; }; }; contactgroup = { admins = { alias = "Naemon Administrators"; }; @@ -187,6 +214,7 @@ in retain_nonstatus_information = "1"; retain_status_information = "1"; retry_interval = "2"; + _webstatus_namespace = "immae"; }; local-service = { use = "generic-service"; @@ -258,6 +286,7 @@ in notification_interval = "120"; notification_options = "d,u,r,f"; retry_interval = "1"; + _webstatus_namespace = "immae"; }; }; };