Get the most out of your Centmin Mod LEMP stack
Become a Member

Featured Sysadmin GoAccess open source real time web log analyzer

Discussion in 'System Administration' started by eva2000, Jun 5, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    1:10 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what does cron-goaccess.sh contain ? also for code you may want to use CODE tags for perserving formatting

     
  2. Dnyan

    Dnyan Member

    106
    24
    18
    Sep 16, 2017
    Ratings:
    +36
    Local Time:
    8:40 PM
    1.17.8
    10.3.22
    it contains

    HTML:
    #!/bin/sh
    echo "start"
    now=$(date +"%T")
    echo "Current time : $now"
    
    /usr/bin/zcat -f /home/nginx/domains/mydomain.com/log/access.log* | goaccess -p /etc/goaccess.conf -a > /home/nginx/domains/mydomain.com/public/my_report.html
    echo "finish"
    
     
  3. Dnyan

    Dnyan Member

    106
    24
    18
    Sep 16, 2017
    Ratings:
    +36
    Local Time:
    8:40 PM
    1.17.8
    10.3.22
    Finally made it workable by adding following in crontab

    Code:
    0 * * * * /bin/zcat -f /home/nginx/domains/mydomain.com/log/access.log* | /usr/local/bin/goaccess -a -o /home/nginx/domains/mydomain.com/public/my_report.html -
    a space and dash at the end of the cron is added purposefully to make it work.

    this cron runs every hour at 0 minutes.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    1:10 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    space and dash shouldn't be needed. I think using full path to goaccess is what made it work ?
     
  5. ElChorizo

    ElChorizo Premium Member Premium Member

    54
    7
    8
    Apr 29, 2021
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.19.10
    10.3.28
    Is there an updated tutorial for this? Also, I'm trying to process error.log to see which top URL's generate errors and this doesn't seem to work for that.
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    1:10 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. ElChorizo

    ElChorizo Premium Member Premium Member

    54
    7
    8
    Apr 29, 2021
    Ratings:
    +11
    Local Time:
    10:10 AM
    1.19.10
    10.3.28