Re: Freeze break request: teach nagios about noswap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 07, 2017 at 04:41:11PM -0700, Kevin Fenzi wrote:
> Greetings. 
> 
> We currently have 7 hosts in nagios that are alerting about swap. 6 of them are osbs* ones. The new OpenShift 3.6 actually disables swap on all nodes, so these will alert forever, also more will as we roll 3.6 into production. 
> 
> Also, there's mailman01 that often gets low swap because it gets a bunch of requests, swaps out things it isn't using and then frees the memory (but never swaps back in). 
> 
> This patch sets a nagios.swap value which is defined in group_vars/all as true, and set to false in all the places we don't want to check swap.
> 
> Should be pretty easy to back out if it causes any issues. 
> 
> +1s?

+1 for me as well.

Pierre


> --
> diff --git a/inventory/group_vars/all b/inventory/group_vars/all
> index e18af2f..18b9db5 100644
> --- a/inventory/group_vars/all
> +++ b/inventory/group_vars/all
> @@ -261,6 +261,7 @@ nagios_Check_Services:
>    named: false
>    dhcpd: false
>    httpd: false
> +  swap: true
>  
>  # Set variable if we want to use our global iptables defaults
>  # Some things need to set their own.
> diff --git a/inventory/group_vars/builders b/inventory/group_vars/builders
> index 8fea99e..c22c387 100644
> --- a/inventory/group_vars/builders
> +++ b/inventory/group_vars/builders
> @@ -1,5 +1,7 @@
>  ---
>  # nagios items
>  # We don't use nrpe to check any of the builders
> +# Nor do we check swap there.
>  nagios_Check_Services:
>    nrpe: false
> +  swap: false
> diff --git a/inventory/group_vars/builders-stg b/inventory/group_vars/builders-stg
> index 8fea99e..c22c387 100644
> --- a/inventory/group_vars/builders-stg
> +++ b/inventory/group_vars/builders-stg
> @@ -1,5 +1,7 @@
>  ---
>  # nagios items
>  # We don't use nrpe to check any of the builders
> +# Nor do we check swap there.
>  nagios_Check_Services:
>    nrpe: false
> +  swap: false
> diff --git a/inventory/group_vars/cloud b/inventory/group_vars/cloud
> index abc2282..4af9dfb 100644
> --- a/inventory/group_vars/cloud
> +++ b/inventory/group_vars/cloud
> @@ -1,4 +1,5 @@
>  ---
>  nagios_Check_Services: 
>    nrpe: false
> +  swap: false
>  datacenter: cloud
> diff --git a/inventory/group_vars/mailman b/inventory/group_vars/mailman
> index 41dd8cd..f54b474 100644
> --- a/inventory/group_vars/mailman
> +++ b/inventory/group_vars/mailman
> @@ -63,3 +63,5 @@ nrpe_check_postfix_queue_crit: 200
>  nrpe_procs_warn: 300
>  nrpe_procs_crit: 500
>  
> +nagios_Check_Services:
> +  swap: false
> diff --git a/inventory/host_vars/mirrorlist-host1plus.fedoraproject.org b/inventory/host_vars/mirrorlist-host1plus.fedoraproject.org
> index ebd6151..c2e4532 100644
> --- a/inventory/host_vars/mirrorlist-host1plus.fedoraproject.org
> +++ b/inventory/host_vars/mirrorlist-host1plus.fedoraproject.org
> @@ -2,3 +2,11 @@
>  # This is now a cloud instance provided by host1plus
>  # vmhost: none
>  datacenter: host1plus
> +
> +nagios_Check_Services:
> +  nrpe: true
> +  sshd: true
> +  named: false
> +  dhcpd: false
> +  httpd: true
> +  swap: false
> diff --git a/inventory/host_vars/proxy05.fedoraproject.org b/inventory/host_vars/proxy05.fedoraproject.org
> index 8efd950..fae19fd 100644
> --- a/inventory/host_vars/proxy05.fedoraproject.org
> +++ b/inventory/host_vars/proxy05.fedoraproject.org
> @@ -16,3 +16,11 @@ dns: 8.8.8.8
>  eth0_ip: 185.141.165.254
>  eth0_nm: 255.255.254.0
>  vpn: true
> +
> +nagios_Check_Services:
> +  nrpe: true
> +  sshd: true
> +  named: false
> +  dhcpd: false
> +  httpd: true
> +  swap: false
> diff --git a/roles/nagios_server/templates/nagios/hostgroups/checkswap.cfg.j2 b/roles/nagios_server/templates/nagios/hostgroups/checkswap.cfg.j2
> index 9f5bd8c..7da2328 100644
> --- a/roles/nagios_server/templates/nagios/hostgroups/checkswap.cfg.j2
> +++ b/roles/nagios_server/templates/nagios/hostgroups/checkswap.cfg.j2
> @@ -1,6 +1,5 @@
>  define hostgroup {
>          hostgroup_name  CheckSwap
>          alias           Swap-Is-Low
> -	members         *, !status-fedora2, !registry-cdn, !phx2-gw, !ibiblio-gw, !cloud-gw, !bodhost-gw, !coloamer-gw, !dedicated-gw, !host1plus-gw, !internetx-gw, !osuosl-gw, !rdu-gw, !rdu-cc-gw, !tummy-gw, !proxy05.fedoraproject.org, !mirrorlist-host1plus.fedoraproject.org, !download-rdu01.fedoraproject.org, !virthost-rdu01.fedoraproject.org, !fas3-01.stg.phx2.fedoraproject.org, !osbs-control01.phx2.fedoraproject.org, {% for host in groups['builders'] %}!{{host}},{% endfor %} {% for host in groups['builders-stg'] %}!{{host}},{% endfor %} {% for host in groups['cloud'] %}!{{host}}, {% endfor %} {% for host in vars['phx2_management_limited'] %}!{{host}},{% endfor %}  {% for host in vars['phx2_management_hosts'] %}!{{host}}{% if not loop.last %},{% endif %} {% endfor %} 
> -
> +        members         {% for host in groups['all'] %}{% if hostvars[host].nagios_Check_Services['swap'] == true %}{{host}}{% if not loop.last %},{% endif %} {% endfor %}
>  }
> 

Attachment: signature.asc
Description: PGP signature

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux