logicmonitor: Documentation and logging updates based on feedback (#2756)
This commit is contained in:
parent
491b136f6e
commit
d8efe53d7c
2 changed files with 55 additions and 48 deletions
|
@ -73,7 +73,7 @@ description:
|
||||||
- LogicMonitor is a hosted, full-stack, infrastructure monitoring platform.
|
- LogicMonitor is a hosted, full-stack, infrastructure monitoring platform.
|
||||||
- This module manages hosts, host groups, and collectors within your LogicMonitor account.
|
- This module manages hosts, host groups, and collectors within your LogicMonitor account.
|
||||||
version_added: "2.2"
|
version_added: "2.2"
|
||||||
author: Ethan Culler-Mayeno, Jeff Wozniak
|
author: [Ethan Culler-Mayeno (@ethanculler), Jeff Wozniak (@woz5999)]
|
||||||
notes:
|
notes:
|
||||||
- You must have an existing LogicMonitor account for this module to function.
|
- You must have an existing LogicMonitor account for this module to function.
|
||||||
requirements: ["An existing LogicMonitor account", "Linux"]
|
requirements: ["An existing LogicMonitor account", "Linux"]
|
||||||
|
@ -81,32 +81,32 @@ options:
|
||||||
target:
|
target:
|
||||||
description:
|
description:
|
||||||
- The type of LogicMonitor object you wish to manage.
|
- The type of LogicMonitor object you wish to manage.
|
||||||
- "Collector: Perform actions on a LogicMonitor collector"
|
- "Collector: Perform actions on a LogicMonitor collector."
|
||||||
- NOTE You should use Ansible service modules such as 'service' or 'supervisorctl' for managing the Collector 'logicmonitor-agent' and 'logicmonitor-watchdog' services. Specifically, you'll probably want to start these services after a Collector add and stop these services before a Collector remove.
|
- NOTE You should use Ansible service modules such as M(service) or M(supervisorctl) for managing the Collector 'logicmonitor-agent' and 'logicmonitor-watchdog' services. Specifically, you'll probably want to start these services after a Collector add and stop these services before a Collector remove.
|
||||||
- "Host: Perform actions on a host device"
|
- "Host: Perform actions on a host device."
|
||||||
- "Hostgroup: Perform actions on a LogicMonitor host group"
|
- "Hostgroup: Perform actions on a LogicMonitor host group."
|
||||||
- NOTE Host and Hostgroup tasks should always be performed via local_action. There are no benefits to running these tasks on the remote host and doing so will typically cause problems.
|
- NOTE Host and Hostgroup tasks should always be performed via local_action. There are no benefits to running these tasks on the remote host and doing so will typically cause problems.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
choices: ['collector', 'host', 'datsource', 'hostgroup']
|
choices: ['collector', 'host', 'datsource', 'hostgroup']
|
||||||
action:
|
action:
|
||||||
description:
|
description:
|
||||||
- The action you wish to perform on target
|
- The action you wish to perform on target.
|
||||||
- "Add: Add an object to your LogicMonitor account"
|
- "Add: Add an object to your LogicMonitor account."
|
||||||
- "Remove: Remove an object from your LogicMonitor account"
|
- "Remove: Remove an object from your LogicMonitor account."
|
||||||
- "Update: Update properties, description, or groups (target=host) for an object in your LogicMonitor account"
|
- "Update: Update properties, description, or groups (target=host) for an object in your LogicMonitor account."
|
||||||
- "SDT: Schedule downtime for an object in your LogicMonitor account"
|
- "SDT: Schedule downtime for an object in your LogicMonitor account."
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
choices: ['add', 'remove', 'update', 'sdt']
|
choices: ['add', 'remove', 'update', 'sdt']
|
||||||
company:
|
company:
|
||||||
description:
|
description:
|
||||||
- The LogicMonitor account company name. If you would log in to your account at "superheroes.logicmonitor.com" you would use "superheroes"
|
- The LogicMonitor account company name. If you would log in to your account at "superheroes.logicmonitor.com" you would use "superheroes."
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- A LogicMonitor user name. The module will authenticate and perform actions on behalf of this user
|
- A LogicMonitor user name. The module will authenticate and perform actions on behalf of this user.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
password:
|
password:
|
||||||
|
@ -117,72 +117,72 @@ options:
|
||||||
collector:
|
collector:
|
||||||
description:
|
description:
|
||||||
- The fully qualified domain name of a collector in your LogicMonitor account.
|
- The fully qualified domain name of a collector in your LogicMonitor account.
|
||||||
- This is required for the creation of a LogicMonitor host (target=host action=add)
|
- This is required for the creation of a LogicMonitor host (target=host action=add).
|
||||||
- This is required for updating, removing or scheduling downtime for hosts if 'displayname' isn't specified (target=host action=update action=remove action=sdt)
|
- This is required for updating, removing or scheduling downtime for hosts if 'displayname' isn't specified (target=host action=update action=remove action=sdt).
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
hostname:
|
hostname:
|
||||||
description:
|
description:
|
||||||
- The hostname of a host in your LogicMonitor account, or the desired hostname of a device to manage.
|
- The hostname of a host in your LogicMonitor account, or the desired hostname of a device to manage.
|
||||||
- Optional for managing hosts (target=host)
|
- Optional for managing hosts (target=host).
|
||||||
required: false
|
required: false
|
||||||
default: 'hostname -f'
|
default: 'hostname -f'
|
||||||
displayname:
|
displayname:
|
||||||
description:
|
description:
|
||||||
- The display name of a host in your LogicMonitor account or the desired display name of a device to manage.
|
- The display name of a host in your LogicMonitor account or the desired display name of a device to manage.
|
||||||
- Optional for managing hosts (target=host)
|
- Optional for managing hosts (target=host).
|
||||||
required: false
|
required: false
|
||||||
default: 'hostname -f'
|
default: 'hostname -f'
|
||||||
description:
|
description:
|
||||||
description:
|
description:
|
||||||
- The long text description of the object in your LogicMonitor account
|
- The long text description of the object in your LogicMonitor account.
|
||||||
- Optional for managing hosts and host groups (target=host or target=hostgroup; action=add or action=update)
|
- Optional for managing hosts and host groups (target=host or target=hostgroup; action=add or action=update).
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
properties:
|
properties:
|
||||||
description:
|
description:
|
||||||
- A dictionary of properties to set on the LogicMonitor host or host group.
|
- A dictionary of properties to set on the LogicMonitor host or host group.
|
||||||
- Optional for managing hosts and host groups (target=host or target=hostgroup; action=add or action=update)
|
- Optional for managing hosts and host groups (target=host or target=hostgroup; action=add or action=update).
|
||||||
- This parameter will add or update existing properties in your LogicMonitor account or
|
- This parameter will add or update existing properties in your LogicMonitor account.
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
default: {}
|
||||||
groups:
|
groups:
|
||||||
description:
|
description:
|
||||||
- A list of groups that the host should be a member of.
|
- A list of groups that the host should be a member of.
|
||||||
- Optional for managing hosts (target=host; action=add or action=update)
|
- Optional for managing hosts (target=host; action=add or action=update).
|
||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
id:
|
id:
|
||||||
description:
|
description:
|
||||||
- ID of the datasource to target
|
- ID of the datasource to target.
|
||||||
- Required for management of LogicMonitor datasources (target=datasource)
|
- Required for management of LogicMonitor datasources (target=datasource).
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
fullpath:
|
fullpath:
|
||||||
description:
|
description:
|
||||||
- The fullpath of the host group object you would like to manage
|
- The fullpath of the host group object you would like to manage.
|
||||||
- Recommend running on a single Ansible host
|
- Recommend running on a single Ansible host.
|
||||||
- Required for management of LogicMonitor host groups (target=hostgroup)
|
- Required for management of LogicMonitor host groups (target=hostgroup).
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
alertenable:
|
alertenable:
|
||||||
description:
|
description:
|
||||||
- A boolean flag to turn alerting on or off for an object
|
- A boolean flag to turn alerting on or off for an object.
|
||||||
- Optional for managing all hosts (action=add or action=update)
|
- Optional for managing all hosts (action=add or action=update).
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: true
|
||||||
choices: [true, false]
|
choices: [true, false]
|
||||||
starttime:
|
starttime:
|
||||||
description:
|
description:
|
||||||
- The time that the Scheduled Down Time (SDT) should begin
|
- The time that the Scheduled Down Time (SDT) should begin.
|
||||||
- Optional for managing SDT (action=sdt)
|
- Optional for managing SDT (action=sdt).
|
||||||
- Y-m-d H:M
|
- Y-m-d H:M
|
||||||
required: false
|
required: false
|
||||||
default: Now
|
default: Now
|
||||||
duration:
|
duration:
|
||||||
description:
|
description:
|
||||||
- The duration (minutes) of the Scheduled Down Time (SDT)
|
- The duration (minutes) of the Scheduled Down Time (SDT).
|
||||||
- Optional for putting an object into SDT (action=sdt)
|
- Optional for putting an object into SDT (action=sdt).
|
||||||
required: false
|
required: false
|
||||||
default: 30
|
default: 30
|
||||||
...
|
...
|
||||||
|
@ -586,7 +586,10 @@ class LogicMonitor(object):
|
||||||
else:
|
else:
|
||||||
return raw
|
return raw
|
||||||
except IOError:
|
except IOError:
|
||||||
self.fail(msg="Error: Unknown exception making RPC call")
|
ioe = get_exception()
|
||||||
|
self.fail(msg="Error: Exception making RPC call to " +
|
||||||
|
"https://" + self.company + "." + self.lm_url +
|
||||||
|
"/rpc/" + action + "\nException" + str(ioe))
|
||||||
|
|
||||||
def do(self, action, params):
|
def do(self, action, params):
|
||||||
"""Make a call to the LogicMonitor
|
"""Make a call to the LogicMonitor
|
||||||
|
@ -612,8 +615,10 @@ class LogicMonitor(object):
|
||||||
"/do/" + action + "?" + param_str)
|
"/do/" + action + "?" + param_str)
|
||||||
return f.read()
|
return f.read()
|
||||||
except IOError:
|
except IOError:
|
||||||
# self.module.debug("Error opening URL. " + ioe)
|
ioe = get_exception()
|
||||||
self.fail("Unknown exception opening URL")
|
self.fail(msg="Error: Exception making RPC call to " +
|
||||||
|
"https://" + self.company + "." + self.lm_url +
|
||||||
|
"/do/" + action + "\nException" + str(ioe))
|
||||||
|
|
||||||
def get_collectors(self):
|
def get_collectors(self):
|
||||||
"""Returns a JSON object containing a list of
|
"""Returns a JSON object containing a list of
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
import sys
|
|
||||||
import types
|
import types
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@ description:
|
||||||
- LogicMonitor is a hosted, full-stack, infrastructure monitoring platform.
|
- LogicMonitor is a hosted, full-stack, infrastructure monitoring platform.
|
||||||
- This module collects facts about hosts abd host groups within your LogicMonitor account.
|
- This module collects facts about hosts abd host groups within your LogicMonitor account.
|
||||||
version_added: "2.2"
|
version_added: "2.2"
|
||||||
author: Ethan Culler-Mayeno, Jeff Wozniak
|
author: [Ethan Culler-Mayeno (@ethanculler), Jeff Wozniak (@woz5999)]
|
||||||
notes:
|
notes:
|
||||||
- You must have an existing LogicMonitor account for this module to function.
|
- You must have an existing LogicMonitor account for this module to function.
|
||||||
requirements: ["An existing LogicMonitor account", "Linux"]
|
requirements: ["An existing LogicMonitor account", "Linux"]
|
||||||
|
@ -74,31 +73,31 @@ options:
|
||||||
choices: ['host', 'hostgroup']
|
choices: ['host', 'hostgroup']
|
||||||
company:
|
company:
|
||||||
description:
|
description:
|
||||||
- The LogicMonitor account company name. If you would log in to your account at "superheroes.logicmonitor.com" you would use "superheroes"
|
- The LogicMonitor account company name. If you would log in to your account at "superheroes.logicmonitor.com" you would use "superheroes".
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
user:
|
user:
|
||||||
description:
|
description:
|
||||||
- A LogicMonitor user name. The module will authenticate and perform actions on behalf of this user
|
- A LogicMonitor user name. The module will authenticate and perform actions on behalf of this user.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- The password for the chosen LogicMonitor User
|
- The password for the chosen LogicMonitor User.
|
||||||
- If an md5 hash is used, the digest flag must be set to true
|
- If an md5 hash is used, the digest flag must be set to true.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
collector:
|
collector:
|
||||||
description:
|
description:
|
||||||
- The fully qualified domain name of a collector in your LogicMonitor account.
|
- 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 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
|
- This is required for querying a LogicMonitor host when a displayname is not specified.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
hostname:
|
hostname:
|
||||||
description:
|
description:
|
||||||
- The hostname of a host in your LogicMonitor account, or the desired hostname of a device to add into monitoring.
|
- 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)
|
- Required for managing hosts (target=host).
|
||||||
required: false
|
required: false
|
||||||
default: 'hostname -f'
|
default: 'hostname -f'
|
||||||
displayname:
|
displayname:
|
||||||
|
@ -108,9 +107,9 @@ options:
|
||||||
default: 'hostname -f'
|
default: 'hostname -f'
|
||||||
fullpath:
|
fullpath:
|
||||||
description:
|
description:
|
||||||
- The fullpath of the hostgroup object you would like to manage
|
- The fullpath of the hostgroup object you would like to manage.
|
||||||
- Recommend running on a single ansible host
|
- Recommend running on a single ansible host.
|
||||||
- Required for management of LogicMonitor host groups (target=hostgroup)
|
- Required for management of LogicMonitor host groups (target=hostgroup).
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
...
|
...
|
||||||
|
@ -236,7 +235,10 @@ class LogicMonitor(object):
|
||||||
else:
|
else:
|
||||||
return raw
|
return raw
|
||||||
except IOError:
|
except IOError:
|
||||||
self.fail(msg="Error: Unknown exception making RPC call")
|
ioe = get_exception()
|
||||||
|
self.fail(msg="Error: Exception making RPC call to " +
|
||||||
|
"https://" + self.company + "." + self.lm_url +
|
||||||
|
"/rpc/" + action + "\nException" + str(ioe))
|
||||||
|
|
||||||
def get_collectors(self):
|
def get_collectors(self):
|
||||||
"""Returns a JSON object containing a list of
|
"""Returns a JSON object containing a list of
|
||||||
|
|
Loading…
Reference in a new issue