W3cubDocs

/Ansible

logicmonitor_facts - Collect facts about LogicMonitor objects

New in version 2.2.

Synopsis

LogicMonitor is a hosted, full-stack, infrastructure monitoring platform. This module collects facts about hosts and host groups within your LogicMonitor account.

Requirements (on host that executes module)

  • An existing LogicMonitor account
  • Linux

Options

parameter required default choices comments
collector
no
The fully qualified domain name of a collector in your LogicMonitor account.
This is optional for querying a LogicMonitor host when a displayname is specified.
This is required for querying a LogicMonitor host when a displayname is not specified.
company
yes
The LogicMonitor account company name. If you would log in to your account at "superheroes.logicmonitor.com" you would use "superheroes".
displayname
no hostname -f
The display name of a host in your LogicMonitor account or the desired display name of a device to add into monitoring.
fullpath
no
The fullpath of the hostgroup object you would like to manage.
Recommend running on a single ansible host.
Required for management of LogicMonitor host groups (target=hostgroup).
hostname
no hostname -f
The hostname of a host in your LogicMonitor account, or the desired hostname of a device to add into monitoring.
Required for managing hosts (target=host).
password
yes
The password for the chosen LogicMonitor User.
If an md5 hash is used, the digest flag must be set to true.
target
yes
  • host
  • hostgroup
The LogicMonitor object you wish to manage.
user
yes
A LogicMonitor user name. The module will authenticate and perform actions on behalf of this user.

Examples

#example of querying a list of hosts
```
---
- hosts: hosts
  user: root
  vars:
    company: 'yourcompany'
    user: 'Luigi'
    password: 'ImaLuigi,number1!'
  tasks:
  - name: query a list of hosts
    # All tasks should use local_action
    local_action:
      logicmonitor_facts:
        target: host
        company: '{{ company }}'
        user: '{{ user }}'
        password: '{{ password }}'
```

#example of querying a hostgroup
```
---
- hosts: somemachine.superheroes.com
  user: root
  vars:
    company: 'yourcompany'
    user: 'mario'
    password: 'itsame.Mario!'
  tasks:
  - name: query a host group
    # All tasks should use local_action
    local_action:
      logicmonitor_facts:
        target: hostgroup
        fullpath: '/servers/production'
        company: '{{ company }}'
        user: '{{ user }}'
        password: '{{ password }}'
```

Return Values

Common return values are documented here Common Return Values, the following are the fields unique to this module:

name description returned type sample
ansible_facts LogicMonitor properties set for the specified object success list of dicts containing name/value pairs

Notes

Note

You must have an existing LogicMonitor account for this module to function.

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/logicmonitor_facts_module.html