kjake / pfmon-docker

Easy setup of InfluxDb and Grafana for viewing Telegraf metrics from pfSense
https://hub.docker.com/r/kjake/pfmon-docker
4 stars 2 forks source link

Grafana Login? #1

Closed jasonmbautista closed 3 years ago

jasonmbautista commented 3 years ago

I've pulled the docker image using portainer, but when I go to the local IP:Port for Grafana it asks for a user/pass. I've tried the defaults as well as the user/pass called out in the docker-compose but neither seem to work. Any insight as to what I've done wrong?

kjake commented 3 years ago

Hi!

Grafana should enable anonymous login. I just launched it via docker-compose and confirmed that it is still doing that.

This is what I used: https://github.com/kjake/pfmon-docker/blob/master/docker-compose.yml

Then browsed to localhost:4000 and was sent right into the default dashboard as expected.

That said, you can set the admin password to 'admin' by running the following: docker exec -it pfweb grafana-cli admin reset-admin-password admin

jasonmbautista commented 3 years ago

Went through this morning and tried again. It still asks me for the user/pass. Must be the way I'm using portainer to build the container. Using the CLI commands to reset the password I can login and see the dashboard. I'm getting InfluxDB "bad gateway" errors. I'm running pfSense 2.5.2. I used the gateway.py "(for pfSense >= 2.4.5)" for my setup which I think is correct. I appreciate the help.

Here is what I'm doing to get the container up:

  1. Add container using portainer (version 2.9.1)
  2. change port mappings as needed
  3. deploy container --> container starts and is happy
  4. Make changes to pfsense using the steps laid out

    5. Open http://host:4000 --> takes me to login page asking for user/pass where defaults do not work

    6. reset admin password

    7. login and change Grafana password

  5. Dashboard launches, bad gateway errors popup. example: Templating [server] Error updating options: InfluxDB Error: Bad Gateway

edited 5, 6 and 7 - I figured this one out. The ENV variables in the docker compose weren't being brought over when I use Portainer. Adding them in manually allows for anonymous login. I still have the Bad Gateway errors though.

Again, thank you for the help.

kjake commented 3 years ago

Hi there - there are definitely problems here because I haven't been maintaining this. I've already fixed some of it locally, but I need to do some more testing, then I'll push an update here.

jasonmbautista commented 3 years ago

Thanks! I’ll keep an eye out for your updates. Just wanted to make sure it wasn’t something on my end borking things up.

kjake commented 3 years ago

Changelog of sorts:

  1. Pinned InfluxDb to 1.8.x in Compose file
  2. Updated template.db to be current with 8.x builds of Grafana
  3. Updated map plugin
  4. Updated template.db and dashboard template to use new map plugin name
  5. Removed uid from Compose file and chown command from Dockerfile as they are no longer appropriate for Grafana 8.x
  6. Set Grafana's default login to admin:password

Start from scratch, to make sure this installs correctly, by removing ./config and ./influxdb folders and updating your Compose from the latest version in the repo.

Finally, I wanted to warn that I stopped developing and using this after my pfSense crashed some time ago. I still use pfSense, but I largely no longer use pfBlockerNG or HAProxy, so there was less value in running these containers for me.

I'm happy to keep poking at this, but it looks like there is a more recent project that you may want to check out! https://github.com/VictorRobellini/pfSense-Dashboard

jasonmbautista commented 3 years ago

I went and tried to build this again and it is still throwing up bad gateway errors across the board. I wanted to use your container setup as it is the most straightforward for me to follow and build. I'll give the other one a shot as well but it looks like they have moved away from a docker format. If you have any ideas on the bad gateway errors I would appreciate the insight, but if you do not have the time I completely understand as this is not an active project for you. Thanks!

kjake commented 3 years ago

Thanks for the update. I'll take a fresh look at it tomorrow!

kjake commented 3 years ago

All looks good here. Perhaps there's something cached on your end?

I'd recommend stopping the pfweb and influxdb-pfmon containers and then running docker system prune -a on your system:

WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache

edit:

followed by docker volume prune

I'm going to setup Portainer a sec to see if this is somehow related to how it handles compose files.

kjake commented 3 years ago

I've updated the docker-compose.yml to be more friendly towards portainer by defaulting to putting data into docker volumes instead of trying to map the current host directory to a container directory, which portainer doesn't have access to by default.

After this push, I could deploy as a stack within portainer directly from the git repo, without any changes needed.

CleanShot 2021-10-25 at 12 04 19@2x

That said, I did also test just copy/pasting in the docker-compose.yml into the web editor and the stack launched OK that way too.

jasonmbautista commented 3 years ago

It must be something in my environment causing issues. I'll have to take a look at it more closely to see what might be going on. Thank you for going through all the updates, I really appreciate it. Ultimately it might be better for me to spin up a new instance and install both grafana and influxdb normally instead of a container. Again, thank you for all the help.

kjake commented 3 years ago

Marking as closed since I've done what I can to update and address the concerns.