dzomaya/NUTandRpi

Accessing UPS info page results in "Error: can't open template file (upsstats.html)"

sebasdt opened this issue ยท 2 comments

Hi,

As I talked before in a earlier #8 issue
Here is what I could find.

Linux OS:
Debian 11

The issue:
While trying to access the UPS info page The user receives a Error: can't open template file (upsstats.html)

Possible causes:

  • Something is up with the permissions.
  • The file doesn't exist on the host.

What I could find is that the upsstats.html seems to be missing on the machine.
Trying to find the files with a upsstats in there name with: find / -name "upsstats.*" results in:
/usr/share/man/man8/upsstats.cgi.8.gz
/usr/share/man/man5/upsstats.html.5.gz
/usr/lib/cgi-bin/nut/upsstats.cgi

Solution!
here it is

Turns out two files were missing from NUT it self here is how to get the website working again:

1. On the host system go to the NUT directory with `cd /etc/nut`

2. Create a file called `nano upsstats.html` and paste the contents of [upsstats.html.sample](https://raw.githubusercontent.com/networkupstools/nut/master/conf/upsstats.html.sample) to the file.

3. Now do the same for `nano upsstats-single.html` with the contents of [upsstats-single.html.sample](https://raw.githubusercontent.com/networkupstools/nut/master/conf/upsstats-single.html.sample)

Now reload the page and it should be up and running.

If more information is needed feel free to ask.

Okay great news,

Got the information site up and running again after some time looking around.

Turns out two files were missing from NUT it self here is how to get the website working again:

  1. On the host system go to the NUT directory with cd /etc/nut
  2. Create a file called nano upsstats.html and paste the contents of upsstats.html.sample to the file.
  3. Now do the same for nano upsstats-single.html with the contents of upsstats-single.html.sample

The files are located on the networkUpsTools (NUT) github repo.

Now reload the page and it should be up and running.
That's it. Im closing this issue since it is solved.

@sebasdt
Great issue write ups and thank you for detailing the conclusion too! I should to think about if there needs to be doc updates or changes to make it better going forward, but this was great and can help people who run into something similar.

I appreciate you using the project.