Skip to content

A Django application for remotely monitoring servers using SSH

License

Notifications You must be signed in to change notification settings

swistakm/django-skwissh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

DEMO SITE : Visit the Skwissh demo (username test / password test) to see Skwissh in action.

More info : Github Pages for Skwissh

Python Package Index : django-skwissh

Travis : Last build status

image

New Android application : Find Android Skwissh on Google Play

image

Introduction

A Django application for remotely monitoring servers using SSH.

In background (crontabed jobs) Skwissh uses Python Fabric to execute SSH commands, aka. "sensors", get the output and store timestamped values. Measures are taken every minute.

On the other side, Skwissh is able to display nice charts (linechart, piechart or simple text) with aggregated measures.

Default sensors available (tested on Ubuntu 12.04) :

  • Memory
  • CPU
  • WaitIO
  • Load Averages
  • Disk usage
  • Top

But you can easily add your own ones !!

Follow @skwissh on Twitter to see latest updates.

Installation

Skwissh can be installed from Pypi:

pip install django-skwissh

Configure your Django project in a normal way (database, etc...).

Add skwissh and kronos to your Django INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'kronos',
    'skwissh',
)

Add Skwissh to your urls.py:

# Skwissh
url(r'^skwissh/', include('skwissh.urls')),

Synchronize your database (this command will load defaut sensors through fixtures):

./manage.py syncdb

Install Skwissh tasks (will write to your user crontab, thanks to 'django-kronos'):

./manage.py installsensors

You can check that 4 crontab job have been configured:

crontab -l

If you want to activate i18n (French & English currently supported), follow the next steps:

In your project settings.py, add the Django LocaleMiddleware and set the LANGUAGES variable:

MIDDLEWARE_CLASSES = (
   ...
   'django.middleware.locale.LocaleMiddleware',
   ...
)

LANGUAGES = (
   ('fr', 'Français'),
   ('en', 'English'),
)

You're ready to go ! Connect to the application and start configure your servers and sensors !

Changing task backend

By default kronos is used for running jobs. This behavior can be changed by using different task backend. At the moment there are only two backends availible:

  • kronos
  • celery

Backend can be changed with SKWISSH_TASK_BACKEND in settings.py of your project.

Celery as task backend

If you want to use celery as your task backend you must install django-celery package:

pip install django-celery

Add 'djcelery' to your Django INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'djcelery',
)

And add following lines to setup.py:

# select celery backend
SKWISSH_TASK_BACKEND = "celery"

# tell celery where to look for tasks
CELERY_IMPORTS = (
    "skwissh.tasks.celery_tasks",
)

# use DatabaseScheduler
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"

You must also choose and configure celery backend. If you don't know how please refer to celery documentation.

To start collecting data install tasks in database schedule:

./manage.py installsensors

And start celery worker with heartbeat enabled: :

./manage.py celery worker -B

Or as two separate processes:

./manage.py celery beat
./manage.py celery worker

Screenshots

Load averages

image

Disk usage

image

Top output

image

Server edition

image

Sensor edition

image

Credits

About

A Django application for remotely monitoring servers using SSH

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 61.3%
  • Python 38.7%