X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fobjects_common.nix;h=7c9f6420e13fa1edfebff3239e08fd28678c0b02;hb=acab8301f6a0a76d97b36d009a60d4172bf62981;hp=7f553a0044b734caf3975036133ddbf6e4f68604;hpb=6ee7783682e977f3ceebfb5a8ee8ddd1db3f7cc6;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/objects_common.nix b/modules/private/monitoring/objects_common.nix index 7f553a0..7c9f642 100644 --- a/modules/private/monitoring/objects_common.nix +++ b/modules/private/monitoring/objects_common.nix @@ -3,16 +3,16 @@ , interface ? "eth0" , processWarn ? "250" , processAlert ? "400" -, loadWarn ? "8.0" +, loadWarn ? "0.9" , load5Warn ? loadWarn , load15Warn ? load5Warn -, loadAlert ? "10.0" +, loadAlert ? "1.0" , load5Alert ? loadAlert , load15Alert ? load5Alert , mdadm -, sudo , master , lib +, mypluginsConfig , ... }: let @@ -34,6 +34,7 @@ in use = "linux-server"; hostgroups = "webstatus-hosts"; _webstatus_name = hostName; + _webstatus_vhost = "status.immae.eu"; }; }; service = [ @@ -108,55 +109,18 @@ in ]; } ]; - command = { - 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_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$"; - check_http = "$USER1$/check_http --sni -f stickyport -H \"$ARG1$\" -u \"$ARG2$\" -r \"$ARG3$\""; - check_https = "$USER1$/check_http --sni --ssl -f stickyport -H \"$ARG1$\" -u \"$ARG2$\" -r \"$ARG3$\""; - check_https_auth = "$USER1$/check_http --sni --ssl -a \"$USER202$\" -f stickyport -H \"$ARG1$\" -u \"$ARG2$\" -r \"$ARG3$\""; - check_https_certificate = "$USER1$/check_http --sni --ssl -H \"$ARG1$\" -C 21,15"; - check_https_code = "$USER1$/check_http --sni --ssl -f stickyport -H \"$ARG1$\" -u \"$ARG2$\" -e \"$ARG3$\" -r \"$ARG4$\""; - check_imap_connection = "$USER2$/check_imap_connection -u \"$USER204$\" -p \"$USER205$\" -H \"imap.immae.eu:143\""; + command = lib.foldr (v: o: o // (v.commands or {})) {} (builtins.attrValues mypluginsConfig) // { 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_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$\""; - check_ovh_sms = "$USER2$/check_ovh_sms \"$USER209$\""; - check_redis_replication = "${sudo} -u redis $USER2$/check_redis_replication \"$ARG1$\""; 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"; 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$\""; check_ok = "$USER1$/check_dummy 0 \"Dummy OK\""; check_critical = "$USER1$/check_dummy 2 \"Dummy CRITICAL\""; - - # $OVE is to force naemon to run via shell instead of execve which fails here - notify-host-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" HOSTSTATE=\"$HOSTSTATE$\" HOSTOUTPUT=\"$HOSTOUTPUT$\" $USER2$/notify_by_email host \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE"; - # $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-master = "$USER2$/send_nrdp.sh -u \"$USER200$\" -t \"$USER201$\" -H \"$HOSTADDRESS$\" -s \"$SERVICEDESC$\" -S \"$SERVICESTATEID$\" -o \"$SERVICEOUTPUT$ | $SERVICEPERFDATA$\""; }; timeperiod = { "24x7" = { @@ -183,7 +147,7 @@ in webstatus-backup = { alias = "Backup resources"; }; }; hostgroup = { - webstatus-hosts = { alias = "Hosts"; }; + webstatus-hosts = { alias = "Hosts"; }; }; contactgroup = { admins = { alias = "Naemon Administrators"; }; @@ -210,6 +174,7 @@ in retain_nonstatus_information = "1"; retain_status_information = "1"; retry_interval = "2"; + _webstatus_namespace = "immae"; }; local-service = { use = "generic-service"; @@ -281,6 +246,7 @@ in notification_interval = "120"; notification_options = "d,u,r,f"; retry_interval = "1"; + _webstatus_namespace = "immae"; }; }; };