Skip to content

mehdi-shokohi/winston-transport-zabbix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Winston Transports For Zabbix

Using NPM Package of winston-transport-zabbix

- app.js

const winston = require('winston');
const winstonZabbix = require('winston-transport-zabbix')

const logger = winston.createLogger({

  transports: [
    new winstonZabbix({with_timestamps:true,items_host:"APP_HOST_NAME",server: "172.20.0.3", level: "info", key: "project_info_key"}),
    new winstonZabbix({with_timestamps:true,items_host:"APP_HOST_NAME",server: "172.20.0.3", level: "error", key: "project_error_key"}),
    new winstonZabbix({with_timestamps:true,items_host:"APP_HOST_NAME",server: "172.20.0.3", level: "warn", key: "project_warn_key"}),

  ]

});

logger.info("InFo Log ")
logger.warn("Warn Log ")
logger.error("Error Log ")

Run Code

# npm install winston-transport-zabbix
# node app.js 

Parameters

with_timestamps : Add Local Time to Log Body.

items_host : Host Name of Application that is Defined By Zabbix Admin.

server : Address of Zabbix Server.

level : winston Log level title.

key : In Zabbix Per Each Host defined one or more key as Item By Zabbix Admin .

About

zabbix sender(trapper) for winston (node.js logger)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published