Giter Site home page Giter Site logo

snpservices's Introduction

This software provides graph services in the context of the 
Spontaneous Networking Platform.

Uses nodexchange/cnml as a input format, and provides traffic and
latency/availability graphs in image format by using mrtg/rrdtool 
collected history by simple HTTP URLs, therefore is easily
plugable to any web application.

PREREQUISITES:
You must have rrdtool, rrdtool-perl, rrdtool-php, mrtg and php-gd
Optionally git, in order to checkout the files

INSTALL:

1.-Checkout the latest GIT version into a directory accessible by an http server:

example:
cd /var/www/html
git clone git://github.com/guifi/snpservices.git

To publish the directory, you might create an alias into the apache configuration 
for the directory:

Alias /snpservices /var/www/html/snpservices

2.-Make the directory snpservices/tmp writable to everybody
chmod a+rw snpservices/tmp

3.-Create a guifi service at the database. Use this url
http://yourserver/snpservices

4.-Copy the common/config.php.template to config.php and edit it to set your values.
In particular take attention to:
-Set the Service ID (SNPGraphServerId) to match your service created in the database
-Point MRTGConfigSource. If you don't have a cached CNML, use your Data server, be sure
 you specify the zone you are using as at the server parameter
-Point CNMLSource. Use your Data server

IMPORTANT: You can skip 5 & 6 if you don't have old files to rename, however is a good 
idea to execute the 'wget' commant just to be sure that you data server is ready to 
graph feed your server. Think that may take a while to be ready for exporting your data.

5.-If you have the rrd files in an old format (devicename*.rrd)
If you have old graph files which you like to retain, rename them into the new
format, by creating a script with the following format:
wget -O x.sh "http://snpservices.guifi.net/snpservices/graphs/cnml2mrtgcsv.php?cp&server=ServerID#"
Where the server number is the number of your server

6.-If you simply want a list of the files at another server, get a list from them with:
wget -O x.sh "http://snpservices.guifi.net/snpservices/graphs/cnml2mrtgcsv.php?list&server=ServerID#"
Where the server number is the number of your server

7.-Install a cron job to run the mrtg and refresh your configi every 5 mins:
Can be something like this:
cd /var/www/snpservices/graphs; php mrtgcsv2mrtgcfg.php; 
/usr/bin/mrtg ../data/mrtg.cfg --lock-file /var/lock/mrtg/guifi_l --confcache-file

snpservices's People

Contributors

emmdim avatar jcastellet avatar miquelmartos avatar pablocastellano avatar ramon-roca avatar rogerpueyo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.