From 02051a2923590ccae08deac14619a950005cfaf7 Mon Sep 17 00:00:00 2001 From: Johan Wassberg Date: Mon, 15 Jan 2024 14:30:20 +0100 Subject: [PATCH] Handle 22.04 new syntax --- global/overlay/etc/puppet/manifests/cosmos-site.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp index a607da56..ad6cb820 100644 --- a/global/overlay/etc/puppet/manifests/cosmos-site.pp +++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp @@ -816,8 +816,16 @@ class nrpe { if ($::operatingsystem == 'Ubuntu' and $::operatingsystemrelease < '18.04') { package {'nagios-plugins-extra': ensure => latest} } - sunet::nagios::nrpe_command {'check_memory': - command_line => '/usr/lib/nagios/plugins/check_memory -w 10% -c 5%' + + if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '22.04') >= 0 ){ + $mem_w = '90' + $mem_c = '95' + } else { + $mem_w = '10' + $mem_c = '5' + } + sunet::nagios::nrpe_command { 'check_memory': + command_line => "/usr/lib/nagios/plugins/check_memory -w ${mem_w}% -c ${mem_c}%" } sunet::nagios::nrpe_command {'check_mem': command_line => '/usr/lib/nagios/plugins/check_memory -w 10% -c 5%'