Giter VIP home page Giter VIP logo

peanut's Introduction

PeaNUT

PeaNUT

A Tiny Dashboard for Network UPS Tools

PayPal Docker Pulls Crowdin

Installation

Install using Docker

docker run

docker run -p 8080:8080 --restart unless-stopped \
--env NUT_HOST=nut-upsd --env NUT_PORT=3493 \
--env WEB_PORT=8080 brandawg93/peanut

docker-compose.yml

services:
  peanut:
    image: brandawg93/peanut:latest
    container_name: PeaNUT
    restart: unless-stopped
    ports:
      - 8080:8080
    environment:
      - NUT_HOST=localhost
      - NUT_PORT=3493
      - WEB_PORT=8080

compile from source

git clone https://github.com/Brandawg93/PeaNUT.git
cd PeaNUT
npm i -g pnpm # only if you don't have pnpm installed
pnpm i
pnpm run build:local
pnpm run start:local

More examples can be found in the examples folder.

Environment Variables

Variable Default Description
NUT_HOST localhost Host of NUT server
NUT_PORT 3493 Port of NUT server
WEB_HOST localhost Hostname of web server
WEB_PORT 8080 Port of web server
USERNAME undefined Optional but required to edit
PASSWORD undefined Optional but required to edit
BASE_PATH undefined Base path for reverse proxy

API

API Call Description
GET /api/v1/devices Retrieves information about all UPS devices
GET /api/v1/devices/[ups] Retrieves information about the specified UPS device
GET /api/v1/devices/[ups]/var/[param] Retrieves value for a single parameter of the specified UPS device
POST /api/v1/devices/[ups]/var/[param] Saves value for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/var/[param]/description Retrieves description for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/var/[param]/type Retrieves type for a single parameter of the specified UPS device
GET /api/v1/devices/[ups]/commands Retrieves available commands for the specified UPS device
GET /api/v1/devices/[ups]/description Retrieves the description for the specified UPS device
GET /api/v1/devices/[ups]/clients Retrieves the connected clients for the specified UPS device
GET /api/v1/devices/[ups]/rwvars Retrieves writable variables for the specified UPS device

Homepage Support

For information about how to set up Homepage, check the Homepage docs.

Ex:

widget:
  type: peanut
  url: http://peanut.host.or.ip:port
  key: nameofyourups

Or use the customapi widget for complete customization!

Ex:

widget:
  type: customapi
  url: http://{HOSTNAME}:{PORT}/api/v1/devices/ups
  mappings:
    - field: battery.charge
      label: Battery Charge
      format: percent
    - field: battery.runtime
      label: Battery Runtime
      format: text
    - field: ups.load
      label: UPS Load
      format: percent
    - field: ups.status
      label: UPS Status
      format: text
      remap:
        - value: OL
          to: Online
        - value: OB
          to: On Battery
        - value: LB
          to: Low Battery
        - any: true
          to: Unknown

Tested Devices

A wiki has been compiled of tested UPS devices. Feel free to look there for your device or add your device to the list by submitting an issue with the tested device label.

Donate to Support PeaNUT

This project was made with you in mind. If you would like to show your appreciation for its continued development, please consider sponsoring me on Github.

peanut's People

Contributors

brandawg93 avatar dependabot[bot] avatar crowdin-bot avatar karelkryda avatar aazam476 avatar vhsdream avatar imgbotapp 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.