sensu / sensu-chef

Sensu Chef cookbook.
https://supermarket.chef.io/cookbooks/sensu
Apache License 2.0
222 stars 280 forks source link

Cron syntax scheduling unusable with sensu chef cookbook #551

Closed Evesy closed 6 years ago

Evesy commented 7 years ago

Expected Behavior

Current Behavior

Possible Solution

Add a cron resource to sensu_check. Do not require 'interval' if cron attribute is present.

Steps to Reproduce (for bugs)

  1. Create barebones sensu check, i.e.:
    sensu_check 'batch_job_check' do
    command 'batch_job_check.rb'
    subscribers ['roundrobin:big-data']
    additional(:cron => '0 9 * * 1', :ttl => 612_000, :source => 'big-data')
    end
  2. After chef converge, check is generated with an interval attribute:
    
    {
    "checks": {
    "batch_job_check": {
      "command": "batch_job_check.rb",
      "subscribers": [
        "roundrobin:big-data"
      ],
      "interval": 60,
      "cron": "0 9 * * 1",
      "ttl": 612000,
      "source": "big-data"
    }
    }
    }


## Context
Currently unable to deploy cron scheduled checks using the sensu_check chef resource.

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version of this cookbook used: 4.0.0
* Version of Sensu used: 0.28.4
* Version of Chef used: 12.5.1 :(
* Operating System and version (e.g. CentOS 7, Ubuntu 14.04): CentOS 7.3
cwjohnston commented 7 years ago

Hi @Evesy, thanks for opening this issue, I think you make an excellent point. We'll need to update the sensu_check resource to support this new Sensu feature.

vbichov commented 6 years ago

what are the chances this will be resolved in the near future?

majormoses commented 6 years ago

This has been fixed in the following release: https://supermarket.chef.io/cookbooks/sensu/versions/5.3.0