Server Monitoring Methods

Server Monitoring API.

server.monitoring.get_policy()

Retrieve the current policy for monitoring of named server.

Parameters:name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
Returns:A dictionary of flags corresponding to those set by server.monitoring.set_policy().
server.monitoring.rule_create()

Create a monitoring rule for name.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • service (String) –

    The monitoring service. Acceptable values

    ‘http’
    HTTP / Apache
    ‘http_string’
    HTTP string
    ‘ssh’
    SSH access
    ‘mysql’
    MySQL (external connectivity)
    ‘mysql_slave’
    MySQL (slave)
    ‘smtp’
    SMTP (email)
    ‘pop3’
    POP3 (email)
    ‘imap’
    IMAP (email)
    ‘tcp’
    Other TCP port
    ‘disk’
    Disk space
    ‘load’
    Server load
    ‘ping’
    Ping
    ‘ssl_cert’
    SSL certificate validity
  • alert_type (String) –

    The alert type. Note: memset-warning, memset-alert only permitted for Server Monitoring Advanced Memset-monitored customers. Acceptable values

    ‘email’
    Email to:
    ‘sms’
    SMS to:
    ‘memset-warning’
    Warn Memset
    ‘memset-alert’
    Memset Alert 24x7
  • contact_address (String, Optional) – The email address or telephone number to which alerts should be sent. Required for non Memset-monitored alert types.
  • port (Integer, Optional) – The port number to monitor. Required only for service ‘tcp’ or ‘http_string’.
  • host_name (String, Optional) – The host name or URL to check. Required only for service ‘http_string’.
  • http_check_string (String, Optional) – The string to check for at host_name. Required only for service ‘http_string’.
Returns:

a dictionary with the new rule information in as described in server.monitoring.rule_info()

Raises :

ApiErrorBadParameters if the correct combination of parameters have not been provided.

Raises :

ApiErrorPreconditionFailed when attempting to set up alerts not within the server’s Monitoring support level, or rule quota reached.

server.monitoring.rule_delete()

Delete the monitoring rule with rule_id for name

Raises :

ApiErrorBadParameters if the rule_id is not valid.

Raises :

ApiErrorDoesNotExist if the rule_id does not exist for this account.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • rule_id (String) – The id of the monitoring rule
server.monitoring.rule_info()

Info about a monitoring rule

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • rule_id (String) – The id of the monitoring rule
Returns:

a dictionary with the following keys

rule_id

String: The unique identifier for this rule.

service

String: The monitoring service for this rule.

alert_type

String: The alert type configured for this rule.

contact_address
String: The email address or telephone number to which alerts for this monitoring rule are sent. It will be empty if

the alert_type is a Memset-managed alert type.

port

Integer: It will be empty for a standard service e.g. ‘http’.

host_name

String: The host name or URL being checked. It will be empty if the service is not ‘http_string’.

http_check_string

String: The string being checked. It will be empty if the service is not ‘http_string’.

Raises :

ApiErrorDoesNotExist if the rule_id does not exist for this account.

server.monitoring.rule_list()

Provides information on Server Monitoring rules for name

Parameters:name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
Returns:list of dictionaries as described in server.monitoring.rule_info().
server.monitoring.rule_update()

Update the monitoring rule with rule_id for name

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • rule_id (String) – The id of the monitoring rule
  • service (String, Optional) –

    The monitoring service. Acceptable values

    ‘http’
    HTTP / Apache
    ‘http_string’
    HTTP string
    ‘ssh’
    SSH access
    ‘mysql’
    MySQL (external connectivity)
    ‘mysql_slave’
    MySQL (slave)
    ‘smtp’
    SMTP (email)
    ‘pop3’
    POP3 (email)
    ‘imap’
    IMAP (email)
    ‘tcp’
    Other TCP port
    ‘disk’
    Disk space
    ‘load’
    Server load
    ‘ping’
    Ping
    ‘ssl_cert’
    SSL certificate validity
  • alert_type (String, Optional) –

    The alert type. Note: memset-warning, memset-alert only permitted for Server Monitoring Advanced Memset-monitored customers. Acceptable values

    ‘email’
    Email to:
    ‘sms’
    SMS to:
    ‘memset-warning’
    Warn Memset
    ‘memset-alert’
    Memset Alert 24x7
  • contact_address (String, Optional) – The email address or telephone number to which alerts should be sent. Required for non Memset-monitored alert types.
  • port (Integer, Optional) – The port number to monitor. Required only for service ‘tcp’.
  • host_name (String, Optional) – The host name or URL to check. Required only for service ‘http_string’.
  • http_check_string (String, Optional) – The string to check for at host_name. Required only for service ‘http_string’.
Returns:

a dictionary with the rule information in as described in server.monitoring.rule_info()

Raises :

ApiErrorBadParameters if the rule_id is invalid or the updated rule is invalid.

server.monitoring.set_policy()

Set the monitoring policy for the named server.

Parameters:
  • name (String) – Name of the service. Service names are 1-64 characters A-Z, a-z, 0-9, -, . and _. Ensure this value has at most 64 characters.
  • monitoring (Boolean) – Whether or not monitoring is enabled for the named server.
  • auto_reboot (Boolean, Optional) –

    Whether or not to automatically reboot the named server if monitoring determines that it has becomes unresponsive. This defaults to true when monitoring is enabled.

    Note

    This flag can only be set when when monitoring is enabled, trying to set it to true when this is not the case will result in an API error.

  • reminder_emails (Boolean, Optional) –

    Whether or not to send a reminder at regular intervals about monitoring being disabled. The reminder is sent to the email address associated with your account. This defaults to true when monitoring is disabled.

    Note

    This flag can only be set when when monitoring is disabled, trying to set it to true when this is not the case will result in an API error.

Returns:

A dictionary as described in job.status().

Raises :

Will raise ApiErrorBadParameters for incompatible combinations of flags.

Raises :

Will raise ApiErrorAlreadyInProgress if a policy change is already in progress.

Previous topic

Server Methods

Next topic

Server Status Methods

This Page