I have a remote site deployed with a Mitel Trust (previously Shoretel Cloud) phone system.

I desired a way to have my PRTG install monitor the status of the cloud hosted phone system.

I was able to find this webpage:

https://trust.shoretel.com/ShoreTelTrustSystemStatus?r=US/Canada

Which displays the current status of their systems in Green, Yellow, Red fashion.

Using the HTTP advanced sensor I was able to set the "exclude keyword" settings and right a regex to match:

Exclude keyword: - set sensor to warning if keyword is found response must not include: (Status BLUE|Status YELLOW|Status RED) - Regular expression

However, in an ideal setup I would have two (or more) sets of exclude keyword options so that I can set to "warning" when status is BLUE or YELLOW and set to "down" when status is RED.

I have worked around it by using two sensors, setting one to go "down" when status RED. And the other to go "warning" when Status YELLOW.

Is there any way to have multiple exclude (or require) keyword settings each with a unique sensor trip?

Thanks.

- Ben


Article Comments

Hi Ben,

Just tried some regex wizardry, but couldn't get it to work. Seems like a small PowerShell script would do this better:

param(
    $url = "https://trust.shoretel.com/ShoreTelTrustSystemStatus?r=US/Canada",
    $regexWarning = '(Status.BLUE|Status.Yellow)',
    $regexError   = '(Status.RED)'
)

$Content = (Invoke-WebRequest -Uri $url)

if($Content -match $regexWarning)  { Write-Host "0:Site status is either Blue or Red"; exit 1;  }
elseif($Content -match $regexError){ Write-Host "0:Site status is Red"; exit 2; }
else                               { Write-Host "0:Site is operating normally"; exit 0; }

Kind regards,
Stephan Linke, Tech Support Team


Feb, 2018 - Permalink

That worked great... eventually.

Turns out since I run PRTG as a service as the "Local System" account I needed to get Internet Explorer past the first run pop up ("preferred settings" window). A bunch of internet searching and I found this reference:

You will need PSexec for this from PStools – http://technet.microsoft.com/en-us/sysinternals/bb897553

psexec -s -i "%programfiles%\Internet Explorer\iexplore.exe"

Once I ran that on my PRTG server, everything worked as expected. I've enhanced the code a bit to allow 4 different possible results but couldn't have gotten it without that start.

Thanks so much for your reply.

- Ben


Feb, 2018 - Permalink

Hi Ben,

Welp, nice that you figured it out - always happy to help :)


Kind regards,
Stephan Linke, Tech Support Team


Mar, 2018 - Permalink