forked from evolix/ansible-roles
nagios-nrpe, generateldif: new check_pressure_{cpu,io,mem}
This commit is contained in:
parent
393c1f4ff1
commit
d67e2b122f
|
@ -31,6 +31,8 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
||||||
* webapps/nextcloud: Add condition for archive tasks
|
* webapps/nextcloud: Add condition for archive tasks
|
||||||
* fail2ban: add script unban_ip
|
* fail2ban: add script unban_ip
|
||||||
* check_free_space: added role
|
* check_free_space: added role
|
||||||
|
* nagios-nrpe: new check_pressure_{cpu,io,mem}
|
||||||
|
* generateldif: new Services for check_pressure_{cpu,io,mem}
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ get_pkg_version() {
|
||||||
sed 's/[~+-].\+//' | sed 's/.\+://' | sed 's/p.*//' | cut -d'.' -f1,2
|
sed 's/[~+-].\+//' | sed 's/.\+://' | sed 's/p.*//' | cut -d'.' -f1,2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debianVersion=$(cut -d "." -f 1 < /etc/debian_version)
|
||||||
clientNumber="{{ client_number | mandatory }}"
|
clientNumber="{{ client_number | mandatory }}"
|
||||||
monitoringMode="{{ monitoring_mode | mandatory }}"
|
monitoringMode="{{ monitoring_mode | mandatory }}"
|
||||||
monitoringType="{{ monitoring_type | mandatory }}"
|
monitoringType="{{ monitoring_type | mandatory }}"
|
||||||
|
@ -763,6 +764,32 @@ ServiceVersion: Undefined
|
||||||
EOT
|
EOT
|
||||||
fi
|
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
|
# test if we have a stdout
|
||||||
if [ -t 1 ]; then
|
if [ -t 1 ]; then
|
||||||
|
|
|
@ -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_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_dhcp_pool]={{ nagios_plugins_directory }}/check_dhcp_pool
|
||||||
command[check_ssl_local]={{ nagios_plugins_directory }}/check_ssl_local
|
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).
|
# 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!
|
# Beware! All checks must not take more than 10s!
|
||||||
|
|
Loading…
Reference in a new issue