louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.58k stars 5.41k forks source link

Adding NUT (Network UPS Tools) Monitor Type #3932

Open johnelliott opened 1 year ago

johnelliott commented 1 year ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

New Monitor

🔖 Feature description

NUT (Network UPS Tools) is a standard protocol for monitoring uninteruptable power supplies, AKA battery backups.

Common examples are on in datacenters, but home users have Synology NAS devices with most UPS with USB ports.

✔️ Solution

I add a monitor type for NUT and ask others in the community to test it.

❓ Alternatives

Current work-around without this feature: A user runs an additional docker container, a side-car like nut-exporter and makes an HTTP keyword monitor.

📝 Additional Context

There was already a similar APCUPSD issue, and this may address that use case too since NUT supports APC devices.

CommanderStorm commented 1 year ago

New monitor types are always appreciated. See our contribution guide: https://github.com/louislam/uptime-kuma/blob/87b2e45fbf31be91d19d89e6bead3b9653a1cd6e/CONTRIBUTING.md

See https://github.com/louislam/uptime-kuma/blob/master/server/monitor-types/dns.js for a reference on how to implement a monitor-type using the newer syntax and https://github.com/louislam/uptime-kuma/pull/3178/files for the other files that need editing

FoxxMD commented 1 month ago

For anyone else looking for NUT monitoring it can be pretty easily done without new code:

alternatively, use a Json Query monitor with the expression

`ups.status` in ["OL CHRG", "OL"]

and Expected Value true