Code Monkey home page Code Monkey logo

zabbix-nut's Introduction

zabbix-nut

Zabbix template & script to monitor UPS exposed through NUT (https://networkupstools.org).

Currently only basic parameters are gathered (which are available on my UPS). Feel free to do PR to add other stuff, preferably in form of low-level discovery so that if it's not available - items are not created.

Single Python script that emits all information needed for discovery & data gathering in a single JSON. All items are defined as Dependent and extract relevant data using JSONPath queries.

Click to expand JSON example
{
 "vars": {
  "ups": {
   "battery.charge": 100,
   "battery.voltage": 27.7,
   "battery.voltage.high": 27.7,
   "battery.voltage.low": 21,
   "battery.voltage.nominal": 24.0,
   "device.mfr": "",
   "device.model": "1500VA",
   "device.type": "ups",
   "driver.name": "blazer_usb",
   "driver.parameter.pollinterval": 2,
   "driver.parameter.port": "auto",
   "driver.parameter.synchronous": "no",
   "driver.version": "2.7.4",
   "driver.version.internal": 0.12,
   "input.current.nominal": 6.0,
   "input.frequency": 50.0,
   "input.frequency.nominal": 50,
   "input.voltage": 221.7,
   "input.voltage.fault": 0.5,
   "input.voltage.nominal": 230,
   "output.voltage": 223.0,
   "ups.beeper.status": "enabled",
   "ups.delay.shutdown": 30,
   "ups.delay.start": 180,
   "ups.firmware": "",
   "ups.load": 26,
   "ups.mfr": "",
   "ups.model": "1500VA",
   "ups.productid": 5161,
   "ups.status": "OL",
   "ups.type": "offline / line interactive",
   "ups.vendorid": 665
  }
 },
 "list": [
  {
   "name": "ups"
  }
 ]
}

Features

  • Low level discovery of UPS
  • Items:
    • Voltage & Frequency
    • Battery voltage & charge
    • UPS Status
  • Triggers:
    • Voltage out of bounds
    • UPS status is not healthy
    • UPS is calibrating/in bypass/charging
  • Optional authentication (fill {$NUT_USERNAME} and {$NUT_PASSWORD} macros to enable)
  • Zabbix agent passive checks. Can be converted to active if needed.
  • Macros to customize triggers

Requirements

  • Tested on Zabbix 5.2, but should work on 4.2+
  • Python3

Installation

  • Place nut.conf in /etc/zabbix/zabbix_agentd.d
  • Place nut.py in /etc/zabbix/scripts You can put it into any other place, but then you'll have to adjust nut.conf
  • Restart zabbix-agentd
  • Import template_nut.xml
  • You're good to go

zabbix-nut's People

Contributors

blind-oracle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.