crossan007 / APCUPSD-Multimon-Docker

Docker-ized method of creating an HTTP-accessible interface for multiple attached APC ups devices
2 stars 1 forks source link

Not available: upsfetch: tcp_open failed for 127.0.0.1 port 3551, docker syntax? #1

Open SomePersonSomeWhereInTheWorld opened 3 years ago

SomePersonSomeWhereInTheWorld commented 3 years ago

So I updated the docker-compose.yml file to match our UPSes. I ran:

  1. docker build apcupsd-image
    Sending build context to Docker daemon  4.096kB
    Step 1/5 : FROM alpine:3.7
    ---> 6d1ef012b567
    Step 2/5 : RUN apk update && apk add --no-cache bash apcupsd
    ---> Using cache
    ---> ec8abf39fb6d
    Step 3/5 : COPY ./apcupsd.conf /etc/apcupsd/apcupsd.conf
    ---> Using cache
    ---> 1ed02c289b6a
    Step 4/5 : COPY ./entrypoint.sh /usr/local/bin/
    ---> Using cache
    ---> 5b3fd3fff05c
    Step 5/5 : CMD ["/usr/local/bin/entrypoint.sh"]
    ---> Using cache
    ---> bd8efc00f2d2
    Successfully built bd8efc00f2d2
  2. # docker run -d bd8efc00f2d2

docker ps --no-trunc
CONTAINER ID                                                       IMAGE          COMMAND                          CREATED              STATUS              PORTS     NAMES
7815b93e0fe6b87305293e13b1882111fddd7bbaa081d237aa1ee183d79085e5   bd8efc00f2d2   "/usr/local/bin/entrypoint.sh"   About a minute ago   Up About a minute             trusting_rosalind

But I only get: "Local Host Not available: upsfetch: tcp_open failed for 127.0.0.1 port 3551"

Any tips to get this working?

crossan007 commented 3 years ago

the UPS_TO_MONITOR variable needs to be the same as the service names of the UPS(s) you want to watch.

Docker compose's internal DNS resolver will map those names to IPs; they likely won't be 127.0.0.1

stephengrenfell commented 8 months ago

I have the same error. Using Docker with APCUPSD-CGI

Not available: upsfetch: tcp_open failed for Debian-x79 port 3551

Here's my APCUPSD-CGI code

`version: '3.9' services: apcupsd-cgi: image: bnhf/apcupsd-cgi:latest container_name: apcupsd-cgi dns_search: Workgroup # Set to your LAN's domain name (often local or localdomain), this should help with local DNS resolution of hostnames ports:

Any thoughts how I might solve the problem.