-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
NUT - Network UPS Tools Plug-in #6316
Comments
This would be nice to have. I looked very briefly at the NUT documentation, do you think the plugin would operate similar to the |
Yes, as a matter of fact the python script I built uses the same |
Would be nice to get an idea of how some actual data looks, could you show the output of your script? I believe this is the documentation for connecting to |
Sure, but it's it's not fully relevant since currently I just adapted a python script that was built for APCUPCd, so currently the fields match what APC would output:
Just for reference, Thinking about it I think it's better if I just show you the
|
I wonder how standardized these stats are, is there a list of possible stats? Likely we would want a plugin to connect to upsd and list all stats and then for each stat we would check a list of known stats to determine if the stat should be saved as a tag/field. If a stat is unknown we could either ignore the stat or add it based on the observed type:
If we find the use of a decimal point is not consistent, we may want to always store as float. I would think that the |
That's a very good idea. I'll have to dig into this a bit more. I found
Also found something we could use to replace
EDIT: I looked into it and they have quite complex documentation about this: To be honest there are more than I expected and I'm curious how much of them my UPS actually supports so I can actually test them. Thanks for the tip about memcached, I''ll look into that. |
Hi @kiwimato, just checking if you have any update in looking into referencing the |
Hello @sjwang90, unfortunately I didn't enough time to start work on it and my server where I had this setup crashed in the meantime, so I won't be able to work on it until I will fix it. |
Hello @kiwimato , do you still plan to create this nut plugin for telegraf ? I too am using nut for my UPS management and monitoring, and I would love to be able to send the metrics to influxdb/grafana using telegraf. |
Hey @Styx13, to be honest I didn't have time to yet and for my use case i created a workaround: https://github.com/kiwimato/nut-influxdb-exporter I still plan to work on it at some point, but don't have an ETA at this point. |
Just wanted to say it would be great if there was a NUT telegraf input! |
Is there any known update on this? Would like to have Telegram scraping data from the NUT instance running on another server. Not planning to switch over to apcupcd. |
Yeah, you can always use "inputs_exec" and run upsc. It's what I'm currently doing and it works fine.
|
I came across the issue and whipped up a script. Figured I'd share it for others. #!/bin/sh
if [ $# -lt 1 ]; then
echo "usage: $0 field [...field]" >&2
exit 1
fi
fields="$1"
shift
while [ $# -ne 0 ]; do
fields="$fields|$1"
shift
done
list=$(upsc -l 2>/dev/null)
safe_fields="$(echo "${fields}" | sed 's/\./\\\./g')"
for name in $list; do
props=$(upsc "$name" 2>/dev/null | sed -nE "/^($safe_fields):/p" | sed -nE 's/([^0-9])\.([^0-9])/\1_\2/g;s/^(.*): ([0-9.]+)$/\1=\2/p' | tr '\n' ',')
echo "ups,name=${name} ${props%,}"
done In my case I have that script at
|
@kiwimato @samuelkadolph Would either of your scripts be able list as an external plugin. If you would you be willing to submit this plugin as an external plugin that can be used with |
collecting the non-numeric ups.status value would also useful. Not entirely sure how to adapt the regexp so it becomes an accepted property for the script above. perhaps even transforming the abbreviated code for full-text status descriptions? e.g. |
Hi, Sorry if this is a dumb question, but ... as there is an official plugin for apcupsd, why not align with that => meaning, save the same parameter set with NUT? Thanks! |
I wrote this for myself, but then i found this comment, so I put it up on github/dockerhub -- maybe others will find it useful? https://github.com/midzelis/nut-ups-logger This will connect to NUT remotely, list all the UPS, and then send ALL the variables over a remote server. This can be telegraf running with the HTTP Listener plugin. By default, I send all the variables I find. If there is something you don't want, looks like telegraf can filter things out: https://docs.influxdata.com/telegraf/v1.19/administration/configuration/#measurement-filtering docker-compose.yml
telegraf.conf snippet
|
A very quick implementation of NUT client using It produces an almost identical set of metrics as |
This looks perfect. But how do I use this? I run telegraf as docker container. |
I may work on submitting this as a PR to the main repo next month depending on my availability |
Looking forward to the upsd support in the next release. Thank you @Malinskiy, @AdamLeyshon and @srebhan ! |
Feature Request
Hello guys,
I'm just curious if you have any plans in creating a plugin for NUT ? Similar to what you did for #2877
Proposal:
I volunteer to create it myself, but I'm new to Go, so I would need your support reviewing the code and most possibly also share the procedures you have for this kind of situations? i.e. Best practices or some docs about writing plugins.
Thanks!
Current behavior:
Currently only a plugin for APCUPCd exists.
Desired behavior:
Would be nice if a plugin for NUT exists, which offers a broader compatibility with UPS hardware.
Use case:
Currently I use Telegraf for my UnRaid setup, which monitors everything, and built a custom Docker container script which gathers data and sends it to InfluxDB. Another solution is to use an Exec, but that also requires having NUT installed in the Alpine container where Telegraf is. Therefore I would like a plugin, which doesn't have any external dependencies.
The text was updated successfully, but these errors were encountered: