nagios-nrpe, generateldif: new check_pressure_{cpu,io,mem}
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2696|5|2691|6|:+1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/464//ansiblelint">Evolix » ansible-roles » unstable #464</a>
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
William Hirigoyen 2024-01-31 18:04:11 +01:00
parent 393c1f4ff1
commit d67e2b122f
3 changed files with 32 additions and 0 deletions

View file

@ -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

View file

@ -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 <<EOT >> "${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

View file

@ -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!