1

As described in the Sensu documentation, I've written a custom check script that returns 0 for OK, 1 for Warning, 2 for Critical, and prints out the description of the status. It shows up as expected on Sensu's built-in web interface, but I'm not sure how to make it show up in Grafana. I have some canned metrics that work through InfluxDB, but this is just a status check, not a metric.

I gather that I need some sort of handler on the Sensu side and/or some sort of datasource on the Grafana side that talks to the Sensu API, but the one for Sensu Core (1.x) doesn't seem to work with the newer Sensu Go (5.x). So, do I:

  1. Rewrite the check to do graphite_plaintext output and use the influxdb handler?
  2. Write a custom Grafana datasource and/or Sensu handler?
  3. Revert to Sensu Core?

Sensu Go seems to have been re-oriented around metrics, so it's not clear from the docs how to deal with simple checks anymore.

user13803
  • 95
  • 6

1 Answers1

0

It's probably terribly inefficient, but for now I've simply chosen option 1, to rewrite the check to use influxdb handler.

All I had to do for this was to print my output with the form:

metric_path value timestamp\n

Where metric_path is something like computer_name.topic.status, value is just an integer status, and then timestamp is the current unix time as an integer. That last bit took an embarrassingly long time to figure out...nothing was showing up in InfluxDB database (and thus, Grafana) because the sensu-influxdb-handler errors out if the timestamp is not an integer.

Then, on the Grafana side, I installed the Status Panel plugin developed by Vonage here:

https://grafana.com/plugins/vonage-status-panel

Once the data was finally showing up in InfluxDB, I could select it from Grafana. I set the thresholds for warning and critical to 1 and 2 respectively, and it now works like I wanted. Still, if anyone has a more efficient way to handle this, I'd like to know about it, because I'm going to want to track the status of a large number of things, and I want to do it the right way.

user13803
  • 95
  • 6