allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
17.88k stars 1.09k forks source link

Unraid Docker Template for GoAccess #2241

Open masterwishx opened 2 years ago

masterwishx commented 2 years ago

im using GregYankovoy/docker-goaccess and its working after all problems.. but its v1.4 Now im trying to create this docker for unraid but its not starting . this is my config is it right ? maybe im missing something for start ? tryed ports 8080:7890 , 7890:7890 what is right ports ?

image image

allinurl commented 2 years ago

It should be 7890. Though, I'm not sure how you have it set up.

masterwishx commented 2 years ago

changed to 7890:7890 it was 8080:7890 becase its wrote in docs: image

this run after changed :

image

but how to add (goaccess --somethink) after container builded and not started ? goaccess --no-global-config --config-file=/access/goaccess.conf becose in GregYankovoy/docker-goaccess it was builded inside of container : goaccess --somethink

CMD ["sh" "/usr/local/bin/goaccess.sh"] (# ready to go /sbin/tini -s -- nginx -c /opt/nginx.conf /sbin/tini -s -- goaccess --no-global-config --config-file=/config/goaccess.conf)

allinurl commented 2 years ago

Glad that did the trick. Thanks for sharing that.

Safe to close this?

masterwishx commented 2 years ago

Glad that did the trick. Thanks for sharing that.

Safe to close this?

No, I still can't run it, how to add command line goaccess - something?

masterwishx commented 2 years ago

I mean container is stopped after creation, becose it need to be runner with command (goaccess --no-global-config --config-file=/access/goaccess.conf) I think, but I don't know where to put it and how to add it to container?

masterwishx commented 2 years ago

fixed by adding needed line to post argument :

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='goaccess2' --net='proxynet' -e TZ="Asia/Jerusalem" -e HOST_OS="Unraid" -e 'PUID'='99' -e 'PGID'='100' -p '7890:7890/tcp' -v '/mnt/user/appdata/goaccess2/data/':'/goaccess':'rw' -v '/mnt/user/Logs/NginxProxyManager/proxy_logs.log':'/goaccess/access.log':'rw' -v '/mnt/user/appdata/goaccess2/html/index.html':'/goaccess/index.html':'rw' 'allinurl/goaccess' /goaccess --no-global-config --config-file=/goaccess/goaccess.conf

but having some problem : image

allinurl commented 2 years ago

Looks like a path issue. Have you tried running it as (please change the paths accordingly):

$ echo 'log-format VCOMBINED' > /home/user/goaccess.conf
$ sudo mkdir /srv
$ sudo cat access.log | docker run -v /home/user/goaccess.conf:/srv/goaccess.conf --rm -i -e LANG=$LANG allinurl/goaccess -a -o html -p /srv/goaccess.conf - > report.html
masterwishx commented 2 years ago

Yes i know but dont know how to fix it i dont have a lot expireience in dockers and Unraid template but tryed to change volume from /goaccess to [/var/www/goaccess] like in docker but still need post argument command to run after container created and started and first it what log file ... but if i write log path its not working ... i will try like you said but not shure how tranform it to unraid temlate

allinurl commented 2 years ago

Sorry, I can't help you with Unraid as I have not used it. Take a look at that example I posted and see if you are able to match that to the config in Unraid. Let me know if that helps or if you find a solution.

masterwishx commented 2 years ago

OK i will try Thanks

allinurl commented 2 years ago

Any updates on this? Take a look at this post, maybe related.

masterwishx commented 2 years ago

Any updates on this? Take a look at this post, maybe related.

Thanks , its really like my problem in Unraid , i also founded that goaccess in start command is no needed . but i still cant get it working somehow ,i even changed all values like in example.. image

Dont know if its good i used /var/www/goaccess when its start , i dont have log and container restart always i will try to remove and install from start it

masterwishx commented 2 years ago

i installed from start and entered values like in example ,but having error image image

masterwishx commented 2 years ago

im really dont know what else to do , gregyankovoy/goaccess work well but old version i think i need to check what he did more closly inside container and commands on github ...

masterwishx commented 2 years ago

With this setting also no logs of container and no webUI but i can get to console also having a lot of cpu usage like 25% image

dont know what to do ....

masterwishx commented 2 years ago

should be root:root used in container direcotory ? tryed to change to root but same ..... changed back to nobody:users in container using 99:100

allinurl commented 2 years ago

Are you able to post this question to the unraid folks/project? They may have better insights on this issue as it sounds it's a config issue. Let me know if they have some feedback. Thanks

masterwishx commented 2 years ago

100% its config issue, i already asked if some one using official version ,but no answer in Unraid forum,also made a CA Template Request - GoAccess #306 (https://github.com/selfhosters/unRAID-CA-templates/issues/306) but like i said befor there is old temlate that using in Unraid gregyankovoy/goaccess.

lordraiden commented 2 years ago

Any update on this? is there a working configuration for Unraid?

masterwishx commented 2 years ago

Any update on this? is there a working configuration for Unraid?

No , or i dont know how to adopt it ,the only working docker for unraid is https://github.com/GregYankovoy/docker-goaccess but with old version

allinurl commented 2 years ago

@masterwishx have you tried updating the Dockerfile from v1.4 to 1.5.5?

masterwishx commented 2 years ago

@masterwishx have you tried updating the Dockerfile from v1.4 to 1.5.5?

No, I wanted and made copy of his github but I need to upload docker image but don't have much time for now

masterwishx commented 2 years ago

we have now working container for unraid

goaccess-for-nginxproxymanager

allinurl commented 2 years ago

@masterwishx Thanks for sharing that link!

masterwishx commented 2 years ago

@masterwishx Thanks for sharing that link!

Founded only today, posted yesterday in Unraid CA apps

masterwishx commented 2 years ago

@masterwishx Thanks for sharing that link!

https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/issues/28 i founded a lot of CPU usage and i can see like 15000 request adding every second ...

masterwishx commented 2 years ago

@allinurl

Thanks for sharing that link!

Do you know maybe what the problem can be and where to look to solve issue? i have a lot of request every second and so a lot of CPU usage but some days befor the problem is gone and now its back https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/issues/28 Many Thanks

allinurl commented 2 years ago

@masterwishx I'd run goaccess directly without docker, and see if the issue persists, we want to make sure the layers on top are not the culprit. Also, where are you seeing 15K reqs/sec?

masterwishx commented 2 years ago

Sorry, I didn't saw you answer befor. Can you please see https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/issues/38 But in old container of GregYankov goaccess v 1.4 for unraid I don't have this problem

masterwishx commented 2 years ago

i see it in webUI (Total Requests,VIRTUAL HOSTS,Tx. Amount) also another user confirmed have this issue

image

masterwishx commented 2 years ago

I'd run goaccess directly without docker, and see if the issue persists, we want to make sure the layers on top are not the culprit. Also, where are you seeing 15K reqs/sec?

Do you mean to check if v1.5.5 working correctly? becouse old contaner v1.4 https://github.com/GregYankovoy/docker-goaccess working without problems ...

allinurl commented 2 years ago

If you can run it without docker then we can see if it has something to do with docker. Also, where do you see the 15000 reqs/s?

masterwishx commented 2 years ago

I posted above it's webGui GUI in total request and also in every day's befor, I saved pdf file when docker start I have like 5000 request in day but after some time it's increasing... Also I have old version docker of GregYankov v 1.4 and there is no problem

allinurl commented 2 years ago

are you able to run goaccess without docker? also, can you share some stats about the access log, e.g.,

// day 1
wc -l access.log 

// day 2
wc -l access.log 

etc...
masterwishx commented 2 years ago

For now i have two docker :

  1. old one v1.4 https://github.com/GregYankovoy/docker-goaccess - using one file proxy_logs.log -working with no Problem. (i not deleted it becose of problem in new one)
  2. new one v 1.5.5 https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/ - using auto finding all files proxy-host-*access.log also proxy-host-access.log..gz .

Do you mean to run without docker goaccess to check v1.5.5 that used in new docker of https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/ ? i can try ...

i can post pdf files i saved of both dockers when also New one it started and its OK and when its after some time and having a lot of request.

an you share some stats about the access log, e.g

OK but how i make it for every day ?

these are log for new docker . image

image

FoxxMD commented 2 years ago

where is the html supported to be generated to? The dockerfile for goaccess doesn't add nginx but it does expose a port. Does goaccess serve the file itself?

masterwishx commented 2 years ago

The problem is also here https://github.com/xavier-hernandez/goaccess-for-nginxproxymanager/issues/38

image image

image

As you can see its added a millions hit for 3 days only for now :

image

image

masterwishx commented 2 years ago

This is old v1.4 from GregYankovoy :

image

masterwishx commented 2 years ago

goaccess serve the file itself?

Yes in GoAccess-NPM-Logs .

masterwishx commented 2 years ago

I have Logs in '/mnt/user/Logs/NginxProxyManager ' becose of old v1.4 container that working OK .

Also forgot to mention that i still have next line in some of proxy host in NPM :

NPM Proxy Logs to one file for goaccess monitoring

access_log /config/logs/proxy_logs.log proxy; error_log /config/log/proxy_errors.log warn;

That was added for logs for old Greg Container but this two log files not used by GoAccess-NPM-Logs .... but think i posted befor this info ...