From 6d1b5d2f5813d1e4f89f9bef5a36cc40afa6b2e9 Mon Sep 17 00:00:00 2001 From: hcornet Date: Sun, 7 Jul 2024 08:19:22 +0200 Subject: [PATCH] add nxlog --- nxlog/README.md | 3 +++ nxlog/nxlog_setup.ps1 | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nxlog/README.md create mode 100644 nxlog/nxlog_setup.ps1 diff --git a/nxlog/README.md b/nxlog/README.md new file mode 100644 index 0000000..eef43f8 --- /dev/null +++ b/nxlog/README.md @@ -0,0 +1,3 @@ +# Applications + +Applications \ No newline at end of file diff --git a/nxlog/nxlog_setup.ps1 b/nxlog/nxlog_setup.ps1 new file mode 100644 index 0000000..d8301d1 --- /dev/null +++ b/nxlog/nxlog_setup.ps1 @@ -0,0 +1,19 @@ +# +$fichier1 = "nxlog-ce-3.2.2329.msi" + +$url1 = "https://nxlog.co/system/files/products/files/348/nxlog-ce-3.2.2329.msi" +$file1 = "C:\tmp\"+$fichier1 + +$url2 = "https:///nxlog.conf" +$file2 = "C:\Program Files\nxlog\conf\nxlog.conf" + +$SERVER_IP = Read-Host -Prompt 'What is the IP of your syslog server? ' + +# Download and install nxlog +(New-Object -TypeName System.Net.WebClient).DownloadFile($url1, $file1) +Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i $file1 /q" -wait + +# Download and modify nxlog configuration and restart nxlog +(New-Object -TypeName System.Net.WebClient).DownloadFile($url2, $file2) +(Get-Content "C:\Program Files (x86)\nxlog\conf\nxlog.conf").replace("CHANGEME", $SERVER_IP) | Set-Content $file2 +Restart-Service -Name nxlog \ No newline at end of file