dzomaya / NUTandRpi

A repo for Network UPS Tools and Eaton Tripp Lite UPS demo scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script is failing to install "snmp-mibs-downloader" on debian 11.

sebasdt opened this issue · comments

Hi,

I was trying to install NUT using this amazing script. the only thing that seems to be failing is that apt can't find "snmp-mibs-downloader".

This is the error it spits out:
`Package snmp-mibs-downloader is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'snmp-mibs-downloader' has no installation candidate
cp: cannot stat '/etc/snmp/snmpd.conf': No such file or directory`

I do have to say I needed to reinstall due to me not having the right UPS plugged in. I'm using Linux Debian 11 on a Intel processor..

Without digging into it (yet), my hunch is it is related to the fact the snmp-mibs-downloader is in a the "non-free" repo:
https://packages.debian.org/bullseye/snmp-mibs-downloader
Updating the apt sources list /etc/apt/sources.list might be a quick workaround (but that could be objectionable for a few reasons).

I'll circle back on this one over the weekend or next week.

I did some testing on a Debian 11 system (no UPS connected) and reproduced the issue. Then I uninstalled what the script installs (see: https://github.com/dzomaya/NUTandRpi#how-to-uninstall ; errors for uninstall of snmp-mibs-downloader are expected), added the non-free repos to /etc/apt/sources.list, ran apt update, and tried again. With the non-free repos enabled, snmp-mibs-downloader installed successfully when I ran the script again.

Here is what the /etc/apt/sources.list file that works looks like (I added all the non-free text you see, everything else is default):

deb http://deb.debian.org/debian bullseye main non-free
deb-src http://deb.debian.org/debian bullseye main non-free
deb http://security.debian.org/debian-security bullseye-security main non-free
deb-src http://security.debian.org/debian-security bullseye-security main non-free
deb http://deb.debian.org/debian bullseye-updates main non-free
deb-src http://deb.debian.org/debian bullseye-updates main non-free
deb http://deb.debian.org/debian bullseye-backports main non-free
deb-src http://deb.debian.org/debian bullseye-backports main non-free

@sebasdt
Is this a viable workaround for you?

Nice! thank you for your work.
I will test it out later this week and let you know if it has worked!

Hi,

Sorry for taking so to long to reply. Life just came right trough the door.

Anyway snmp has been installed successfully with the script after setting the source.list to non-free.
SNMP is working and displays the values correctly.
I cant seem to find the use case why snmp is better than using upsc directly to for example grafana.

The last problem the system is running into the UPS info website (ip.address/cgi-bin/nut/upsstats.cgi).
It aint showing nothing and displays this error:
Error: can't open template file (upsstats.html)
Before the reinstall it worked just fine.. could it be the reinstall removed a little too much?

well than this should be it, the last problem to solve.
Thank you for your time in advance!

SNMP is working and displays the values correctly.

Great, thanks! I should consider adding to docs or something. For now, at least we have this reference.

I cant seem to find the use case why snmp is better than using upsc directly to for example grafana.

The SNMP use case is really for network monitoring tools (Observium, LibreNMS, etc). A lot of those tools use SNMP to communicate with a wide variety of devices. The Grafana case I toyed with a bit (there's a screenshot of that in the README), but didn't vet enough to make it part of this project (at least not yet).

It aint showing nothing and displays this error:
Error: can't open template file (upsstats.html)
Before the reinstall it worked just fine.. could it be the reinstall removed a little too much?

Seems like something went wrong with permissions. I'll need to mess around with it a little to give more precise advice. If I get some time during the week, I'll circle back. If I take too long, nudge me here!

It feels similar to this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249893 but I don't want to mislead with some FreeBSD specifics that might send you down a rabbit hole!

@sebasdt

cool man!

Think it would be better if a new issue is opened for the "upsstats.html" error. Just to keep things clean and organized.
As for now it seems like upsstats.html is gone.
Trying to locate the file with:
find / -name "upsstats.*"

returns only there directories:
/usr/share/man/man8/upsstats.cgi.8.gz, /usr/share/man/man5/upsstats.html.5.gz, /usr/lib/cgi-bin/nut/upsstats.cgi

Also thank you for your help! Its the most useful I've gotten on a git issue.

edit:
Issue has been resolved. here below is the #9 solution
#9 (comment)

Also thank you for your help! Its the most useful I've gotten on a git issue.

That's great to read! Thank you for using the project!