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

Issue with creating group #17

Closed
radokristof opened this issue Apr 3, 2024 · 9 comments
Closed

Issue with creating group #17

radokristof opened this issue Apr 3, 2024 · 9 comments

Comments

@radokristof
Copy link

radokristof commented Apr 3, 2024

I'm still having problems with groups even after the last fix in #8

INFO [autokuma::sync] Creating new monitor: bitwarden
WARN [autokuma::sync] Cannot create monitor bitwarden because group vault does not exist

The only difference from sample config is that I'm using a custom tag_name: AutoKumaL01

The group is indeed there, the name is also correct.

@radokristof
Copy link
Author

The trick with removing parent_name now has different behavior. If I remove it, the monitor will be created (outside of the group of course) but adding it back will just cause another error:

INFO [autokuma::sync] Updating monitor: bitwarden
WARN [autokuma::sync] Encountered error during sync: No group named vault could be found

@BigBoot
Copy link
Owner

BigBoot commented Apr 3, 2024

Hmm, looks like I harcoded the kuma label name to AutoKuma when resolving groups and forgot to read it from the config.

@radokristof
Copy link
Author

I just changed it because multiple instances (servers) connect to the same uptime-kuma server. If I don't change it, it will interfere with each other.

@BigBoot
Copy link
Owner

BigBoot commented Apr 3, 2024

Should work now on latest master

@BigBoot BigBoot closed this as completed Apr 3, 2024
@undaunt
Copy link

undaunt commented Apr 12, 2024

@BigBoot I'm still seeing this behavior on latest master. Could it be a combination of other factors?

  autokuma:
    image: ghcr.io/bigboot/autokuma:latest
    container_name: autokuma
    restart: unless-stopped
    profiles: ["all","kuma","morty"]
    networks:
      - $PROXY_NETWORK
      - $SOCKET_NETWORK
    depends_on:
      - uptime-kuma
    environment:
      - AUTOKUMA__KUMA__URL=http://uptime-kuma:3001
      - AUTOKUMA__KUMA__USERNAME=${KUMA_USER}
      - AUTOKUMA__KUMA__PASSWORD=${KUMA_PASSWORD}
      - AUTOKUMA__TAG_NAME=autokuma
      - DOCKER_HOST=http://socket-proxy:2375
    labels:
      - kuma.kuma.group.name=Kuma
      - kuma.{{container_name}}.docker.parent_name=kuma
      - kuma.{{container_name}}.docker.name=Autokuma
      - kuma.{{container_name}}.docker.docker_container={{container_name}}
      - kuma.{{container_name}}.docker.docker_host=1

Edit: I tried both parent_name as well as parent, with both Kuma and kuma.

Edit 2: Below is my new go to format (for now) and I'm leaving the parent lines commented out otherwise I get an error.

      #- kuma.${AUTOKUMA_GROUP_ID_MONITORING}.group.name=${AUTOKUMA_GROUP_NAME_MONITORING}
      #- kuma.{{container_name}}-http.http.parent_name=${AUTOKUMA_GROUP_NAME_MONITORING}
      - kuma.{{container_name}}-http.http.name=Portainer HTTP
      - kuma.{{container_name}}-http.http.url=http://port.$DOMAINNAME
      #- kuma.{{container_name}}.docker.parent_name=${AUTOKUMA_GROUP_NAME_MONITORING}
      - kuma.{{container_name}}.docker.name=Portainer
      - kuma.{{container_name}}.docker.docker_container={{container_name}}
      - kuma.{{container_name}}.docker.docker_host=1

@undaunt
Copy link

undaunt commented Apr 13, 2024

Following up on my prior, I noted that the groups do appear to work when they are lowercase.

This works

      - kuma.{{container_name}}.group.name=portainer
      #- kuma.{{container_name}}-http.http.parent_name=Portainer
      - kuma.{{container_name}}-http.http.name=Portainer Web
      - kuma.{{container_name}}-http.http.url=https://port.$DOMAINNAME
      - kuma.{{container_name}}-docker.docker.parent_name=portainer
      - kuma.{{container_name}}-docker.docker.name=Portainer Docker
      - kuma.{{container_name}}-docker.docker.docker_container={{container_name}}
      - kuma.{{container_name}}-docker.docker.docker_host=1

This fails

      - kuma.{{container_name}}.group.name=Portainer
      #- kuma.{{container_name}}-http.http.parent_name=Portainer
      - kuma.{{container_name}}-http.http.name=Portainer Web
      - kuma.{{container_name}}-http.http.url=https://port.$DOMAINNAME
      - kuma.{{container_name}}-docker.docker.parent_name=Portainer
      - kuma.{{container_name}}-docker.docker.name=Portainer Docker
      - kuma.{{container_name}}-docker.docker.docker_container={{container_name}}
      - kuma.{{container_name}}-docker.docker.docker_host=1

This also works, creating a capitalized group and assigning the members to the group, but I'm not sure why it works.

      - kuma.{{container_name}}.group.name=Portainer
      - kuma.{{container_name}}-http.http.parent_name=portainer
      - kuma.{{container_name}}-http.http.name=Portainer Web
      - kuma.{{container_name}}-http.http.url=https://port.$DOMAINNAME
      - kuma.{{container_name}}-docker.docker.parent_name=portainer
      - kuma.{{container_name}}-docker.docker.name=Portainer Docker
      - kuma.{{container_name}}-docker.docker.docker_container={{container_name}}
      - kuma.{{container_name}}-docker.docker.docker_host=1

@BigBoot
Copy link
Owner

BigBoot commented Apr 13, 2024

The parent_name is referring to the autokuma id of the group, not the display name, so this should work:

      - kuma.${AUTOKUMA_GROUP_ID_MONITORING}.group.name=${AUTOKUMA_GROUP_NAME_MONITORING}
      - kuma.{{container_name}}-http.http.parent_name=${AUTOKUMA_GROUP_ID_MONITORING}
      - kuma.{{container_name}}-http.http.name=Portainer HTTP
      - kuma.{{container_name}}-http.http.url=http://port.$DOMAINNAME
      - kuma.{{container_name}}.docker.parent_name=${AUTOKUMA_GROUP_ID_MONITORING}
      - kuma.{{container_name}}.docker.name=Portainer
      - kuma.{{container_name}}.docker.docker_container={{container_name}}
      - kuma.{{container_name}}.docker.docker_host=1

@undaunt
Copy link

undaunt commented Apr 13, 2024

Awesome, that makes sense, super helpful. Is parent_name documented? I thought I saw parent in the attributes available.

@BigBoot
Copy link
Owner

BigBoot commented Apr 13, 2024

It's mentioned in the usage section of the readme and is handled purely by autokuma, I added this as a way to reference other monitors as there would be no way to get the actual id from uptime kuma before creating the parent, the MONITOR_TYPES.md is generated from uptime kuma source and therefore doesn't include it.

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

3 participants