Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

hapromo

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapromo

Haproxy Monitor library

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

HAProxy monitor library

Build Status

Usage:

require('hapromo');

var hapromo = new Hapromo({  
  user : 'username',  
  pass : 'password',  
  host : 'somehost.com',  
  path : '/pathtostats;csv',  
  interval : 5000  
});  

hapromo.on(server_event, function(data) {  
	// Handle event  
});  

Installation:

npm install hapromo

List of built-in events:

server_up
server_down
error
update

Creating a custom filter with a handler function:

hapromo.addFilter({ criteria : [  
    { header : 'svname', op : 'ne', value : 'FRONTEND' },  
    { header : 'svname', op : 'ne', value : 'BACKEND' },  
    { header : 'scur', op : 'gt', value : function(data) { return 0.70 * data.slim; } }  
  ], handler : function(data) {  
    	console.log('High load on server %s!', data.svname);  
    	// Handle it  
	}  
});  

Same, but register as event instead:

hapromo.addFilter({ criteria : [  
    { header : 'svname', op : 'ne', value : 'FRONTEND' },  
    { header : 'svname', op : 'ne', value : 'BACKEND' },  
    { header : 'scur', op : 'gt', value : function(data) { return 0.70 * data.slim; } }  
  ], event : 'high_load'  
});

FAQs

Package last updated on 04 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts