Skip to content

Commit

Permalink
Merge pull request #1 from djgus/patch-1
Browse files Browse the repository at this point in the history
Script Fixes
  • Loading branch information
ezeitoun authored Dec 10, 2023
2 parents 67cfb50 + ba73fae commit fc9340e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
23 changes: 13 additions & 10 deletions GLC.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<#-----------------------------------------------------------------------------------------------------------------------------
Galaxy Logs Collector Version 4.02
Galaxy Logs Collector Version 1.1.0
Script, Knowledge & Bugs, Eran Binyamin Zeitoun ([email protected])
-------------------------------------------------------------------------------------------------------------------------------#>

Add-Type -AssemblyName System.Windows.Forms

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

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

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

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

ProgBar "Galaxy Logs Collection Completed!" 100

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

<# Good Bye! #>
exit
exit
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Galaxy Logs Collector v1.02
# Galaxy Logs Collector v1.1.0

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

Extract the provided ZIP file to a preferred location (placing the script on the local client machine is recommended).<br />
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 />
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 />
If you opt for automatic creation, The following shortcut will be create on the desktop:<br />
![image001](https://github.com/ezeitoun/GLC/assets/57022870/948dfbd5-acfc-4a7e-9230-5729ddce6933)

Expand All @@ -15,7 +15,7 @@ In this window, users can input details about their activities when the issue oc
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 />
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.

As of version 1.02, the script collects the following:
As of version 1.1.0, the script collects the following:
- Input User for Incident Report
- Generate or Copy DMP File (⚠️)
- Capture Galaxy Client Screenshot
Expand All @@ -24,7 +24,7 @@ As of version 1.02, the script collects the following:
- Collect Galaxy Client Logs
- Collect Galaxy Servers Logs
- Gather Windows Environment Variables
⚠️ To enable DMP support, Please download ProcDump (https://learn.microsoft.com/en-us/sysinternals/downloads/procdump) and extract it to the GLC location.<br />
⚠️ 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 />
(Galaxy Client Screenshot Capture Improvement, Server-side log collections by Laurnet Goetz ([email protected])

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

Server-side log collection:
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 />
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 />
This is achieved through the configuration of an XML file that specifies the desired servers and agents for the log gathering process. <br />
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 />
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 />
Expand Down

0 comments on commit fc9340e

Please sign in to comment.