Initial commit

This commit is contained in:
Charlie Root 2023-11-23 20:25:52 +01:00
parent 94caeace67
commit 2e91b76747
1 changed files with 53 additions and 0 deletions

53
matomo.cf Normal file
View File

@ -0,0 +1,53 @@
#
#
#
bundle agent matomo
{
vars:
"src" string => "https://builds.matomo.org/matomo-4.15.1.zip";
"dst_dir" string => "$(sys.workdir)/data/agent/matomo";
"zip_file" string => "$(dst_dir)/matomo-4.15.1.zip";
"log_importer_install_dir" string => "/usr/local/bin";
"log_importer" string => "$(log_importer_install_dir)/import_logs.py";
}
bundle agent download_matomo
{
vars:
files:
"$(matomo.dst_dir)/."
create => "true",
handle => "matomo_download_dir_created";
methods:
"any" usebundle => download_file("wget","$(matomo.src)","$(matomo.zip_file)","matomo_zip_file",'{}'),
depends_on => {"matomo_download_dir_created"},
handle => "matomo_downloaded";
}
bundle agent install_matomo_log_importer
{
classes:
"importer_exists" expression => fileexists("$(matomo.log_importer)");
methods:
"any" usebundle => download_matomo;
commands:
!importer_exists::
"unzip"
args => "-o -j $(matomo.zip_file) matomo/misc/log-analytics/import_logs.py -d $(matomo.log_importer_install_dir)",
depends_on => {"matomo_downloaded"},
handle => "matomo_log_importer_installed",
contain => wmde_cmd_useshell;
importer_exists::
"/usr/bin/true"
inform => "false",
handle => "matomo_log_importer_installed";
}