npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zbx_sender

v0.2.1

Published

A node.js library for sending data to a remote Zabbix server.

Downloads

13

Readme

zbx_sender

zbx_sender is library for sending data to a remote Zabbix server. On the Zabbix server an item of type Zabbix trapper should be created with corresponding key. Note that incoming values will only be accepted from hosts specified in Allowed hosts field for this item.

Installation

    npm install zbx_sender

Usage

Simple example:

     var util = require("util");

     var options = {
         "zabbix-server" : "10.0.0.171",
         "port" : "10051",
         "realtime" : false,
         "with-timestamps" : true,
         "verbose" : true
     };
     
    var zbx_sender = require('zbx_sender').createZabbixSender(options);

    zbx_sender.on('data',function(resp,data){
         console.log('Got response: '+JSON.stringify(resp));
         data && console.log('    for data: '+data);
     });

    zbx_sender.on('error',function(err,orig,data){
        console.log('Error: '+ err.message);
        orig && console.log('   Orig error: '+ util.inspect(orig));
        data && console.log('   On data: '+ util.inspect(data));
    });

     zbx_sender.send([
         {
             'host': 'TEST',
             "clock" : 1418746700,
             "key" : 'item2',
             "value": 110
         },
         {
             'host': 'TEST',
             "clock" : 1418746710,
             "key" : 'item2',
             "value": 180
         }
     ]);

Options

zabbix-server

IP address of Zabbix server. If a host is monitored by a proxy, proxy IP address should be used instead.

port

Specify port number of server trapper running on the server. Default is 10051.

host

Specify host name as registered in Zabbix frontend. Will be used as default if not specified in sending data.

source-address

Specify source IP address

with-timestamps

Each portion of sending data must contain "clock" field with timestamp in Unix timestamp format. If "clock" is not specified, current time will be used.

real-time

Send values one by one as soon as they are received. By default library will collect data for one second.

verbose

Verbose mode. Event "data" will return response with items. Usefull then response is "success", but not all items was processed.

Methods

send

Take object with required fileds "key" and "value". Optionally can be set "host" (if not specified, will be used default from "option") and "clock" (makes sense only if option "with-timestamps" was set).

Events

zbx_sender inherits EventEmitter, and will emit this events:

data

Got response from Zabbix server

error

Got error while trying to send data