logicmonitor.integration.lm_info (2.0.3) — module

Gather information about LogicMonitor objects (e.g. collectors, collector groups, devices, device groups, etc.).

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

Authors: Carlos Alvarenga (@cealvar)

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 collects information about devices, collectors, devices and device groups associated with your LogicMonitor account.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get all collectors
- name: Get collectors
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: collector
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get collector
- name: Get collector
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: collector
        company: batman
        access_id: "id123"
        access_key: "key123"
        description: "localhost"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get all collector groups
- name: Get collector groups
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: collector_group
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get collector group
- name: Get collector group
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: collector_group
        company: batman
        access_id: "id123"
        access_key: "key123"
        name: "collector group"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get all devices
- name: Get devices
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: device
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get device
- name: Get device
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: device
        company: batman
        access_id: "id123"
        access_key: "key123"
        hostname: 127.0.0.1
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get all device groups
- name: Get device groups
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: device_group
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get device group
- name: Get device group
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: device_group
        company: batman
        access_id: "id123"
        access_key: "key123"
        full_path: "Devices by Type/Collectors"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get alert rules
- name: Get alert rules
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: alert_rule
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get alert rule
- name: Get alert rule
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: alert_rule
        company: batman
        access_id: "id123"
        access_key: "key123"
        id: 16
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get escalation chains
- name: Get escalation chains
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: escalation_chain
        company: batman
        access_id: "id123"
        access_key: "key123"
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Get escalation chain
- name: escalation chain
  hosts: localhost
  tasks:
    - name: Running module
      lm_info:
        target: escalation_chain
        company: batman
        access_id: "id123"
        access_key: "key123"
        id: 16
      register: output
    - name: Output
      debug:
        msg: '{{ output }}'

Inputs

    
id:
    description:
    - ID of the collector, device, device group, escalation chain, etc to target.
    type: int

name:
    description:
    - Name of the collector group, alert rule, escalation chain, etc to target.
    type: str

size:
    default: 250
    description:
    - The number of resources/results to display (max is 1000).
    type: int

target:
    choices:
    - collector
    - collector_group
    - device
    - device_group
    - alert_rule
    - escalation_chain
    description:
    - The type of LogicMonitor object you wish to query.
    required: true
    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

hostname:
    description:
    - Name (hostname) of the device to target.
    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

full_path:
    description:
    - Full path of the device group to target.
    - Root group full_path should be denoted by empty string "" or "/".
    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

description:
    description:
    - Description of the collector to target.
    type: str

display_name:
    description:
    - Display name of the device to target.
    type: str

Outputs

data:
  description: The dictionary containing information about all collectors associated
    with your account
  returned: always
  sample:
    isMin: false
    items:
    - {}
    searchId: null
    total: 1
  type: dict