Simple Uptime Robot Dashing widget
Dashing widget to display a short list of Uptime Robot monitors. This version is compatible with the current Uptime Robot APIv2 (https://uptimerobot.com/api).
##Usage
Add this to your Gemfile and run bundle install
:
gem 'uptimerobot'
The files uptimerobot.coffee
, uptimerobot.html
and uptimerobot.scss
go in the /widget/uptimerobot
directory.
The uptimerobot.rb
goes into the /jobs
directory.
Put the following in your dashboard.erb file to make it show up in your dashboard:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="uptimerobot" data-view="Uptimerobot"></div>
</li>
##Settings (uptimerobot.rb
)
You will need to provide an API key from Uptime Robot API
@vxrdanny
Two issues I had, the RB and a stupid case issue. Pay special attention to cases in "div data-id="uptimerobot" data-view="Uptimerobot"" One Uptime is capital, one is lowercase.
I fixed this, I modified the RB as below (per the API page):
``
require 'uptimerobot'
SCHEDULER.every '5m', :first_in => 0 do |job|
client = UptimeRobot::Client.new(api_key: 'API_KEY_HERE')
raw_monitors = client.getMonitors['monitors']
monitors = raw_monitors.map { |monitor|
{
friendlyname: monitor['friendly_name'],
status: 'S' << monitor['status'].to_s
}
}
send_event('uptimerobot', { monitors: monitors } )
end
``