monitor.add

Adds a new monitor to the system.

Authentication & Action

This method needs authentication. It can be accessed by http and https.

Action type: HTTP POST.

Arguments

name (required)

The name of the monitor. Allowed value: string(64)

protocol (required)

The protocol of the monitor. Allowed values: http / https / ping / ftp

url (required)

The url of the monitor. Allowed value: string(2048)

group_id (not required)

The id of the group this monitor should be added to. Id should be an integer of an existing group.

group_name (not required, see note)

The name of an existing group this monitor should be added to. name should be an integer with max 64 chars.

status (not required)

The status of the monitor. Allowed values: 1 = enabled / 0 = disabled. Default: 1

port (not required)

The port number of the check. Allowed value: integer

login (not required)

The username needed to access the resource (http authentication). Allowed value: string(32)

password (not required)

The password belonging to above username. Allowed value: string(32)

match (not required)

Webcron will check if this string is found (or not found, depending on the value of "contain") in the server response. Allowed value: string(255)

contain (not required)

Determines if above "match" value should occur or not in server response. Allowed value: 1 = should occur / 0 = should not occur. Default = 1

do_hash (not required)

Checks if a resource has changed, by comparing the MD5 hash. Allowed value: 1 = check hash / 0 = don't check. Default: 0

frequence (not required)

The frequence between two checks, in minutes. Allowed values: 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 15 / 20 / 25 / 30 / 35 / 40 / 45 / 50 / 55 / 60 Default: 1

post (not required)

Any data that should be posted (by way of an HTTP POST). The format should be: pie=apple&drink=coffee&desert=none

stations (not required)

Comma separated list of monitor station id's that will monitor. Allowed values: integer and existing id's. Default: all stations

add_stations (not required)

Add new (future) stations automatically to the list of stations. Allowed values: 1 = yes / 0 = no. Default: 1

header(not required)

Header to be included in request. For multiple headers, use header[]=Cookie:myCookieThing&header[]=Accept:text/plain

 

NOTE: It is possible to use both group_id and group_name to identify the group this monitor belongs to. If both are present, the group_name is ignored

Example Request

http://api.webcron.org/monitor.add
POST data:
name=1stMonitor&url=www.myserver.com/searchresult.php&protocol=https&match=welcome&
contain=1&frequence=2

Example Response

<rsp status="ok">
   <monitor id="74978" />
</rsp>