# How to check hosts between a specific time period

**URL:** https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861
**Category:** Sensu Classic (EOL)
**Created:** [November 15, 2017, 3:26pm UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861 "2017-11-15T15:26:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ferdous\_Shibly](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Ferdous\_Shibly](https://discourse.sensu.io/u/Ferdous_Shibly)
#### Post date: [November 15, 2017, 3:26pm UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/1 "2017-11-15T15:26:02Z")

</div>

Hi,

We have some hosts which we want to monitor between 8 AM to 8 PM on the weekdays. How can I configure Sensu clients to achieve that?

Any help would be appreciated.

Cheers

Ferdous Shibly

---

<div class="post-metadata">

### Author: ![Josh\_Pasqualetto](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Josh\_Pasqualetto](https://discourse.sensu.io/u/Josh_Pasqualetto)
#### Post date: [November 15, 2017, 4:44pm UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/2 "2017-11-15T16:44:12Z")

</div>

Hi Ferdous,

You want to use the subdue attribute on the check itself and subdue the check at any times you do not want to monitor.

[https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes](https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes)

Thanks,

Josh

> **···**
>
> On Nov 15, 2017, at 8:26 AM, Ferdous Shibly [bdshibly@gmail.com](mailto:bdshibly@gmail.com) wrote:
> 
> > Hi,
> 
> > 
> 
> > We have some hosts which we want to monitor between 8 AM to 8 PM on the weekdays. How can I configure Sensu clients to achieve that?
> 
> > 
> 
> > Any help would be appreciated.
> 
> > 
> 
> > Cheers
> 
> > Ferdous Shibly

---

<div class="post-metadata">

### Author: ![Ferdous\_Shibly](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Ferdous\_Shibly](https://discourse.sensu.io/u/Ferdous_Shibly)
#### Post date: [November 16, 2017, 3:58pm UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/3 "2017-11-16T15:58:15Z")

</div>

Josh,

Thanks for your reply which is very helpful. I am facing another challenge implementing Sensu… We have some hosts in auto-scaling group on AWS. What is the best practice to monitor hosts in auto-scaling group as it can be automatically discovered by Sensu when it will be scaled up but how it will be deregistered when scaled down?

Cheers

Ferdous Shibly

> **···**
>
> On Wednesday, November 15, 2017 at 11:44:22 AM UTC-5, Joshua Pasqualetto wrote:
> 
> > Hi Ferdous,
> 
> > 
> 
> > You want to use the subdue attribute on the check itself and subdue the check at any times you do not want to monitor.
> 
> > 
> 
> > [https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes](https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes)
> 
> > 
> 
> > Thanks,
> 
> > Josh
> 
> > On Nov 15, 2017, at 8:26 AM, Ferdous Shibly [bdsh...@gmail.com](mailto:bdsh...@gmail.com) wrote:
> 
> > > Hi,
> 
> > >
> 
> > > We have some hosts which we want to monitor between 8 AM to 8 PM on the weekdays. How can I configure Sensu clients to achieve that?
> 
> > >
> 
> > > Any help would be appreciated.
> 
> > >
> 
> > > Cheers
> 
> > > Ferdous Shibly

---

<div class="post-metadata">

### Author: ![Steve\_Viola](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@Steve\_Viola](https://discourse.sensu.io/u/Steve_Viola)
#### Post date: [November 16, 2017, 4:17pm UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/4 "2017-11-16T16:17:10Z")

</div>

Ferdous,

You can setup cloudwatch events in AWS to trigger when an instance is terminated. The event can call a Lambda function which can hit the Sensu API and deregister the client. Be sure to spin up the Lambda function in the VPC that the sensu server is in, so you don’t need to expose the Sensu API to the internet.

I’m not sure if someone has a blog post or article with a step by step, or code samples, but once setup, it’s extremely hands off, and there’s no maintenance you’ll need to do.

> **···**
>
> On Thu, Nov 16, 2017 at 10:58 AM, Ferdous Shibly [bdshibly@gmail.com](mailto:bdshibly@gmail.com) wrote:
> 
> > Josh,
> 
> > Thanks for your reply which is very helpful. I am facing another challenge implementing Sensu… We have some hosts in auto-scaling group on AWS. What is the best practice to monitor hosts in auto-scaling group as it can be automatically discovered by Sensu when it will be scaled up but how it will be deregistered when scaled down?
> 
> > 
> 
> > 
> 
> > Cheers
> 
> > Ferdous Shibly
> > 
> > On Wednesday, November 15, 2017 at 11:44:22 AM UTC-5, Joshua Pasqualetto wrote:
> 
> > > Hi Ferdous,
> 
> > >
> 
> > > You want to use the subdue attribute on the check itself and subdue the check at any times you do not want to monitor.
> 
> > >
> 
> > > [https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes](https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes)
> 
> > >
> 
> > > Thanks,
> 
> > > Josh
> 
> > > On Nov 15, 2017, at 8:26 AM, Ferdous Shibly [bdsh...@gmail.com](mailto:bdsh...@gmail.com) wrote:
> 
> > > > Hi,
> 
> > > >
> 
> > > > We have some hosts which we want to monitor between 8 AM to 8 PM on the weekdays. How can I configure Sensu clients to achieve that?
> 
> > > >
> 
> > > > Any help would be appreciated.
> 
> > > >
> 
> > > > Cheers
> 
> > > > Ferdous Shibly
> 
> –
> 
> Steven Viola

---

<div class="post-metadata">

### Author: ![Alexander\_Skiba](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/alexander_skiba/32/408_2.png) [@Alexander\_Skiba](https://discourse.sensu.io/u/Alexander_Skiba)
#### Post date: [November 17, 2017, 9:37am UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/5 "2017-11-17T09:37:36Z")

</div>

Possibly [Redirecting to Google Groups](https://groups.google.com/forum/#!topic/sensu-users/fUHEm8_lz2g) is also helpful in regard to deregistration.

> **···**
>
> On Thursday, November 16, 2017 at 4:58:15 PM UTC+1, Ferdous Shibly wrote:
> 
> > Josh,
> 
> > Thanks for your reply which is very helpful. I am facing another challenge implementing Sensu… We have some hosts in auto-scaling group on AWS. What is the best practice to monitor hosts in auto-scaling group as it can be automatically discovered by Sensu when it will be scaled up but how it will be deregistered when scaled down?
> 
> > 
> 
> > 
> 
> > Cheers
> 
> > Ferdous Shibly
> > 
> > On Wednesday, November 15, 2017 at 11:44:22 AM UTC-5, Joshua Pasqualetto wrote:
> 
> > > Hi Ferdous,
> 
> > >
> 
> > > You want to use the subdue attribute on the check itself and subdue the check at any times you do not want to monitor.
> 
> > >
> 
> > > [https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes](https://sensuapp.org/docs/0.26/reference/checks.html#subdue-attributes)
> 
> > >
> 
> > > Thanks,
> 
> > > Josh
> 
> > > On Nov 15, 2017, at 8:26 AM, Ferdous Shibly [bdsh...@gmail.com](mailto:bdsh...@gmail.com) wrote:
> 
> > > > Hi,
> 
> > > >
> 
> > > > We have some hosts which we want to monitor between 8 AM to 8 PM on the weekdays. How can I configure Sensu clients to achieve that?
> 
> > > >
> 
> > > > Any help would be appreciated.
> 
> > > >
> 
> > > > Cheers
> 
> > > > Ferdous Shibly

---

<div class="post-metadata">

### Author: ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)
#### Post date: [November 22, 2018, 2:07am UTC](https://discourse.sensu.io/t/how-to-check-hosts-between-a-specific-time-period/861/6 "2018-11-22T02:07:59Z")

</div>


