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

**URL:** <https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486>\
**Category:** Sensu Classic (EOL)\
**Created:** [September 11, 2015, 11:28pm UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486 "2015-09-11T23:28:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_V](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Steve\_V](https://discourse.sensu.io/u/Steve_V)\
**Post date:** [September 11, 2015, 11:28pm UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486/1 "2015-09-11T23:28:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Glenn\_McAllister](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@Glenn\_McAllister](https://discourse.sensu.io/u/Glenn_McAllister)\
**Post date:** [September 12, 2015, 1:13am UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486/2 "2015-09-12T01:13:07Z")

</div>

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](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](mailto: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

---

<div class="post-metadata">

**Author:** ![amdprophet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/amdprophet/32/409_2.png) [@amdprophet](https://discourse.sensu.io/u/amdprophet)\
**Post date:** [September 12, 2015, 6:41am UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486/3 "2015-09-12T06:41:53Z")

</div>

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](https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions)

> **···**
>
> On Sep 11, 2015 4:28 PM, “Steve V” [steve@digitalnothing.com](mailto: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

---

<div class="post-metadata">

**Author:** ![Steve\_V](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Steve\_V](https://discourse.sensu.io/u/Steve_V)\
**Post date:** [September 14, 2015, 6:27pm UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486/4 "2015-09-14T18:27:37Z")

</div>

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](mailto: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](https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions)
> 
> > On Sep 11, 2015 4:28 PM, “Steve V” [steve@digitalnothing.com](mailto: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

---

<div class="post-metadata">

**Author:** ![Glenn\_McAllister](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@Glenn\_McAllister](https://discourse.sensu.io/u/Glenn_McAllister)\
**Post date:** [September 14, 2015, 6:38pm UTC](https://discourse.sensu.io/t/can-sensu-run-a-check-on-only-one-subscriber-in-a-group/486/5 "2015-09-14T18:38:24Z")

</div>

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. 🙂

> **···**
>
> On Sat, Sep 12, 2015 at 1:41 AM, Justin Kolberg [amd.prophet@gmail.com](mailto: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](https://sensuapp.org/docs/0.20/clients#round-robin-client-subscriptions)
> 
> > On Sep 11, 2015 4:28 PM, “Steve V” [steve@digitalnothing.com](mailto: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
