I'm using Sensu to monitoring my hosts and services and I'd like to create an "Avaiability Report" to show how close of the 99,9999% my services are.
Something like the Nagios does:
So far, I have done the following:
-
Calculate the "downtime" in seconds using the "elapsed" function on logstash:
filter { if [type] == "sensu-logstash" {
mutate {
add_field => { "unique_id" => "%{check_name}_%{host}" }
}
elapsed {
unique_id_field => "unique_id"
start_tag => "sensu-ALERT"
end_tag => "sensu-RESOLVE"
timeout => 172800
}
} -
Created a "Script Field" to calculated the last 30 days on Kibana:
Name: month_pct
Script: (2592000 - doc['elapsed_time'].value)/2592000
Format: Percentage -
Created a Data Table visualization:
I'd like to make this in dynamic way, using the time interval that we select on Kibana(Last 4 hours, this week, this month and so on...)
How is the best way to do that?
Thanks!