Check shows up under "Checks", but not in subscription

I’m having a problem with getting a check to actually run.

The check in question is showing up under the Checks tab in Uchiwa, but when I click on one of the nodes that are in the subscription group that this check is in, it either doesn’t show up at all, or it shows up as having run once, and only once. To my eye (and a couple other eyes), it is set up exactly the same as the other checks, although it does have an “api_requested” field showing up, that isn’t in any part of the configuration, so I’m unsure of what to make of that. This is from Uchiwa when I click on the check in question:

api_requested

  { "creator": null  , "reason": null
}

command

/etc/sensu/plugins/check-yarn.sh skynet

duration

0.012

executed

2017-05-25 09:18:28

handlers

opsgenie

issued

2017-05-25 09:17:25

name

yarn_skynet

occurrences

1

output

yarn is OK, it has 3 pendingapps

status

0

type

standard

history

0

The output shown is correct. I think it’s odd that no interval is showing up - one is defined in the checks.yml on the master:

“yarn_skynet”: {

“command”: “/etc/sensu/plugins/check-yarn.sh skynet”,

“handlers”: [

“opsgenie”

],

“interval”: 30,

“occurrences”: 1,

“subscribers”: [

“mapr_alarms”

]

},

When I grep through the client logs, I see the following:

root@sensu-client:/var/log/sensu# grep yarn_skynet sensu-client.log

{“timestamp”:“2017-05-25T09:18:28.849956+1000”,“level”:“info”,“message”:“received check request”,“check”:{“command”:"/etc/sensu/plugins/check-yarn.sh skynet",“handlers”:[“opsgenie”],“occurrences”:1,“name”:“yarn_skynet”,“api_requested”:{“reason”:null,“creator”:null},“issued”:1495667845}}

{“timestamp”:“2017-05-25T09:18:28.862034+1000”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“sensu-client”,“check”:{“command”:"/etc/sensu/plugins/check-yarn.sh skynet",“handlers”:[“opsgenie”],“occurrences”:1,“name”:“yarn_skynet”,“api_requested”:{“reason”:null,“creator”:null},“issued”:1495667845,“executed”:1495667908,“duration”:0.012,“output”:“yarn is OK, it has 3 pendingapps\n”,“status”:0}}}

All other checks are reporting correctly, and no others have that “api_requested” field.

Any thoughts or suggestions?

Thank you,

Alan

Hi Alan,

It would be most instructive to see the check configuration as rendered in JSON on the Sensu server. Based on the YAML you've provided here it looks like your check might be defining a list of "subscribers" instead of "subscriptions" as described in Sensu's check definition specification[0].

Regards,
Cameron

[0]: https://sensuapp.org/docs/latest/reference/checks.html#check-definition-specification

Hi Cameron,

Thank you for your response. I misspoke in my original post - that should have said checks.json, not checks.yml. Although it is pretty clearly json, not YAML.

But looking through the link you’ve provided, there is no “subscriptions” attribute - if anything, that link confirms that I’ve configured it correctly.

subscribers
description
An array of Sensu client subscriptions that check requests will be sent to. The array cannot be empty and its items must each be a string.
required
true (unless standalone is true)
type
Array
example

"subscribers": ["production"]
···

On Friday, May 26, 2017 at 5:45:21 AM UTC+10, Cameron Johnston wrote:

Hi Alan,
It would be most instructive to see the check configuration as rendered in JSON on the Sensu server. Based on the YAML you’ve provided here it looks like your check might be defining a list of “subscribers” instead of “subscriptions” as described in Sensu’s check definition specification0.

Regards,
Cameron

Ok, this issue is resolved, although I still have no idea what the problem was. Basically, I nuked the sensu master and then re-ran the playbook to install it, and it came back working properly.

The only thing I can think of is maybe Redis or RabbitMQ had the check in some weird state, that needed to be purged, but I’m not sure even what to look for, there, and needed Sensu reporting properly right away, so I went with the purge, rather than looking any deeper into the stack.

···

On Friday, May 26, 2017 at 9:55:10 AM UTC+10, alanp...@gmail.com wrote:

Hi Cameron,

Thank you for your response. I misspoke in my original post - that should have said checks.json, not checks.yml. Although it is pretty clearly json, not YAML.

But looking through the link you’ve provided, there is no “subscriptions” attribute - if anything, that link confirms that I’ve configured it correctly.

subscribers
description
An array of Sensu client subscriptions that check requests will be sent to. The array cannot be empty and its items must each be a string.
required
true (unless standalone is true)
type
Array
example

"subscribers": ["production"]

On Friday, May 26, 2017 at 5:45:21 AM UTC+10, Cameron Johnston wrote:

Hi Alan,
It would be most instructive to see the check configuration as rendered in JSON on the Sensu server. Based on the YAML you’ve provided here it looks like your check might be defining a list of “subscribers” instead of “subscriptions” as described in Sensu’s check definition specification0.

Regards,
Cameron