Skip to content

Instantly share code, notes, and snippets.

Last active November 16, 2016 18:30
Show Gist options
  • Save james/5670035 to your computer and use it in GitHub Desktop.
Save james/5670035 to your computer and use it in GitHub Desktop.
Pingdom Dashing Widget
class Dashing.Pingdom extends Dashing.Widget
<h1 class="title" data-bind="title"></h1>
<li class="check" data-foreach-check="checks" data-bind-data-state="check.state">
<span data-bind=""></span>
require 'pingdom-client'
api_key = ENV['PINGDOM_API_KEY'] || ''
user = ENV['PINGDOM_USER'] || ''
password = ENV['PINGDOM_PASSWORD'] || ''
SCHEDULER.every '1m', :first_in => 0 do
client = :username => user, :password => password, :key => api_key
if client.checks
checks = { |check|
if check.status == 'up'
color = 'green'
color = 'red'
{ name:, state: color }
checks.sort_by { |check| check['name'] }
send_event('pingdom', { checks: checks })
// ----------------------------------------------------------------------------
// Sass declarations
// ----------------------------------------------------------------------------
$background-color: #dc5945;
// ----------------------------------------------------------------------------
// Widget-clock styles
// ----------------------------------------------------------------------------
.widget-pingdom {
background-color: $background-color;
.check {
float: left;
padding: 4px 0px;
.check[data-state="green"] {
background-color: green;
.check[data-state="red"] {
background-color: red;
.check span {
padding: 0px 4px;


Simple Dashing widget (and associated job) to display Pingdom checks.



Add it to dashing's gemfile:

gem 'pingdom-client'

and run bundle install. Everything should work now :)


To use this widget, copy pingdom.html,, and pingdom.scss into the /widgets/pingdom directory. Put the pingdom.rb file in your /jobs folder.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
  <div data-id="pingdom" data-view="Pingdom" data-title="Pingdom" data-cols="1"></div>


You'll need to add your pingdom API key and login settings. You can either add it straight to the source code on lines 4-6 of pingdom.rb, or set the variables in the ENV. For heroku, you can do this with

heroku config:set PINGDOM_API_KEY=
heroku config:set PINGDOM_USER=
heroku config:set PINGDOM_PASSWORD=

Pingdom is checked every minute, but you can change that by editing the job schedule.


This has been extracted from a dashboard for the UK Ministry of Justice, with minimal generalising. Feel free to submit patches to @james

Copy link

Hmm I get errors using the gem specified, because of a Faraday dependency conflict. When using another Github fork of the library, I get

scheduler caught exception:
:logger is not registered on Faraday::Adapter
/Users/matthijsgroen/dashing/vendor/bundle/ruby/1.9.1/gems/faraday-0.8.7/lib/faraday.rb:64:in `lookup_middleware'

Copy link

jwalton commented Sep 19, 2013

This is my version:

It removes the dependency on pingdom-client, and thus the troublesome Faraday problems, and adds showing the most recent ping for each server.

Copy link

jwalton commented Sep 19, 2013

@james feel free to pull from mine. :)

Copy link

@jwalton @james should be:

checks.sort_by! { |check| check[:name] }

Copy link


I have a question, how can i change did so it just shows the down checks, because we have something like more than 40 checks in pingdom so it doesn't fit on the screen.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment