Skip to content
Yoann Gini edited this page Jul 15, 2015 · 11 revisions

Introduction

This function is used to check the content of a HTTP(S) web page. The aim of this function is to know if you can contact a server or not.

For example, you can add two instance of this function, one for checking access to Internet server and an other for Intranet servers.

Main implementation

The main implementation of this function is made in the TestHTTP plugin in the main project.

Settings

The settings must be organized in a dictionary who must contain keys:

  • "title" a string used to define the text displayed by the item in the menu ;
  • "URL" a string to define the URL to test ;
  • "mode" a string to specify with comparaison algorithm you want to use, it can be:
  • "md5" to make a md5 sum and compare it to a original value (created via curl http://www.example.com | md5) ;
  • "compare", in this case the content must be the same as the original one ;
  • "contain" to look for a strings inside the HTML body ;
  • "originalString" a string to use as original value with one of this previous mode ;
  • "repeat" an integer representing the number of seconds between each tries, 0 mean no repeat mode, the default is 0 ;
  • "timeout" an integer representing the time in seconds before considering the service is unresponsive ;
  • "title" a string to use as a label for the menu item.

Notes

The item will be red when no connectivity at all, orange for connectivity but wrong result, or green when everything is OK.

The item won't display anything status before the end of the first try.