• This repository has been archived on 03/Aug/2020
  • Stars
    star
    382
  • Rank 112,271 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 15 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Graph collectd metrics in the browser, backed by a JSON API

Visage

Visage is a web interface for viewing collectd statistics.

It also provides a JSON interface onto collectd's RRD data, giving you an easy way to mash up the data.

Features

  • Renders graphs in the browser with SVG, and retrieves data asynchronously
  • Easy interface for building, ordering, and sharing collections of graphs
  • Interactive graph elements - toggle line visibility, inspect exact point-in-time data
  • Drop-down or mouse selection of timeframes
  • JSON interface onto collectd RRDs
  • Support for FLUSH using either collectd's rrdtool plugin, or rrdcached

Here, have a graph:

Something I prepared earlier - Visage 3.0 graph.

Installing

N.B: Visage must be deployed on a machine where collectd stores its stats in RRD.

Ubuntu

On Ubuntu, to install dependencies run:

sudo apt-get install -y build-essential librrd-ruby ruby ruby-dev rubygems collectd

Then install the app with:

gem install visage-app

CentOS/RHEL

CentOS/RHEL 5

Visage uses yajl-ruby to work with JSON, which requires Ruby >= 1.8.6. CentOS/RHEL 5 ship with Ruby 1.8.5, so you will need to use Ruby Enterprise Edition.

Endpoint provide packages for REE and a Yum repository to ease installation.

Follow the above instructions for installing REE, and then run:

sudo yum install -y librrd-dev ruby rubygems collectd
gem install librrd

Then install the app with:

gem install visage-app

CentOS/RHEL 6+

On CentOS 6, to install dependencies run:

sudo yum install -y ruby-RRDtool ruby ruby-devel rubygems collectd

Then install the app with:

gem install visage-app

openSUSE 12.3+

On openSUSE 12.3+, to install dependencies run:

sudo zypper install -y ruby-rrdtool ruby ruby-devel collectd

Then install the app with:

gem install visage-app

Before running visage-app set the environment variable to "RRDDIR=/var/lib/collectd"

Mac OS X

Visage is not supported on Mac OS X, as RRDtool is a pain in the arse on that platform. It's highly recommended you use Vagrant to fire up an Ubuntu box to run Visage.

Running

You can try out Visage quickly with:

visage-app start

Then paste the URL from the output into your browser.

If you get a command not found when running the above command (RubyGems likely isn't on your PATH), try this instead:

$(dirname $(dirname $(gem which visage-app)))/bin/visage-app start

Deploying

Visage can be deployed easily on Apache with Passenger:

sudo apt-get install libapache2-mod-passenger

Visage can attempt to generate an Apache vhost config for use with Passenger:

$ visage-app genapache
<VirtualHost *>
  ServerName ubuntu.localdomain
  ServerAdmin [email protected]

  DocumentRoot /home/user/.gem/ruby/1.8/gems/visage-app-0.1.0/lib/visage-app/public

  <Directory "/home/user/.gem/ruby/1.8/gems/visage-app-0.1.0/lib/visage-app/public">
     Options FollowSymLinks Indexes
     AllowOverride None
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>

Copypasta this into your system's Apache config structure and tune to taste.

To do this on Debian/Ubuntu:

sudo -s
visage-app genapache > /etc/apache2/sites-available/visage
a2ensite visage
a2dissite default
service apache2 reload

Then visit your Apache instance in a browser, and Visage will be up and running.

Configuring

Visage looks for some environment variables when starting up:

  • CONFIG_PATH, an entry on the configuration file search path.
  • RRDDIR, the location of collectd's RRDs.
  • COLLECTDSOCK, the location of collectd's Unix socket.
  • RRDCACHEDSOCK, the location of rrdcached's Unix socket.
  • VISAGE_DATA_BACKEND, which storage backend to retrieve data from.

Visage has a configuration search path which can be used for overriding individual files. By default it has one entry: $VISAGE_ROOT/lib/visage/config/. You can set the CONFIG_PATH environment variable to add another directory to the config load path. This directory will be searched when loading up configuration files:

CONFIG_PATH=/var/lib/visage visage-app start

This is especially useful when you want to deploy + run Visage from an installed gem with Passenger. e.g.

<VirtualHost *:80>
  ServerName monitoring.example.org
  ServerAdmin [email protected]

  SetEnv CONFIG_PATH /var/lib/visage
  SetEnv RRDDIR /opt/collectd/var/lib/collectd

  DocumentRoot /var/lib/gems/1.8/gems/visage-app-0.3.0/lib/visage/public
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  LogFormat "%h %l %u %t \"%r\" %>s %b" common
  CustomLog /var/log/apache2/access.log common
</VirtualHost>

Also to keep in mind when deploying with Passenger, the CONFIG_PATH directory and its files need to have the correct ownership:

chown nobody:nogroup -R /var/lib/visage

Developing + testing

Check out the code:

git clone git://github.com/auxesis/visage.git

Install the development dependencies:

bundle

Run all the cukes:

rake

Visage tests should pass every time. Travis says the current Visage is build status.

Run the app with:

VISAGE_DATA_BACKEND=Mock bundle exec shotgun lib/visage-app/config.ru -p 9292 -o 0.0.0.0 --server thin

Visage ships a Mock data backend, so you can test without needing a real instance of collectd writing data with the RRDtool plugin. Per the above example, you can enable it by specifying the VISAGE_DATA_BACKEND=Mock environment variable on the command line.

To create and install a new gem from the current source tree:

rake build

Releasing

  1. Bump the version in lib/visage-app/version.rb
  2. Add an entry to CHANGELOG.md
  3. git commit everything.
  4. Build the gem with rake build
  5. Push the gem to RubyGems.org with rake push

Licencing

Visage is MIT licensed.

Visage is distributed with Highcharts. Torstein Hønsi has kindly granted permission to distribute Highcharts under the GPLv2 as part of Visage.

If you ever need an excellent JavaScript charting library, please consider purchasing a commercial license for Highcharts.

Support

More Repositories

1

cucumber-nagios

Systems testing plugin for Nagios with Cucumber + Webrat + Mechanize + Net::SSH
Ruby
257
star
2

collectd-opentsdb

collectd writer plugin for OpenTSDB
Java
25
star
3

rails-puppet-quickstart

to kickstart getting your Rails app up and running ASAP
15
star
4

nswbushfires

Twitter bot for posting current incidents from the NSW bushfires website
Ruby
7
star
5

cucumber-scripting

6
star
6

collectd-sidekiq-plugin

A collectd exec plugin to query Sidekiq general and queue statistics
Go
6
star
7

junk

Tools that keep the world turning
Ruby
5
star
8

rump

Do Puppet runs locally from a Git checkout
Ruby
5
star
9

gotgastro.com

[DEPRECATED] source to Gastro, a mashup of the NSW Food Authority's name-and-shame lists
Ruby
3
star
10

dnsmanager

Ruby
3
star
11

cucumber-nagios-spork-experiment

Experiment to see how well cucumber-nagios works with Spork
Ruby
2
star
12

boxed-view

ABC iView app for Boxee
2
star
13

programmingc

Worked exercises from UTS Programming C course
C
2
star
14

unblockus-updater

Updates Unblock-Us with your current IP address
Go
2
star
15

gastro

Find out about food safety problems when eating out or buying food
Ruby
2
star
16

sa_health_food_prosecutions_register

South Australian Department of Health's food prosecution register
Ruby
2
star
17

flapjack-project.com

Flapjack website
Ruby
2
star
18

chef-torrents

config for my own VPS doing torrents
Ruby
1
star
19

docs.flapjack-project.com

autogeneration of docs for flapjack-project.com
Ruby
1
star
20

example-resume

An example resume built with GitHub Pages.
CSS
1
star
21

epilog

Epilog is a simple log viewing application and a log collector
JavaScript
1
star
22

okbye

Web interface for notmuch
Ruby
1
star
23

collectd-mikrotik

Minimal collectd just for fetching statistics from Mikrotik RouterOS and sending them elsewhere via the `network` plugin
Makefile
1
star
24

gem2deb

thought experiment on building a RubyGems to Debian package converter
Ruby
1
star
25

rump-demo

1
star
26

australian_federal_mp_property_interests

Property interests for Australian federal member of parliament, as curated by ABC
HTML
1
star
27

laptop-death-tally-dashboard

Ruby
1
star
28

cfexample

1
star
29

act_register_of_food_offences

Australian Capital Territory register of food offences
Ruby
1
star