Skip to content

Commit fc9340e

Browse files
authored
Merge pull request #1 from djgus/patch-1
Script Fixes
2 parents 67cfb50 + ba73fae commit fc9340e

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

GLC.ps1

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<#-----------------------------------------------------------------------------------------------------------------------------
2-
Galaxy Logs Collector Version 4.02
2+
Galaxy Logs Collector Version 1.1.0
33
Script, Knowledge & Bugs, Eran Binyamin Zeitoun (ezeitoun@dalet.com)
44
-------------------------------------------------------------------------------------------------------------------------------#>
55

66
Add-Type -AssemblyName System.Windows.Forms
77

88
$strComputerName = $env:COMPUTERNAME #Get Computer Name from Environment Variables
9-
$strCurrentTime = (get-date).ToString("ddmmyyyy_hhmmss") #Current Time/Date as String
9+
$strCurrentTime = (get-date).ToString("yyyyMMdd_HHmmss") #Current Time/Date as String
1010
$strProcessName = "DaletGalaxy" #Process Name
1111
$strToolsPath = "C:\GLC\" #3rd party tools path
12-
$strStoragePath = "C:\GLC\Files\" #Compressed archive targtet path
12+
$strStoragePath = "C:\GLC\Files\" #Compressed archive target path
1313
$strWorkPath = $env:TEMP + "\GLC\" #Temp files path
1414
$StrServersLogsXML = "\\yourShare\LogsToCollect.xml" #Galaxy site XML file
1515
$BolClose = $true #Display Save and Close button
16-
$strDestination = ($strStoragePath + $strCurrentTime + "_" + $strComputerName + ".zip") #Compressed archive file name]
16+
$strDestination = ($strStoragePath + $strCurrentTime + "_" + $strComputerName + ".zip") #Compressed archive file name
1717
$ScriptPath = $MyInvocation.MyCommand.Path #Script source path
1818
$IntHours = 4 #Logs Collection Range (Hours)
1919

@@ -153,7 +153,7 @@ ProgBar "Collecting Galaxy Client Logs" 65
153153
$DaletLogs = Get-ChildItem "C:\ProgramData\Dalet\DaletLogs\" -Recurse | Where-Object { $_.LastWriteTime -gt (Get-Date).AddHours(-$IntHours) }
154154
foreach ($item in $DaletLogs) {
155155
if ($item.PSIsContainer -eq $false) {
156-
$NewfileName = $strWorkPath + $strCurrentTime + $item.Name + ".Log"
156+
$NewfileName = $strWorkPath + $strCurrentTime + $item.Name
157157
Copy-Item $item.FullName -Destination $NewFileName
158158
}
159159
}
@@ -175,20 +175,23 @@ if ([System.IO.File]::Exists($StrServersLogsXML)) {
175175
Write-Host "dealing with agent $agent"
176176
$path = "\\$hostName\c$\ProgramData\Dalet\DaletLogs\$siteName-$agent@$hostAlias"
177177
$serverLogs = Get-ChildItem "$path" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
178-
$NewfileName = $strWorkPath + $strCurrentTime + $serverLogs.Name + ".Log"
178+
$NewfileName = $strWorkPath + $strCurrentTime + $serverLogs.Name
179179
Copy-Item $serverLogs.FullName -Destination $NewFileName
180180
}
181181
}
182182
}
183183

184-
<# Gather Windows Enviroment Varibales #>
184+
<# Gather Windows Environment Variables #>
185185
ProgBar "Collecting Environment Settings" 85
186-
$TempPath = $strWorkPath + $strCurrentTime + "_Enviroment.txt"
186+
$TempPath = $strWorkPath + $strCurrentTime + "_Environment.txt"
187187
Get-ChildItem env: | Out-File $TempPath
188188

189189
<# Compress all files into a single Zip #>
190190
ProgBar "Compressing Everything" 90
191-
Compress-Archive -Path $strWorkPath -DestinationPath $strDestination
191+
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
192+
$includeBaseDirectory = $false
193+
Add-Type -AssemblyName System.IO.Compression.FileSystem
194+
[System.IO.Compression.ZipFile]::CreateFromDirectory("$strWorkPath","$strDestination",$compressionLevel,$includeBaseDirectory)
192195

193196
ProgBar "Galaxy Logs Collection Completed!" 100
194197

@@ -200,4 +203,4 @@ if ($global:result -eq [System.Windows.Forms.DialogResult]::Yes) { Stop-Process
200203
$form.Dispose()
201204

202205
<# Good Bye! #>
203-
exit
206+
exit

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Galaxy Logs Collector v1.02
1+
# Galaxy Logs Collector v1.1.0
22

33
This PowerShell script is designed to simplify the process of gathering Galaxy Logs (both user and server-side) for troubleshooting purposes.
44

55
Extract the provided ZIP file to a preferred location (placing the script on the local client machine is recommended).<br />
6-
Once completed, you have two options: create a shortcut to the GLC.BAT file or run GLC Create (with Admin rights) to generate a shortcut on the Desktop, complete with a default hotkey (Ctrl + Shift + F12).<br />
6+
Once completed, you have two options: create a shortcut to the GLC.BAT file or run GLC.ps1 Create (with Admin rights) to generate a shortcut on the Desktop, complete with a default hotkey (Ctrl + Shift + F12).<br />
77
If you opt for automatic creation, The following shortcut will be create on the desktop:<br />
88
![image001](https://github.com/ezeitoun/GLC/assets/57022870/948dfbd5-acfc-4a7e-9230-5729ddce6933)
99

@@ -15,7 +15,7 @@ In this window, users can input details about their activities when the issue oc
1515
Clicking "Save and Close" will collect the logs (including DMP generation or copying a Galaxy Client generated one) and close (kill) the Dalet Galaxy client.<br />
1616
Alternatively, clicking "Save" will collect the logs (and generate a DMP file) without terminating the client. This option is suitable for freezes that typically resolve after a period.
1717

18-
As of version 1.02, the script collects the following:
18+
As of version 1.1.0, the script collects the following:
1919
- Input User for Incident Report
2020
- Generate or Copy DMP File (⚠️)
2121
- Capture Galaxy Client Screenshot
@@ -24,7 +24,7 @@ As of version 1.02, the script collects the following:
2424
- Collect Galaxy Client Logs
2525
- Collect Galaxy Servers Logs
2626
- Gather Windows Environment Variables
27-
⚠️ To enable DMP support, Please download ProcDump (https://learn.microsoft.com/en-us/sysinternals/downloads/procdump) and extract it to the GLC location.<br />
27+
⚠️ To enable DMP support, Please download ProcDump x64 (https://learn.microsoft.com/en-us/sysinternals/downloads/procdump) and extract it to the GLC location.<br />
2828
(Galaxy Client Screenshot Capture Improvement, Server-side log collections by Laurnet Goetz (lgoetz@dalet.com)
2929

3030
The script can be configure by modifying the following variables:
@@ -37,7 +37,7 @@ The script can be configure by modifying the following variables:
3737
- $IntHours (default 4), Galaxy Client log collection range (in hours).
3838

3939
Server-side log collection:
40-
In this updated GLC version (1.02), it is now feasible to collect particular agent logs alongside the local logs of the host where the script is initiated. <br />
40+
In this updated GLC version (1.1.0), it is now feasible to collect particular agent logs alongside the local logs of the host where the script is initiated. <br />
4141
This is achieved through the configuration of an XML file that specifies the desired servers and agents for the log gathering process. <br />
4242
We advise against the wholesale collection of logs from all agents on every machine, as it may have an adverse impact on network traffic.<br />
4343
Instead, we recommend a targeted approach, focusing on specific strategic agents such as dbServers, DaletPlusServers, and NATServers, as these are commonly implicated in most issues requiring investigation.<br />

0 commit comments

Comments
 (0)