New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


HTTP Content Sensor wih String

Votes:

0

Your Vote:

Up

Down

Is it possible to have a sensor like http Content which can handle real Content like Strings.

We have some Status Websites with the following simple text output

Status: [OK] Info: [Everything OK]

Now it would be nice to have a sensor that can handle the two words in [ ] as a channel like the http content sensor. But with that i got an "Unexpected Format: OK" error...

The Info als can have values like "Import of File was not successfully" and so on.

Any solution for this?

http-content-sensor strings unexpected-format

Created on Dec 17, 2014 9:06:52 AM by  andreasender6840 (130) 1 1



Best Answer

Accepted Answer

Votes:

2

Your Vote:

Up

Down

Now we have created our own "Costum Sensor" with a vbs check Here the vbs file

'GetHTMLSource.vbs

 args = WScript.Arguments.Count

 if args <> 1 then
   Wscript.Echo "usage: GetHTMLSource.vbs URL"
   wscript.Quit
 end if

 URL = WScript.Arguments.Item(0)

 Set WshShell = WScript.CreateObject("WScript.Shell")

 Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", URL, FALSE
http.send ""
 
 
responseText = http.responseText
 if InStr(http.responseText,"OK") > 0 then
 WScript.Echo "0:" & http.responseText
 Wscript.quit ("0")
 Elseif InStr(http.responseText,"WARNING") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("1")
 Elseif InStr(http.responseText,"CRITICAL") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("2")
Elseif InStr(http.responseText,"UNKNOWN") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("2")
 Else
 WScript.Echo "1:result not valid"
 Wscript.quit ("1")
 End if

Created on Dec 18, 2014 9:27:54 AM by  andreasender6840 (130) 1 1

Last change on Dec 18, 2014 9:39:30 AM by  Torsten Lindner [Paessler Support]



3 Replies

Votes:

1

Your Vote:

Up

Down

Please look the Sensor "HTTP Advanced Sensor" with the option "Check For Existing Key Words" this should help you. Enable key word check (positive) : In the result returned at the URL, check if a key word exists.

https://www.paessler.com/manuals/prtg/http_advanced_sensor.htm

Hope it helps!

Created on Dec 17, 2014 12:08:22 PM by  Carlos Echeverria (70) 1



Votes:

0

Your Vote:

Up

Down

That works.

But with "HTTP Advanced Sensor" it is not possible to Display the Website Output.

I will try it with a costum sensor and a vbs script.

Created on Dec 17, 2014 3:39:52 PM by  andreasender6840 (130) 1 1



Accepted Answer

Votes:

2

Your Vote:

Up

Down

Now we have created our own "Costum Sensor" with a vbs check Here the vbs file

'GetHTMLSource.vbs

 args = WScript.Arguments.Count

 if args <> 1 then
   Wscript.Echo "usage: GetHTMLSource.vbs URL"
   wscript.Quit
 end if

 URL = WScript.Arguments.Item(0)

 Set WshShell = WScript.CreateObject("WScript.Shell")

 Set http = CreateObject("Microsoft.XmlHttp")
http.open "GET", URL, FALSE
http.send ""
 
 
responseText = http.responseText
 if InStr(http.responseText,"OK") > 0 then
 WScript.Echo "0:" & http.responseText
 Wscript.quit ("0")
 Elseif InStr(http.responseText,"WARNING") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("1")
 Elseif InStr(http.responseText,"CRITICAL") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("2")
Elseif InStr(http.responseText,"UNKNOWN") > 0 then
 WScript.Echo "1:" & http.responseText
 Wscript.quit ("2")
 Else
 WScript.Echo "1:result not valid"
 Wscript.quit ("1")
 End if

Created on Dec 18, 2014 9:27:54 AM by  andreasender6840 (130) 1 1

Last change on Dec 18, 2014 9:39:30 AM by  Torsten Lindner [Paessler Support]



Please log in or register to enter your reply.


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.