How to create devices and tasks

An HTTP/S monitoring checks a single URL for availability, performance, proper content and errors. It supports POST and GET requests, cookies, form submissions, custom headers, password-secured sites (basic HTTP/S authorization as well as cookie/script authorization mechanisms), and timeout thresholds.

HTTP/S monitoring validates security certificates, check certificate authority, and check for expiration. It can also be configured to send you reminders when the certificate expiration date is approaching.

You can convert request parameters values to Context Variables to pass in values, for example, retrieved from a response of another task. 

Creating an HTTP/S task

Once you have created a device and are adding or editing an HTTP/S task, you will be prompted to adjust the following settings.

URL

Enter the URL of the page you wish to perform the task on. It should be formatted as such: www.example.com.

You can turn on a visually friendly input mode by clicking the Detailed switcher on the top of the section.

SSL/Certificate Check for HTTPS task

Secure Socket Layer SSL Certificate Monitoring is a standard aspect of HTTPS monitoring.

For an HTTPS task, the following additional options are available:

  • Authority: verifies whether a certificate chain contains a root certificate that is trusted, or not trusted.
  • Common Name (CN): validates that an address you navigate to matches the address certificate the address was signed to.
  • Date: verifies the certificate expiration date.
  • Revocation: validates that the certificate’s chain of trust doesn’t contain a revoked certificate.
  • Usage: verifies a certificate chain for the improper use of an intermediate certificate.
  • Expiration Reminder in Days: a reminder that notifies (as an error) about certificate expiration.
  • Client Certificate: client certificate name.

See also: Target Hostname or IP Address.

Completion Timeout (in seconds)

Enter the number of seconds the task should wait for a response from the web page before ending the task and returning an error. If this is left blank the default timeout for a task is 120 seconds.

Request Type

You can send a GET or a POST request to the web page. Selecting a GET request will simply retrieve data from the web server.  Selecting a POST request indicates that you are including a set of data for the server to act upon.  Note:  if you set the request type to POST but do not specify a POST parameter in the additional parameters section below, the POST value will default back to get upon saving the task.

Content validation

Content Validation Keywords are used to ensure that the expected content was loaded onto a web page.

In the Keyword fields, you can specify one or more words or phrases that you wish to search for in the web page content.  If the expected keywords are not found, the task will return an error.

You can enter multiple strings into the keyword fields.  The values you enter can be separated by logical expressions as follows:
{[(“keyword1″&”keyword2″)|!”keyword3″]}
]} – keyword expression end;
where
{[ – keyword expression start;
() – grouping brackets;
& – logical AND;
| – logical OR;
! – logical NOT;
“string” – a keyword;

A successful keyword expression must include the start and end brackets as follows:

{[“keyword”]}

Basic Authentication

Basic authentication is used to allow users to access content on some websites.

Username: contains a username for HTTP/S basic or digest access authentication.

User Password: contains a password for HTTP/S basic or digest access authentication.

Read the article on Authentication username and password for more information.

Headers

The option allows to add any additional custom headers in the following format (by “=” symbol, each header should start from a new line):

Header_name_1 = "value"
Header_name_2 = "value"

Header Name: specify the name of the parameter as it will appear in the request.

Value: enter the value associated with the name of the parameter.

User-Agent header used by the Dotcom-Monitor HTTP task: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 1.0.3705).

However, the IE6 user string can be replaced with any other string. To do this, add a custom header with the name “user-agent” and the specific value needed.

Post Data options for Post requests

If Post request type was selected you can specify the following Post parameters:

  • Name: the name of the parameter as it will appear in the request.
  • Value: the value associated with the name of the parameter.

Read the article on Authentication username and password for more information.

DNS Options

The DNS Options feature allows users to choose how domain name server (DNS) requests are conducted during a monitoring task.

To specify the mode of resolving hostnames, in the DNS Resolve Mode section, select one of the available modes. For more details on the feature configuration, see DNS Mode Options.

The Custom DNS Hosts section contains the mappings of IP addresses to hostnames.

To specify the mapping, enter the IP address and the host name in the corresponding fields.

Examples:

192.168.107.246   example.com user.example.com userauth.example.com tools.example.com
192.168.107.246   example.com
192.168.107.246   user.example.com
192.168.107.246   userauth.example.com

See also: DNS Mode Options.

Prepare Script

The field can contain C# code, which can be used for specific POST, GET and URL data. For example, it could be a random-number generator, or for pulling atypical parameters. It can be used, for example, to generate a dynamic URL depending on previous requests (for example, if it gives less than 1000 links – open URL “A” if more than 1000 links then open URL “B”) Please contact technical support for more details on usage.

Using Context Variables

Use the following syntax to specify a Context Variables: 

context.<variable name>

Context Variables names must be identical to names of respective web elements you want to specify. The variable name is case sensitive. 

To specify a variable name in the request, Inspect the respective element code and copy the “name” attribute value. 

Let’s say, we want to monitor submitting a website registration form with unique field values. First, we need to create an HTTP task with the corresponding Post request. Then we need to add parameters for the form fields in the request body (Post Data) and convert their value to context variables. 

To add a new parameter:

  1. Select Post in the Request Type field.
  2. Expand the Post Data field and click the Detailed toggle, then click Add Parameter.
  3. In the Parameter name field, type in the form’s field name how it appears in the respective element code.
  4. To convert the parameter value to context one, point to the Value field and click the gear icon. 
  5. In the Edit Value window, select Dynamic and specify the parameter value using the following syntax: context.<variable name>. Click Done.
  6. To specify a default dynamic value for a context parameter, click the actions menu button   on the Task Configuration sidebar and click Manage Context Parameters. Click Done to finish.

On the picture below Name and Pwd parameters are now going to take the value out of the Context Variables named “login” and “password” respectively.