Kaseya Community

Web page monitoring

  • Has anyone figured out how to monitor a web page for the presence or absence ofa specific character string? This would be important for monitoring dynamic pages that are generated through web applications, to determine if the application is producing an error.

    Legacy Forum Name: Web page monitoring,
    Legacy Posted By Username: LarryNST
  • Yes.

    I created a script to-do this. I have posted it under the script forum.


    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: far182
  • Thanks for the reply. Can you help me with a link to that script? There are several sections discussing scripts and I'm not finding it easily.

    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: LarryNST
  • WebPing.zip
    Web Ping.

    It will ping a URL of your choice and check for a txt string in the web page. Also, it will email you when it goes down and email you when it goes back online.

    Before you run the main script (Web Ping www.YourCompany.com.txt) you must run the "Web Ping WriteKey.txt" script just once on the computer. This will setup the key that the main script will use.

    Schedule the main script as often as you want to check your URL. I have had this run every 60seconds at some clients.

    Attached are the files and below is what they are:



    Script Name: Web Ping www.YourCompany.com
    Script Description:

    IF True
    THEN
    Write Script Log Entry
    Parameter 1 : ********Web Ping Start
    OS Type : -1
    Get Variable
    Parameter 1 : 2
    Parameter 2 : www.YourCompany.com
    Parameter 3 : url
    OS Type : 0
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : tempdir
    OS Type : 0
    Delete File
    Parameter 1 : #tempdir#\webping2.txt
    OS Type : 0
    Execute File
    Parameter 1 : #tempdir#\curl-nossl.exe
    Parameter 2 : -o #tempdir#\webping.txt http://www.YourCompany.com
    Parameter 3 : 1
    OS Type : -1
    Get URL
    Parameter 1 : #url#
    Parameter 2 : #tempdir#\webping2.txt
    Parameter 3 : 3
    OS Type : 0
    Pause Script
    Parameter 1 : 5
    OS Type : -1
    Execute Script
    Parameter 1 : Web Ping Check Result File (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 :
    Parameter 3 : 0
    OS Type : 0
    ELSE


    Script Name: Web Ping Result
    Script Description:

    IF Check Variable
    Parameter 1 : #pingdetail#
    Contains :html
    THEN
    Execute Script
    Parameter 1 : Web Ping Result Success (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 :
    Parameter 3 : 0
    OS Type : 0
    ELSE
    Execute Script
    Parameter 1 : Web Ping Result Failed (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 :
    Parameter 3 : 0
    OS Type : 0


    Script Name: Web Ping Result Success
    Script Description:

    IF Check Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\LastPingResult
    = :0
    THEN
    Send Email
    Parameter 1 : YourEmail@YourCompany.com
    Parameter 2 : *****Web URL PING***** Ping URL Success for #url#, Back Online
    Parameter 3 : #url#
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\LastPingResult
    Parameter 2 : 1
    Parameter 3 : REG_DWORD
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : *****Web URL PING***** Ping URL Success for #url#, Back Online
    OS Type : 0
    ELSE


    Script Name: Web Ping Result Failed
    Script Description:

    IF Check Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\LastPingResult
    = :1
    THEN
    Send Email
    Parameter 1 : YourEmail@YourCompany.com
    Parameter 2 : Ping URL Failed for #url#
    Parameter 3 : #url#
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\LastPingResult
    Parameter 2 : 0
    Parameter 3 : REG_DWORD
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : *****Web URL PING***** Ping URL Failed for #url#
    OS Type : 0
    ELSE


    Script Name: Web Ping WriteKey
    Script Description:

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\YourCompany\LastPingResult
    Parameter 2 : 1
    Parameter 3 : REG_SZ
    OS Type : 0
    ELSE







    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: far182
  • Sourceminer, mana? Wink

    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: far182
  • For some reason I cant add more mana to your user (must be a limitation) you will have to ask LarryNSTto give you the mana. I would and tried... sorry!

    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: sourceminer
  • I took care of it. Thanks.

    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: LarryNST
  • LarryNST wrote:
    I took care of it. Thanks.

    Thanks. How did it work for you?

    Legacy Forum Name: Monitor/Event Sets/SNMP Sets,
    Legacy Posted By Username: far182