Skip to content
Newer
Older
100644 102 lines (75 sloc) 2.27 KB
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
1 ## About
2
3 node-statusmon is a monitoring framework, designed to run on clients and send
ae0945e @jperkin s/poll/probe/g
authored Feb 29, 2012
4 system information from a variety of probes to a collector/graphing system
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
5 such as rrd-simple or graphite.
6
ae0945e @jperkin s/poll/probe/g
authored Feb 29, 2012
7 node-statusmon effectively runs as a daemon, and each probe is configured with
8 its own `setInterval` frequency. Thus you can run some probes which change
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
9 frequently at high frequency, e.g. for cpu utilisation, adsl noise margin etc.,
10 while running others which are much more stable at a much lower frequency, e.g.
11 uptime, logged-in users, etc.
12
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
13 ## Install
14
15 node-statusmon is now published on [npm](http://www.npmjs.org/) so it is super
16 easy to install and run:
17
5aa1569 @jperkin Try different markdown syntax to make text bigger.
authored Apr 11, 2012
18 ```bash
19 npm install statusmon
20 statusmon
21 ```
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
22
23 Or you can grab the latest from the repository:
24
5aa1569 @jperkin Try different markdown syntax to make text bigger.
authored Apr 11, 2012
25 ```bash
26 git clone git://github.com/jperkin/node-statusmon.git
27 ```
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
28
29 And then either run it directly:
30
5aa1569 @jperkin Try different markdown syntax to make text bigger.
authored Apr 11, 2012
31 ```bash
32 cd node-statusmon
33 ./statusmon.js
34 ```
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
35
36 Or install it:
37
5aa1569 @jperkin Try different markdown syntax to make text bigger.
authored Apr 11, 2012
38 ```bash
39 cd node-statusmon
40 npm link
41 statusmon
42 ```
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
43
44 If you want a custom configuration, copy the default and pass it on the command
45 line as the first argument, for example:
46
5aa1569 @jperkin Try different markdown syntax to make text bigger.
authored Apr 11, 2012
47 ```bash
48 statusmon customconfig.js
49 ```
6377b24 @jperkin node-statusmon is now in npm as 'statusmon'.
authored Apr 11, 2012
50
0a6c6a8 @jperkin Add an example of how to write a plugin.
authored Feb 29, 2012
51 ## How To Write Probes
52
53 Writing probes is hopefully very simple. Here's an example from `system.js` to
54 get the current load average:
55
56 ```javascript
57 var os = require('os');
58
59 /*
60 * Probes take a callback argument of the function which updates the
61 * statistics. The callback takes an argument containing the key/value
62 * pairs to store in the database.
63 */
64 function get_loadavg(callback)
65 {
66 var vals = os.loadavg();
67 callback({
68 'system.loadavg.1min': vals[0],
69 'system.loadavg.5mins': vals[1],
70 'system.loadavg.15mins': vals[2]
71 });
72 }
73
74 /*
75 * Export back each probe you want to register.
76 */
77 module.exports.probes = {
78 'system.loadavg': get_loadavg,
79 }
80 ```
81
0a7e81a @jperkin Put modules into probes/ in case we want to use lib/ later for
authored Feb 29, 2012
82 Dump that into a file in `probes/` and it will be automatically registered.
0a6c6a8 @jperkin Add an example of how to write a plugin.
authored Feb 29, 2012
83
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
84 ## Status
85
86 Currently very bare-bones, general framework is in place, and modules can be
0a7e81a @jperkin Put modules into probes/ in case we want to use lib/ later for
authored Feb 29, 2012
87 put into `probes/` and automatically loaded.
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
88
89 A basic system provider, including cpu utilisation, load average, and uptime is
90 included.
91
92 ## TODO
93
94 Lots! At least get rrd-simple and graphite output formats fully functional,
ae0945e @jperkin s/poll/probe/g
authored Feb 29, 2012
95 and then start writing lots more probes.
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
96
97 My main aims are:
98
ae0945e @jperkin s/poll/probe/g
authored Feb 29, 2012
99 - write lots of probes
770c155 @jperkin First commit of node-statusmon, README.md has current status.
authored Feb 28, 2012
100 - ensure they are portable
101 - learn me more javascript!
Something went wrong with that request. Please try again.