Hmm. I don’t know if parsing the output of these commands is inside the scope of the sensu-helper-script.
But, if the command you have in mind (or a filter script to mutate it) can output appropriately, you might be able to do something like this?
sensu-shell-helper -j ‘“metric”: true’ -H ‘[“graphite”]’ “/etc/sensu/plugins/vmstat-metrics.rb --scheme stats.:::name:::”
I don’t know. Probably will work? Use -d to debug the json output sensu-shell-helper is making until it works?
Pull requests welcome if you can modify it to handle metrics better, but I wouldn’t want to make assumptions about how peoples handlers are setup and stuff.
On Thu, Dec 19, 2013 at 10:45 AM, Michael Cronnelly email@example.com wrote:
Agreed - this is really useful, Kyle.
I'd like to augment your script, if possible, with metrics.
For example, the target could optionally be run via time (/usr/bin/time on Ubuntu) and it could return metrics for:
Length of real time the job took to run
Maximum resident set size (memory) used
Number of swaps caused
This would certainly be very useful for my use-cases. What do you think?
On 16/12/13 18:56, Joe Miller wrote:
That’s pretty awesome. Thanks for posting.
Head of Technical Services
Direct: +44 2030 516134
Mobile: +44 7866 621320
The Old School House
Bridge Road, Hunton Bridge,
Kings Langley, WD4 8RQ
Switchboard: +44 1923 261166
clock.@ is a Registered Trademark of Clock Limited in the European Community and other territories
On Sun, Dec 15, 2013 at 9:04 AM, Kyle Anderson <firstname.lastname@example.org>
I wrote this shell script to make it easier for me to add sensu checks for my cron jobs with minimal overhead:
I hope it might be useful to others too. Feel free to open issues / pull requests if it doesn't work for you. (it is not production tested)
Example cron usage:
0 * * * * /usr/bin/sensu-shell-helper /usr/bin/apt-get update
No more cron spam, alerts when it fails, and clears when it resolves.