mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #1189 from jpmens/nagpause
standardize DOCUMENTATION for nagios, pause
This commit is contained in:
commit
6616fba1ab
2 changed files with 29 additions and 85 deletions
|
@ -14,40 +14,17 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
|
||||||
Action Summaries (all must be delegate_to'd a nagios server):
|
|
||||||
|
|
||||||
* Set 30 minutes of downtime for a single service:
|
|
||||||
action: nagios action=downtime minutes=30 service=httpd host=$inventory_hostname
|
|
||||||
|
|
||||||
* Set 30 minutes of downtime for a few services:
|
|
||||||
action: nagios action=downtime minutes=30 services=httpd,git,nfs host=$inventory_hostname
|
|
||||||
|
|
||||||
* (Un)Silence all alerts from a host/service:
|
|
||||||
action: nagios action=silence host=$inventory_hostname
|
|
||||||
action: nagios action=unsilence host=$inventory_hostname
|
|
||||||
|
|
||||||
* Enable/Disable alerts for a host or service(s):
|
|
||||||
action: nagios action=enable_alerts service=host host=$inventory_hostname
|
|
||||||
action: nagios action=disable_alerts services=httpd,git,nfs host=$inventory_hostname
|
|
||||||
|
|
||||||
Note: 'service' is an alias for 'services'. Separate multiple services
|
|
||||||
with commas.
|
|
||||||
|
|
||||||
Set the path to the command file explicitly with the 'cmdfile'
|
|
||||||
parameter.
|
|
||||||
"""
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: nagios
|
module: nagios
|
||||||
short_description: Perform common tasks in Nagios related to downtime and notifications.
|
short_description: Perform common tasks in Nagios related to downtime and notifications.
|
||||||
description:
|
description:
|
||||||
- "The Nagios module has two basic functions: scheduling downtime and toggling alerts for services or hosts."
|
- "The M(nagios) module has two basic functions: scheduling downtime and toggling alerts for services or hosts."
|
||||||
- All actions require the C(host) parameter to be given explicitly. In playbooks you can use the C($inventory_hostname) variable to refer to the host the playbook is currently running on.
|
- All actions require the C(host) parameter to be given explicitly. In playbooks you can use the C($inventory_hostname) variable to refer to the host the playbook is currently running on.
|
||||||
- You can specify multiple services at once by separating them with commas, .e.g., C(services=httpd,nfs,puppet).
|
- You can specify multiple services at once by separating them with commas, .e.g., C(services=httpd,nfs,puppet).
|
||||||
- When specifying what service to handle there is a special service value, B(host), which will handle alerts/downtime for the B(host itself), e.g., C(service=host). This keyword may not be given with other services at the same time. I(Setting alerts/downtime for a host does not affect alerts/downtime for any of the services running on it.)
|
- When specifying what service to handle there is a special service value, I(host), which will handle alerts/downtime for the I(host itself), e.g., C(service=host). This keyword may not be given with other services at the same time. I(Setting alerts/downtime for a host does not affect alerts/downtime for any of the services running on it.)
|
||||||
- When using the B(nagios) module you will need to specify your nagios server using the C(delegate_to) parameter.
|
- When using the M(nagios) module you will need to specify your nagios server using the C(delegate_to) parameter.
|
||||||
version_added: 0.7
|
version_added: 0.7
|
||||||
options:
|
options:
|
||||||
action:
|
action:
|
||||||
|
@ -84,53 +61,30 @@ options:
|
||||||
- What to manage downtime/alerts for. Separate multiple services with commas.
|
- What to manage downtime/alerts for. Separate multiple services with commas.
|
||||||
- C(service) is an alias for C(services).
|
- C(service) is an alias for C(services).
|
||||||
- B(Required) option when using the C(downtime), C(enable_alerts), and C(disable_alerts) actions.
|
- B(Required) option when using the C(downtime), C(enable_alerts), and C(disable_alerts) actions.
|
||||||
|
aliases: [ "service" ]
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default: null
|
||||||
author: Tim Bielawa
|
author: Tim Bielawa
|
||||||
|
requirements: [ "Nagios" ]
|
||||||
|
examples:
|
||||||
|
- description: set 30 minutes of apache downtime
|
||||||
|
code: nagios action=downtime minutes=30 service=httpd host=$inventory_hostname
|
||||||
|
- description: schedule an hour of HOST downtime
|
||||||
|
code: nagios action=downtime minutes=60 service=host host=$inventory_hostname
|
||||||
|
- description: schedule downtime for a few services
|
||||||
|
code: nagios action=downtime services=frob,foobar,qeuz host=$inventory_hostname
|
||||||
|
- description: enable SMART disk alerts
|
||||||
|
code: nagios action=enable_alerts service=smart host=$inventory_hostname
|
||||||
|
- description: "two services at once: disable httpd and nfs alerts"
|
||||||
|
code: nagios action=disable_alerts service=httpd,nfs host=$inventory_hostname
|
||||||
|
- description: disable HOST alerts
|
||||||
|
code: nagios action=disable_alerts service=host host=$inventory_hostname
|
||||||
|
- description: silence ALL alerts
|
||||||
|
code: nagios action=silence host=$inventory_hostname
|
||||||
|
- description: unsilence all alerts
|
||||||
|
code: nagios action=unsilence host=$inventory_hostname
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = [
|
|
||||||
"""
|
|
||||||
- description: set 30 minutes of apache downtime
|
|
||||||
code: nagios action=downtime minutes=30 service=httpd host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: schedule an hour of HOST downtime
|
|
||||||
code: nagios action=downtime minutes=60 service=host host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: schedule downtime for a few services
|
|
||||||
code: nagios action=downtime services=frob,foobar,qeuz host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: enable SMART disk alerts
|
|
||||||
code: nagios action=enable_alerts service=smart host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: two services at once: disable httpd and nfs alerts
|
|
||||||
code: nagios action=disable_alerts service=httpd,nfs host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: disable HOST alerts
|
|
||||||
code: nagios action=disable_alerts service=host host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: silence ALL alerts
|
|
||||||
code: nagios action=silence host=$inventory_hostname
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: unsilence all alerts
|
|
||||||
code: nagios action=unsilence host=$inventory_hostname
|
|
||||||
"""
|
|
||||||
]
|
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import types
|
import types
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -26,21 +26,11 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
author: Tim Bielawa
|
author: Tim Bielawa
|
||||||
|
examples:
|
||||||
|
- description: Pause for 5 minutes to build app cache.
|
||||||
|
code: pause minutes=5
|
||||||
|
- description: Pause until you can verify updates to an application were successful.
|
||||||
|
code: pause
|
||||||
|
- description: A helpful reminder of what to look out for post-update.
|
||||||
|
code: pause prompt=Make sure org.foo.FooOverload exception is not present
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = [
|
|
||||||
"""
|
|
||||||
- description: Pause for 5 minutes to build app cache.
|
|
||||||
action: pause minutes=5
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: Pause until you can verify updates to an application were successful.
|
|
||||||
action: pause
|
|
||||||
""",
|
|
||||||
|
|
||||||
"""
|
|
||||||
- description: A helpful reminder of what to look out for post-update.
|
|
||||||
action: pause prompt=Make sure org.foo.FooOverload exception is not present
|
|
||||||
"""
|
|
||||||
]
|
|
||||||
|
|
Loading…
Reference in a new issue