Description
node_rrd is a node.js (http://nodejs.org) native binding for RRDtool (http://oss.oetiker.ch/rrdtool/).
Dependencies
In order to compile the c++ sources, you need to have:
- node-gyp (npm install -g node-gyp)
- a compiler toolchain (gcc etc...)
- the RRDtool library (http://oss.oetiker.ch/rrdtool/).
For tests:
- mocha (http://visionmedia.github.com/mocha/).
Install
Using git
$ git clone <this repository>
$ cd node_rrd
$ npm install .
Basic usage
Require the module
var rrd = ;
create
rrd
Example:
var filename = '/tmp/test.rrd';var now = Math; rrd;
info
rrd
Example:
var filename = '/tmp/test.rrd'; rrd;
last
rrd
Example:
var filename = '/tmp/test.rrd'; rrd;
update
rrd
Example:
var filename = '/tmp/test.rrd';var value = 800;var now = Math; rrd;
fetch
rrd
Example:
var filename = '/tmp/test.rrd';var now = Math; rrd;
Example
Let's create an RRD to store the system load average over 1 minute for the last hour.
#!/usr/bin/env node var rrd = os = filename = '/tmp/test.rrd'; { return Math; } { { rrd; } ;} rrd;
Alpha
This module is in early development stage which means the API is not frozen etc... At this point not all rrdtool commands are binded. I did the ones that where the most important to me. If you really need xport or an other command feel free to contact me (thierry dot passeron at gmail dot com).
Tests
There are some (few) tests in /test done with mocha (http://visionmedia.github.com/mocha/). I plan to include more tests in the future.
License terms
Copyright (c), 2012 Thierry Passeron
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.