winston-zabbix
v0.0.3
Published
Zabbix transport for Winston log utility.
Downloads
10
Maintainers
Readme
winston-zabbix
Installation
$ npm install winston
$ npm install winston-zabbix
Usage
/*
* Requiring `winston`
*/
var winston = require('winston');
/*
* Requiring `winston-zabbix` will expose
* `winston.transports.Zabbix` for attaching as plugin to winston
*/
require('winston-zabbix').Zabbix;
winston.add(winston.transports.Zabbix, {"host": "127.0.0.1", "level": "debug", key: "test"});
winston.log("error", "Hello", "World");
The Zabbix transport uses node-zabbix-sender behind the scenes. Options are the following:
- host: Zabbix server hostname. [required]
- port: Zabbix trapper port (default: 10051)
- timeout: is a socket timeout in milliseconds, when connecting to the zabbix server
- with_timestamps: when you log, timestamp will be added as well
- items_host: a target monitored host in zabbix. used when you don't specify the host when you log
- key: key name for trapper item. You have to configure this in Zabbix. [required]
- level: Level of messages that this transport should log.
- silent: Boolean flag indicating whether to suppress output.
- tags: You can defined tags for your Zabbix alert message.
License
MIT License
Copyright (c) 2017 Akashdeep Singh
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.