Get-RibbonSbcUptime.ps1 invokes a REST login to your Sonus/Ribbon SBC 1k/2k/SWe-Lite and reports how long it’s been running: the CpuUptime.
It outputs to the pipeline either a timespan object, or a literal string in the same format the SBC displays on its System/Overview tab.
The minimum parameters are the SBC FQDN, the REST login name and REST password. An optional parameter is “-AsTimeString”.
PS C:\>.\Get-RibbonSbcUptime.ps1 -SbcFQDN 10.10.16.82 -RestLogin REST -RestPassword MyRestPwD -AsTimeString
If you fail to provide any of the required parameters, the script will prompt you for them.
The default output is a timespan object:
Days : 2 Hours : 20 Minutes : 3 Seconds : 10 Milliseconds : 0 Ticks : 2449900000000 TotalDays : 2.83553240740741 TotalHours : 68.0527777777778 TotalMinutes : 4083.16666666667 TotalSeconds : 244990 TotalMilliseconds : 244990000
With the “-AddTimeString” switch the script will output a literal version of the uptime, in the same format as the SBC shows on its System/Overview tab:
3 days, 20 hrs, 4 mins, 48 secs
If you’re automating this script, you can capture its output into a variable to work on in a subsequent flow. If you ARE doing this, make sure you add the “-SkipUpdateCheck” switch, otherwise when I post an update it will break the automation:
PS C:\> $SbcUptime = (.\Get-RibbonSbcUptime.ps1 -SbcFQDN 10.10.16.82 -RestLogin REST -RestPassword P@ssw0rd1 -Verbose -SkipUpdateCheck)
SBC firmware versions prior to v8.0.3 have a known bug: the CpuUptime reports zero. This is not a problem with the script. If the script reports zero but System/Overview reports an expected value, you’ll need to update the SBC’s firmware.
I’ve added an update-checking component so it will let you know as updates become available. You can suppress the update check by running it with the “-SkipUpdateCheck” parameter, which you should ALWAYS add if you’re running the script via a scheduled task or some other automated/unattended means.
You’ll find the code-signed script available to download at the Gallery.TechNet site.
1.0 – 16th November 2019.
- This is the initial release.