Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sebasdt opened this issue Jan 16, 2023 · 7 comments
Closed

Comments

@sebasdt
Copy link

sebasdt commented Jan 16, 2023

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..

@dzomaya
Copy link
Owner

dzomaya commented Jan 18, 2023

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.

@dzomaya
Copy link
Owner

dzomaya commented Jan 22, 2023

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?

@sebasdt
Copy link
Author

sebasdt commented Jan 24, 2023

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

@sebasdt
Copy link
Author

sebasdt commented Feb 5, 2023

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!

@dzomaya
Copy link
Owner

dzomaya commented Feb 5, 2023

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

@sebasdt
Copy link
Author

sebasdt commented Feb 7, 2023

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)

@dzomaya
Copy link
Owner

dzomaya commented Feb 7, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants