Skip to content

Commit

Permalink
Correct time since last save calc
Browse files Browse the repository at this point in the history
  • Loading branch information
xawen authored Jun 10, 2017
1 parent a0840f2 commit 3d47f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NetScaler-ConfigSavedState.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ switch ($ConfigResults.nsconfig.configchanged)
"True" {$ConfigChanged = 1}
}
$LastConfigChangedTime = $expDate = [datetime]::ParseExact($ConfigResults.nsconfig.lastconfigchangedtime, "ddd MMM d HH:mm:ss yyyy", $null)
$LastConfigSaveTime = $expDate = [datetime]::ParseExact($ConfigResults.nsconfig.lastconfigsavetime, "ddd MMM d HH:mm:ss yyyy", $null)
$MinutesOfUnsavedChanges = [math]::truncate(($LastConfigChangedTime - $LastConfigSaveTime).TotalMinutes)
$Now = Get-Date

If ($MinutesOfUnsavedChanges -lt 0) {$MinutesOfUnsavedChanges = 0}
If ($ConfigChanged -eq 0) {$MinutesOfUnsavedChanges = 0}
Else {$MinutesOfUnsavedChanges = [math]::truncate(($Now - $LastConfigChangedTime).TotalMinutes)}

Write-Host "<prtg>"

Expand Down

0 comments on commit 3d47f7b

Please sign in to comment.