logicmonitor.integration.lm_website_check (2.0.3) — module

LogicMonitor Website Check Ansible module for managing website checks.

| "added in version" 1.2.0 of logicmonitor.integration"

Authors: Gunjan Kumar (@gunjan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install logicmonitor.integration:==2.0.3


Add to requirements.yml

  collections:
    - name: logicmonitor.integration
      version: 2.0.3

Description

LogicMonitor is a hosted, full-stack, infrastructure monitoring platform.

This module manages website checks within your LogicMonitor account (i.e. sdt a ping or web check).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example of putting a website check (ping or web check) in SDT
- name: SDT Website check
  hosts: localhost
  tasks:
    - name: Place LogicMonitor website check (ping or web check) into Scheduled downtime.
      logicmonitor:
        action: sdt
        company: batman
        access_id: "id123"
        access_key: "key123"
        website_check_id: 1
        start_time: "1/10/2022 15:00"
        duration: 60
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example of putting a website check (ping or web check) in SDT from different locations
- name: SDT Website check by locations
  hosts: localhost
  tasks:
    - name: Place LogicMonitor website check (ping or web check) into Scheduled downtime.
      logicmonitor:
        action: sdt
        company: batman
        access_id: "id123"
        access_key: "key123"
        website_check_id: 1
        start_time: "1/10/2022 15:00"
        duration: 60
        checkpoint_name: "{{item}}"
      loop:
        - Europe - Dublin
        - Asia - Singapore

Inputs

    
action:
    choices:
    - sdt
    description:
    - The action you wish to perform on the website check (ping or web check).
    - SDT = Schedule downtime for a website check in your LogicMonitor account.
    required: true
    type: str

comment:
    description:
    - The note/comment to add to an SDT action.
    - Optional for action=sdt.
    type: str

company:
    description:
    - The LogicMonitor account company name.
    - A user logging into their account at "batman.logicmonitor.com" would use "batman".
    required: true
    type: str

duration:
    default: 30
    description:
    - The duration (minutes) of the Scheduled Down Time (SDT).
    - Optional for action=sdt.
    type: int

end_time:
    description:
    - The time that the Scheduled Down Time (SDT) should end.
    - Format must be 'yyyy-MM-dd HH:mm' or "yyyy-MM-dd HH:mm z" where z is "am" or "pm".
      The former is used for a 24-hr clock while the latter is for a 12-hr clock.
    - If end time is provided it will be used otherwise duration would be used (duration
      defaults to 30 min).
    - Optional for action=sdt.
    type: str

access_id:
    description:
    - The Access ID API token associated with the user's account that's used to query
      the LogicMonitor API.
    - Please contact your LogicMonitor admin if you need new API tokens created for your
      account.
    required: true
    type: str

access_key:
    description:
    - The Access Key API token associated with the user's account that's used to query
      the LogicMonitor API.
    - Please contact your LogicMonitor admin if you need new API tokens created for your
      account.
    - Must start with the "!unsafe" keyword if the the key starts with a special character
      (e.g. '[', ']', etc.) to prevent playbook issues.
    required: true
    type: str

start_time:
    description:
    - The time that the Scheduled Down Time (SDT) should begin.
    - Format must be "yyyy-MM-dd HH:mm" or "yyyy-MM-dd HH:mm z" where z is "am" or "pm".
      The former is used for a 24-hr clock while the latter is for a 12-hr clock.
    - Optional for action=sdt.
    - Defaults to the time action is executed.
    - Required in case start time differ from the execution time of action.
    type: str

checkpoint_id:
    description:
    - ID of the checkpoint location you want to put in SDT.
    - Required for action=sdt if you want to apply SDT at specific location and checkpoint
      name isn't provided.
    - If no checkpoint (id or name) is provided it will put the whole website check in
      SDT.
    type: int

checkpoint_name:
    description:
    - Name of the checkpoint location you want to put in SDT.
    - Required for action=sdt if you want to apply SDT at specific location and checkpoint
      id isn't provided.
    - If no checkpoint (id or name) is provided it will put the whole website check in
      SDT.
    type: str

website_check_id:
    description:
    - ID of the website check (ping or web check) to target.
    - Required for action=sdt if website check name isn't provided.
    type: int

website_check_name:
    description:
    - Name of the website check (ping or web check) to target.
    - Required for action=sdt if website check id isn't provided.
    type: str

Outputs

action_performed:
  description: a string describing which action was performed
  returned: success
  sample: std
  type: str
addition_info:
  description: any additional detail related to the action
  returned: success
  sample: Website check SDT successful
  type: str
changed:
  description: a boolean indicating that changes were made to the target
  returned: changed
  sample: true
  type: bool
data:
  description: contain website check or sdt details
  returned: success
  sample:
    duration: 5
    end_time: 2022-09-20 16:55:07 IST
    start_time: 2022-09-20 16:50:07 IST
    std_id: D_17
    website_check_id: 4
    website_check_name: test
  type: dict
failed:
  description: a boolean indicating that execution failed
  returned: failed
  sample: false
  type: bool
success:
  description: flag indicating that execution was successful
  returned: success
  sample: true
  type: bool