Project

pinger

0.0
No commit activity in last 3 years
No release in over 3 years
In development...
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

Pinger

.. isn't ready yet.. move along!

Pinger will be a command line tool for monitoring the health of your websites.


Goals

  • Simplicity
  • Minimal dependencies
  • Email notifications of service interuptions
  • Multiple DB adapters

Future Goals

  • Simple & sexy web interface with charts/graphs

Configuration

Pinger needs to be setup before doing its job. Pinger will look for your config file at ENV["PINGER_CONFIG"] or ~/.pinger.yml by default.

Here's the available options and their defaults:

:database_url                     => "sqlite://pinger.db",
:template_path                    => File.expand_path("../templates", __FILE__),
:email_to                         => "pinger.alert@example.com",
:email_from                       => "pinger@example.com",
:deliver_alerts                   => true,
:delivery_method                  => :sendmail,
:delivery_method_options          => {},
:allowed_response_time_difference => 3,
:allowed_response_size_difference => 1024

You'll probably at least want to overwrite database_url and email_to in your yml file:

# ~/.pinger.yml
database_url: postgres://pinger:pinger@localhost/pinger
email_to: your-email@your-host.com

We're using mail for email delivery. To use a different delivery method just set the proper variables in your config file. Here's an example for using gmail:

# ~/.pinger.yml
delivery_method: :smtp
delivery_method_options:
  address:              "smtp.gmail.com"
  port:                 587
  domain:               "example.com"
  user_name:            "email@example.com"
  password:             "password"
  authentication:       "plain"
  enable_starttls_auto: true

Here's a link to mail's delivery methods.


Usage

Here's the run down:

pinger help       # Shows pinger's usage
pinger stats      # Shows stats for pings, alerts and uris
pinger batch      # Runs a ping test for all uris in pinger's database
pinger flush      # Deletes pings and alerts for all uris
pinger config     # Displays pinger's current configuration
pinger list       # Lists all uris in pinger's database
    
pinger add URI    # Add a uri to pinger's database
pinger rm URI     # Remove a uri from pinger's database
pinger ping URI   # Run a ping test for a uri
pinger show URI   # Show details for a uri

Add your URIs to pinger's database then tie pinger into your crontab with something like this:

*/15 * * * * /path/to/bin/ruby /path/to/bin/pinger batch >> path/to/pinger.log 

Testing

Testing is done with minitest. Run tests with:

bundle exec rake

Sqlite is used by default, but you can test against other database adapters by setting PINGER_TEST_DB like so:

# postgres
PINGER_TEST_DB=postgres://root:@localhost/pinger bundle exec rake
    
# mysql
PINGER_TEST_DB=mysql2://root:@localhost/pinger bundle exec rake

Make sure you create the appropriate databases before running the tests.


License

Copyright (c) 2011 - 2012 Spencer Steffen & Citrus, released under the New BSD License All rights reserved.