diff --git a/CHANGELOG.md b/CHANGELOG.md index d332ec7d..4f6fe59a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ The **patch** part changes is incremented if multiple releases happen the same m * webapps/nextcloud: Add condition for archive tasks * fail2ban: add script unban_ip * check_free_space: added role +* nagios-nrpe: new check_pressure_{cpu,io,mem} +* generateldif: new Services for check_pressure_{cpu,io,mem} ### Changed diff --git a/generate-ldif/templates/generateldif.sh.j2 b/generate-ldif/templates/generateldif.sh.j2 index 75eedfb4..39fc30cf 100755 --- a/generate-ldif/templates/generateldif.sh.j2 +++ b/generate-ldif/templates/generateldif.sh.j2 @@ -14,6 +14,7 @@ get_pkg_version() { sed 's/[~+-].\+//' | sed 's/.\+://' | sed 's/p.*//' | cut -d'.' -f1,2 } +debianVersion=$(cut -d "." -f 1 < /etc/debian_version) clientNumber="{{ client_number | mandatory }}" monitoringMode="{{ monitoring_mode | mandatory }}" monitoringType="{{ monitoring_type | mandatory }}" @@ -763,6 +764,32 @@ ServiceVersion: Undefined EOT fi +# Check pressure +if [ "${debianVersion}" -ge 12 ]; then + cat <> "${ldif_file}" + +dn: ServiceName=pressure_cpu,${computer_dn} +objectClass: EvoService +NagiosEnabled: TRUE +ServiceName: pressure_cpu +ServiceType: pressure +ServiceVersion: Undefined + +dn: ServiceName=pressure_io,${computer_dn} +objectClass: EvoService +NagiosEnabled: TRUE +ServiceName: pressure_io +ServiceType: pressure +ServiceVersion: Undefined + +dn: ServiceName=pressure_mem,${computer_dn} +objectClass: EvoService +NagiosEnabled: TRUE +ServiceName: pressure_mem +ServiceType: pressure +ServiceVersion: Undefined +EOT +fi # test if we have a stdout if [ -t 1 ]; then diff --git a/nagios-nrpe/templates/evolix.cfg.j2 b/nagios-nrpe/templates/evolix.cfg.j2 index 66ecc51a..1f39bcff 100644 --- a/nagios-nrpe/templates/evolix.cfg.j2 +++ b/nagios-nrpe/templates/evolix.cfg.j2 @@ -90,6 +90,9 @@ command[check_php-fpm82]=sudo {{ nagios_plugins_directory }}/check_phpfpm_multi command[check_php-fpm83]=sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php83/rootfs/etc/php/8.3/fpm/pool.d/ command[check_dhcp_pool]={{ nagios_plugins_directory }}/check_dhcp_pool command[check_ssl_local]={{ nagios_plugins_directory }}/check_ssl_local +command[check_pressure_cpu]=/usr/lib/nagios/plugins/check_pressure --cpu -w 100000 -c 500000 +command[check_pressure_mem]=/usr/lib/nagios/plugins/check_pressure --mem -w 100000 -c 500000 +command[check_pressure_io]=/usr/lib/nagios/plugins/check_pressure --io -w 100000 -c 500000 # Check HTTP "many". Use this to check many websites (http, https, ports, sockets and SSL certificates). # Beware! All checks must not take more than 10s!