Can Sensu run a check on only one subscriber in a group?

I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.

Is there any way to run a check on only one subscriber of a group of subscribers?

Thanks,

Steve

This may be a naive question, but is there a leader in your cluster? Often pools/clusters are fronted by a virtual IP to provide failover capability. If your check runs on the Sensu server and uses the “source” attribute (see https://sensuapp.org/docs/latest/clients#jit-clients) and hits the VIP you can use that to gather your metrics. That way if the VIP fails over to another host, you won’t be stuck with a gap in the metrics. #shrug Not knowing anything about your cluster management or configuration, it’s hard to provide more specific advice.

···

On Fri, Sep 11, 2015 at 7:28 PM Steve V steve@digitalnothing.com wrote:

I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.

Is there any way to run a check on only one subscriber of a group of subscribers?

Thanks,

Steve

It is possible to run a check on one subscriber in a group by using round robin client subscriptions. Please see the docs for more information: https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions

···

On Sep 11, 2015 4:28 PM, “Steve V” steve@digitalnothing.com wrote:

I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.

Is there any way to run a check on only one subscriber of a group of subscribers?

Thanks,

Steve

Thanks guys,
I saw the roundrobin option in the docs Glenn linked, but it’s good that you pointed it out Justin for anyone that maybe glosses over it and misses it.

Glenn, no not a naive question. Clusters fronted by HAProxies with a VIP are common in my network. The JIT client is interesting, but I think in this instance the roundrobin works perfectly.

···

On Sat, Sep 12, 2015 at 1:41 AM, Justin Kolberg amd.prophet@gmail.com wrote:

It is possible to run a check on one subscriber in a group by using round robin client subscriptions. Please see the docs for more information: https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions

On Sep 11, 2015 4:28 PM, “Steve V” steve@digitalnothing.com wrote:

I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.

Is there any way to run a check on only one subscriber of a group of subscribers?

Thanks,

Steve

Actually, I wasn’t aware of the roundrobin option; I haven’t kept up with the new features. If I’d known I probably would have suggested it as well as it does appear to suit your use case better. :slight_smile:

···

On Sat, Sep 12, 2015 at 1:41 AM, Justin Kolberg amd.prophet@gmail.com wrote:

It is possible to run a check on one subscriber in a group by using round robin client subscriptions. Please see the docs for more information: https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions

On Sep 11, 2015 4:28 PM, “Steve V” steve@digitalnothing.com wrote:

I have metrics that need to run for a service that is clustered, and running it on each machine in the cluster would produce duplicate metrics data. I would like to eliminate that if possible. I didn’t see anything in the checks documentation that stood out as a way to make this happen. Also, I can’t just set the check to run on one machine because if that machine goes away/down/whatever, then metrics will no longer be gathered unless manual intervention occurs to tell sensu to target a new machine in the cluster.

Is there any way to run a check on only one subscriber of a group of subscribers?

Thanks,

Steve