What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Multiple exclude keywords in HTTP advanced sensor (using to monitor mitel trust status)

Votes:

0

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

http http-advanced prtg

Created on Feb 16, 2018 3:15:18 PM



3 Replies

Votes:

0

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

Created on Feb 19, 2018 9:14:53 AM by  Stephan Linke [Paessler Support]



Votes:

0

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

Created on Feb 28, 2018 2:35:49 PM



Votes:

0

Hi Ben,

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


Kind regards,
Stephan Linke, Tech Support Team

Created on Mar 1, 2018 7:40:51 AM by  Stephan Linke [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.