Sensu alert in Html format


#1

Hi Experts,
I was looking at my alert mails from sensu it really look ugly, i was not able to understand what exaclty it s saying is it critical or warning , i m looking for idea which can make it look good and understandable , bec when client she he ll not be able to understand whats happening …

Looking forward for your best response.

below is alert mail i m getting from sensu now.

{“id”:“a1c608aa-e207-49fe-905d-6037f6db01f2”,“client”:{“name”:“ABC”,“address”:“0.0.0.0”,“subscriptions”:[“abc”],“version”:“0.23.3”,“timestamp”:1464499552},“check”:{“command”:"/etc/sensu/plugins/check_load -w 8.00,5.00,2.00 -c 10.00,8.00,3.00",“subscribers”:[“ABC”,“adef”,“xyz”],“handlers”:[“default”,“email”],“interval”:60,“name”:“check_CPU_usage”,“issued”:1464499558,“executed”:1464499558,“duration”:0.005,“output”:“CRITICAL - load average: 5.54, 5.44, 4.09|load1=5.540;8.000;10.000;0; load5=5.440;5.000;8.000;0; load15=4.090;2.000;3.000;0; \n”,“status”:2,“history”:[“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“0”,“1”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”],“total_state_change”:15},“occurrences”:8,“action”:“create”,“timestamp”:1464499558}


#2

https://github.com/yieldbot/dhoulmagus

This is still a WIP and was intended to be a poc but is currently running in our dev environments because it does the job good enough. In the near future this will be ported from the Ruby to Golang. It started life many decades ago as a monothlic, aren’t they all, Perl 3 script written by someone far better with Perl than I that could be used with Nagios, pnp4nagios and their ancestors. I ported it to Python and made it much more extensible several years ago for use with Icinga/Icinga2. The ruby port came about when I moved to Sensu.

Golang will be the next logical evolution due to portability across multiple monitoring solutions.

While I know this works and will help out where/when I can please RTFM and use at your own discretion :slight_smile:

···

On Sun, May 29, 2016 at 1:50 AM, vinod katuwa vinod.katuwa12@gmail.com wrote:

Hi Experts,
I was looking at my alert mails from sensu it really look ugly, i was not able to understand what exaclty it s saying is it critical or warning , i m looking for idea which can make it look good and understandable , bec when client she he ll not be able to understand whats happening …

Looking forward for your best response.

below is alert mail i m getting from sensu now.

{“id”:“a1c608aa-e207-49fe-905d-6037f6db01f2”,“client”:{“name”:“ABC”,“address”:“0.0.0.0”,“subscriptions”:[“abc”],“version”:“0.23.3”,“timestamp”:1464499552},“check”:{“command”:"/etc/sensu/plugins/check_load -w 8.00,5.00,2.00 -c 10.00,8.00,3.00",“subscribers”:[“ABC”,“adef”,“xyz”],“handlers”:[“default”,“email”],“interval”:60,“name”:“check_CPU_usage”,“issued”:1464499558,“executed”:1464499558,“duration”:0.005,“output”:“CRITICAL - load average: 5.54, 5.44, 4.09|load1=5.540;8.000;10.000;0; load5=5.440;5.000;8.000;0; load15=4.090;2.000;3.000;0; \n”,“status”:2,“history”:[“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“0”,“1”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”],“total_state_change”:15},“occurrences”:8,“action”:“create”,“timestamp”:1464499558}

Matt Jones @DevopsMatt

Senior Infrastructure Engineer - Yieldbot Inc.

Core Contributor - Sensu Plugins

Co-Organizer - Boston Infrastructure Coders

Organizer - Metrowest Golang Meetup

https://linkedin.com/in/mattyjones


#3

It looks like you are using the raw "mail" command. I recommend moving
on to using a more standard email hander:

Still plain text but much nicer formatted. (and you can provide your
own template if you want)

···

On Sat, May 28, 2016 at 10:50 PM, vinod katuwa <vinod.katuwa12@gmail.com> wrote:

Hi Experts,
I was looking at my alert mails from sensu it really look ugly, i was not
able to understand what exaclty it s saying is it critical or warning , i m
looking for idea which can make it look good and understandable , bec when
client she he ll not be able to understand whats happening ..
Looking forward for your best response.

below is alert mail i m getting from sensu now.

{"id":"a1c608aa-e207-49fe-905d-6037f6db01f2","client":{"name":"ABC","address":"0.0.0.0","subscriptions":["abc"],"version":"0.23.3","timestamp":1464499552},"check":{"command":"/etc/sensu/plugins/check_load
-w 8.00,5.00,2.00 -c
10.00,8.00,3.00","subscribers":["ABC","adef","xyz"],"handlers":["default","email"],"interval":60,"name":"check_CPU_usage","issued":1464499558,"executed":1464499558,"duration":0.005,"output":"CRITICAL
- load average: 5.54, 5.44, 4.09|load1=5.540;8.000;10.000;0;
load5=5.440;5.000;8.000;0; load15=4.090;2.000;3.000;0;
\n","status":2,"history":["1","1","1","1","1","1","1","1","1","1","1","0","1","2","2","2","2","2","2","2","2"],"total_state_change":15},"occurrences":8,"action":"create","timestamp":1464499558}


#4

Hi Kyle,

M using postfix for mail but I want to get alert in HTML or look good format. As you shown before I need to know how could I set up …

···

On May 29, 2016 8:56 PM, “Kyle Anderson” kyle@xkyle.com wrote:

It looks like you are using the raw “mail” command. I recommend moving

on to using a more standard email hander:

https://github.com/sensu-plugins/sensu-plugins-mailer

Still plain text but much nicer formatted. (and you can provide your

own template if you want)

On Sat, May 28, 2016 at 10:50 PM, vinod katuwa vinod.katuwa12@gmail.com wrote:

Hi Experts,

I was looking at my alert mails from sensu it really look ugly, i was not

able to understand what exaclty it s saying is it critical or warning , i m

looking for idea which can make it look good and understandable , bec when

client she he ll not be able to understand whats happening …

Looking forward for your best response.

below is alert mail i m getting from sensu now.

{“id”:“a1c608aa-e207-49fe-905d-6037f6db01f2”,“client”:{“name”:“ABC”,“address”:“0.0.0.0”,“subscriptions”:[“abc”],“version”:“0.23.3”,“timestamp”:1464499552},“check”:{“command”:"/etc/sensu/plugins/check_load

-w 8.00,5.00,2.00 -c

10.00,8.00,3.00",“subscribers”:[“ABC”,“adef”,“xyz”],“handlers”:[“default”,“email”],“interval”:60,“name”:“check_CPU_usage”,“issued”:1464499558,“executed”:1464499558,“duration”:0.005,“output”:"CRITICAL

  • load average: 5.54, 5.44, 4.09|load1=5.540;8.000;10.000;0;

load5=5.440;5.000;8.000;0; load15=4.090;2.000;3.000;0;

\n",“status”:2,“history”:[“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“1”,“0”,“1”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”],“total_state_change”:15},“occurrences”:8,“action”:“create”,“timestamp”:1464499558}


#5

I think https://github.com/sensu-plugins/sensu-plugins-mailer looks decent.
It doesn't matter what mailserver (postfix) you use.

If you need more help than the standard docs I cover it in my training
material on lecture 10: https://www.udemy.com/sensu-introduction/

···

On Mon, May 30, 2016 at 12:51 AM, vinod katuwa <vinod.katuwa12@gmail.com> wrote:

Hi Kyle,
M using postfix for mail but I want to get alert in HTML or look good
format. As you shown before I need to know how could I set up ..

On May 29, 2016 8:56 PM, "Kyle Anderson" <kyle@xkyle.com> wrote:

It looks like you are using the raw "mail" command. I recommend moving
on to using a more standard email hander:
https://github.com/sensu-plugins/sensu-plugins-mailer

Still plain text but much nicer formatted. (and you can provide your
own template if you want)

On Sat, May 28, 2016 at 10:50 PM, vinod katuwa <vinod.katuwa12@gmail.com> >> wrote:
> Hi Experts,
> I was looking at my alert mails from sensu it really look ugly, i was
> not
> able to understand what exaclty it s saying is it critical or warning ,
> i m
> looking for idea which can make it look good and understandable , bec
> when
> client she he ll not be able to understand whats happening ..
> Looking forward for your best response.
>
> below is alert mail i m getting from sensu now.
>
>
> {"id":"a1c608aa-e207-49fe-905d-6037f6db01f2","client":{"name":"ABC","address":"0.0.0.0","subscriptions":["abc"],"version":"0.23.3","timestamp":1464499552},"check":{"command":"/etc/sensu/plugins/check_load
> -w 8.00,5.00,2.00 -c
>
> 10.00,8.00,3.00","subscribers":["ABC","adef","xyz"],"handlers":["default","email"],"interval":60,"name":"check_CPU_usage","issued":1464499558,"executed":1464499558,"duration":0.005,"output":"CRITICAL
> - load average: 5.54, 5.44, 4.09|load1=5.540;8.000;10.000;0;
> load5=5.440;5.000;8.000;0; load15=4.090;2.000;3.000;0;
>
> \n","status":2,"history":["1","1","1","1","1","1","1","1","1","1","1","0","1","2","2","2","2","2","2","2","2"],"total_state_change":15},"occurrences":8,"action":"create","timestamp":1464499558}
>
>
>
>