Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: proxy_requests for sensu::check #637

Closed
exeral opened this issue Apr 14, 2017 · 2 comments
Closed

improvement: proxy_requests for sensu::check #637

exeral opened this issue Apr 14, 2017 · 2 comments
Assignees

Comments

@exeral
Copy link

exeral commented Apr 14, 2017

Hello,

sensu::check can be improved with a new attribute: proxy_requests

Since sensu version 0.28.0, there is a new feature called: proxy check requests

Today, there is a workaround by using custom attributes


sensu::check { "remote_http-uchiwa":
    command             => "PATH=/opt/sensu/embedded/bin/:\$PATH check-http.rb -u http://:::address::::3000",
    occurrences         => 2,
    interval            => 300,
    refresh             => 600,
    low_flap_threshold  => 20,
    high_flap_threshold => 60,
    standalone          => false,
    subscribers         => 'poller',
    custom              => {
        'proxy_requests' => {
            'client_attributes' => {
                'subscriptions' => 'eval: value.include?("infra-monitoringwebui")'
            }
        }
    },
}

could be improved by a builtin attribute for sensu::check

example:

sensu::check { "remote_http-uchiwa":
    command             => "PATH=/opt/sensu/embedded/bin/:\$PATH check-http.rb -u http://:::address::::3000",
    occurrences         => 2,
    interval            => 300,
    refresh             => 600,
    low_flap_threshold  => 20,
    high_flap_threshold => 60,
    standalone          => false,
    subscribers         => 'poller',
    proxy_requests	=> {
    	'client_attributes' => {
        	'subscriptions' => 'eval: value.include?("infra-monitoringwebui")'
        }
    },
}

since 'client_attributes' seems a hardcoded and mandatory keyword, it could be included as default
resulting as a simpler attributes like:

    proxy_requests	=> {
    	'subscriptions' => 'eval: value.include?("infra-monitoringwebui")'
    },

sadly, I have no idea how to implement it in sensu/lib/puppet !

Kind regards

@ghoneycutt
Copy link
Collaborator

@crayfishx this should be very similar to f83e3bf where I added a few parameters to match the API.

@jeffmccune jeffmccune self-assigned this Jul 11, 2017
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 11, 2017
Left off setting up an example for proxy request checks using Vagrant.  Pick
back up here following the proxy requests guide:

https://sensuapp.org/docs/0.29/reference/checks.html#proxy-requests-attributes
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 12, 2017
Left off setting up an example for proxy request checks using Vagrant.  Pick
back up here following the proxy requests guide:

https://sensuapp.org/docs/0.29/reference/checks.html#proxy-requests-attributes
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 12, 2017
Without this patch, the [Proxy Check
Requests](https://sensuapp.org/docs/latest/reference/checks.html#proxy-requests-attributes)
functionality must be defined as a custom attribute.  This patch adds
`proxy_requests` as a first class attribute of the `sensu::check` defined type.

The behavior can be exercised with `vagrant up sensu-server`, then applying the
proxy request specific configuration with `vagrant ssh puppet-server sudo
puppet apply -v /vagrant/tests/vagrant/tests/sensu-server-proxy-checks.pp`.

Resolves sensu#637
jeffmccune added a commit to jeffmccune/sensu-puppet that referenced this issue Jul 12, 2017
Without this patch, the [Proxy Check
Requests](https://sensuapp.org/docs/latest/reference/checks.html#proxy-requests-attributes)
functionality must be defined as a custom attribute.  This patch adds
`proxy_requests` as a first class attribute of the `sensu::check` defined type.

The behavior can be exercised with `vagrant up sensu-server`, then applying the
proxy request specific configuration with `vagrant ssh puppet-server sudo
puppet apply -v /vagrant/tests/vagrant/tests/sensu-server-proxy-checks.pp`.

Resolves sensu#637
ghoneycutt added a commit that referenced this issue Jul 12, 2017
@ghoneycutt
Copy link
Collaborator

Thanks for the great explanation @exeral

@jeffmccune has implemented this and it is released in v2.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants