« Tuto supervision avec GoAcces pour Bullseye » : différence entre les versions

Aller à la navigation Aller à la recherche
aucun résumé des modifications
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
  '''GoAccess tuto débutant complet Debian 11 Bullseyes et Apache'''  
  '''GoAccess tuto débutant complet Debian 11 Bullseyes et Apache'''  
copyleft Petitchat
-----
-----


Ligne 186 : Ligne 187 :


<code>
<code>
#! /bin/sh
#!/bin/sh
# /etc/systemd/system/goaccessd.sh
# /etc/systemd/system/goaccessd.sh
### BEGIN INIT INFO
### BEGIN INIT INFO
# Provides: goaccessd.sh
# Provides: goaccessd.sh
# Required-Start: $local_fs
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Default-Stop: 0 1 6
# Short-Description: génération en temps réel d'une page web synthétique des logs
# Short-Description: génération en temps réel d'une page web synthétique des logs
# Description:  génération en temps réel d'une page web synthétique des logs
# Description:  génération en temps réel d'une page web synthétique des logs
### END INIT INFO
### END INIT INFO
export HOME=/home
export HOME=/home
/bin/goaccess /var/log/apache2/other_vhosts_access .log -a -o /var/www/webreport.html --log-format=VCOMBINED --real-time-html –daemonize
/bin/goaccess /var/log/apache2/other_vhosts_access .log -a -o /var/www/webreport.html --log-format=VCOMBINED --real-time-html –daemonize
</code>
</code>


Ligne 268 : Ligne 269 :


<code>
<code>
######################################
######################################
# Log Format Options (required)
# Log Format Options (required)
######################################
######################################
#
#
# The log-format variable followed by a space or \t for
# The log-format variable followed by a space or \t for
# tab-delimited, specifies the log format string.
# tab-delimited, specifies the log format string.
#
#
# NOTE: If the time/date is a timestamp in seconds or microseconds
# NOTE: If the time/date is a timestamp in seconds or microseconds
# %x must be used instead of %d & %t to represent the date & time.
# %x must be used instead of %d & %t to represent the date & time.


# NCSA Combined Log Format
# NCSA Combined Log Format
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
# NCSA Combined Log Format with Virtual Host
log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"


# NCSA Combined Log Format with Virtual Host
# Common Log Format (CLF)
log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
log-format %h %^[%d:%t %^] "%r" %s %b


# Common Log Format (CLF)
# Common Log Format (CLF) with Virtual Host
log-format %h %^[%d:%t %^] "%r" %s %b
log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b


# Common Log Format (CLF) with Virtual Host
# W3C
log-format %v:%^ %h %^[%d:%t %^] "%r" %s %b
#log-format %d %t %h %^ %^ %^ %^ %r %^ %s %b %^ %^ %u %R


# W3C
# Squid native log format
#log-format %d %t %h %^ %^ %^ %^ %r %^ %s %b %^ %^ %u %R
#log-format %^ %^ %^ %v %^: %x.%^ %~%L %h %^/%s %b %m %U


# Squid native log format
# AWS | Amazon CloudFront (Download Distribution)
#log-format %^ %^ %^ %v %^: %x.%^ %~%L %h %^/%s %b %m %U
#log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^


# AWS | Amazon CloudFront (Download Distribution)
# Google Cloud Storage
#log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^
#log-format "%x","%h",%^,%^,"%m","%U","%s",%^,"%b","%D",%^,"%R","%u"


# Google Cloud Storage
# AWS | Elastic Load Balancing
#log-format "%x","%h",%^,%^,"%m","%U","%s",%^,"%b","%D",%^,"%R","%u"
#log-format %dT%t.%^ %^ %h:%^ %^ %T %^ %^ %^ %s %^ %b "%r" "%u"


# AWS | Elastic Load Balancing
# AWSS3 | Amazon Simple Storage Service (S3)
#log-format %dT%t.%^ %^ %h:%^ %^ %T %^ %^ %^ %s %^ %b "%r" "%u"
#log-format %^[%d:%t %^] %h %^"%r" %s %^ %b %^ %L %^ "%R" "%u"


# AWSS3 | Amazon Simple Storage Service (S3)
# Virtualmin Log Format with Virtual Host
#log-format %^[%d:%t %^] %h %^"%r" %s %^ %b %^ %L %^ "%R" "%u"
#log-format %h %^ %v %^[%d:%t %^] "%r" %s %b "%R" "%u"


# Virtualmin Log Format with Virtual Host
# Kubernetes Nginx Ingress Log Format
#log-format %h %^ %v %^[%d:%t %^] "%r" %s %b "%R" "%u"
#log-format %^ %^ [%h] %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" %^ %^ [%v] %^:%^ %^ %T %^ %^


# Kubernetes Nginx Ingress Log Format
# In addition to specifying the raw log/date/time formats, for
#log-format %^ %^ [%h] %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" %^ %^ [%v] %^:%^ %^ %T %^ %^
# simplicity, any of the following predefined log format names can be
 
# supplied to the log/date/time-format variables. GoAccess  can  also
# In addition to specifying the raw log/date/time formats, for
# handle  one  predefined name in one variable and another predefined
# simplicity, any of the following predefined log format names can be
# name in another variable.
# supplied to the log/date/time-format variables. GoAccess  can  also
#
# handle  one  predefined name in one variable and another predefined
log-format COMBINED
# name in another variable.
log-format VCOMBINED
#
log-format COMMON
log-format COMBINED
log-format VCOMMON
log-format VCOMBINED
#log-format W3C
log-format COMMON
#log-format SQUID
log-format VCOMMON
#log-format CLOUDFRONT
#log-format W3C
#log-format CLOUDSTORAGE
#log-format SQUID
#log-format AWSELB
#log-format CLOUDFRONT
#log-format AWSS3
#log-format CLOUDSTORAGE
#log-format AWSELB
######################################
#log-format AWSS3
# UI Options
 
######################################
######################################
# UI Options
######################################
</code>
</code>


Ligne 342 : Ligne 343 :
Par défaut la page html générée par goaccess contient de nombreux panneaux ; certains sont plus utiles que d'autres, cacher les panneaux qu'on juge inutiles accroît de beaucoup la lisibilité des informations. Dans la section « Parse Options » il y a un bloc « ignore-panel » en bas ; il est possible de décommenter des lignes pour ignorer telle ou telle donnée. L'exemple suivant ignore les panneaux « Requests static », « Not Found », « Referreres », « Keaphrases » et « status_codes » :
Par défaut la page html générée par goaccess contient de nombreux panneaux ; certains sont plus utiles que d'autres, cacher les panneaux qu'on juge inutiles accroît de beaucoup la lisibilité des informations. Dans la section « Parse Options » il y a un bloc « ignore-panel » en bas ; il est possible de décommenter des lignes pour ignorer telle ou telle donnée. L'exemple suivant ignore les panneaux « Requests static », « Not Found », « Referreres », « Keaphrases » et « status_codes » :


 
</code>
######################################
######################################
# Parse Options
# Parse Options
######################################
######################################
...
...
# Ignore parsing and displaying the given panel.
# Ignore parsing and displaying the given panel.
#
#
#ignore-panel VISITORS
#ignore-panel VISITORS
#ignore-panel REQUESTS
#ignore-panel REQUESTS
ignore-panel REQUESTS_STATIC
ignore-panel REQUESTS_STATIC
ignore-panel NOT_FOUND
ignore-panel NOT_FOUND
#ignore-panel HOSTS
#ignore-panel HOSTS
#ignore-panel OS
#ignore-panel OS
#ignore-panel BROWSERS
#ignore-panel BROWSERS
#ignore-panel VISIT_TIMES
#ignore-panel VISIT_TIMES
#ignore-panel VIRTUAL_HOSTS
#ignore-panel VIRTUAL_HOSTS
ignore-panel REFERRERS
ignore-panel REFERRERS
#ignore-panel REFERRING_SITES
#ignore-panel REFERRING_SITES
ignore-panel KEYPHRASES
ignore-panel KEYPHRASES
ignore-panel STATUS_CODES
ignore-panel STATUS_CODES
#ignore-panel REMOTE_USER
#ignore-panel REMOTE_USER
#ignore-panel CACHE_STATUS
#ignore-panel CACHE_STATUS
#ignore-panel GEO_LOCATION
#ignore-panel GEO_LOCATION  
 
</code>


=== 5.3 Changer le format des logs d'Apache ===
=== 5.3 Changer le format des logs d'Apache ===
70

modifications

Menu de navigation