Sha256: b76ab4ef81dcd4216283d2104d4b6c3b6840e2b96f8429d72101e7683a5e6cc6
Contents?: true
Size: 922 Bytes
Versions: 4
Compression:
Stored size: 922 Bytes
Contents
# # metric-windows-uptime.ps1 # # DESCRIPTION: # This plugin collects and outputs the Uptime in seconds in a Graphite acceptable format. # # OUTPUT: # metric data # # PLATFORMS: # Windows # # DEPENDENCIES: # Powershell # # USAGE: # Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -File C:\\etc\\sensu\\plugins\\metric-windows-uptime.ps1 # # NOTES: # # LICENSE: # Copyright 2016 sensu-plugins # Released under the same terms as Sensu (the MIT license); see LICENSE for details. # $ThisProcess = Get-Process -Id $pid $ThisProcess.PriorityClass = "BelowNormal" $Counter = ((Get-Counter "\System\System Up Time").CounterSamples) $Path = ($Counter.Path).Trim("\\") -replace " ","_" -replace "\\","." -replace "[\{\}]","" -replace "[\[\]]","" $Value = [System.Math]::Truncate($Counter.CookedValue) $Time = [int][double]::Parse((Get-Date -UFormat %s)) Write-Host "$Path $Value $Time"
Version data entries
4 entries across 4 versions & 1 rubygems