Want to subscribe to topics you're interested in?
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

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:46 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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:
    6:16 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:
    6:16 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

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:46 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    space and dash shouldn't be needed. I think using full path to goaccess is what made it work ?
     
  5. ElChorizo

    ElChorizo Member

    79
    10
    8
    Apr 29, 2021
    Ratings:
    +18
    Local Time:
    7:46 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

    58,895
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:46 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  7. ElChorizo

    ElChorizo Member

    79
    10
    8
    Apr 29, 2021
    Ratings:
    +18
    Local Time:
    7:46 AM
    1.19.10
    10.3.28