Skip to content

Commit

Permalink
Enh: ability to delete a single downtime
Browse files Browse the repository at this point in the history
This patch bring the ability to delete a single downtime as opposed to
all the downtimes of an host or service in the current implementation,
and remains the default behavior.

This is done by simply providing the parameter `downtime_id` to the
`/downtime` endpoint when `action=delete`.

Also re-indented some code for better readability and removed Python 2.6
test from Travis configuration as this is no more available.
  • Loading branch information
geektophe committed May 11, 2021
1 parent a2b2315 commit 2aa421c
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 91 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
python:
- "2.7"
- "2.6"

install:
- "[ -d test ] && ./test/setup_module_test.sh || : "
Expand Down
43 changes: 23 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
.. _ws_daemon_module:

===================
Web Service Module
Web Service Module
===================


The ws-arbiter module is an Arbiter (or Receiver) module to treat requests from remote hosts via HTTP(s).
The ws-arbiter module is an Arbiter (or Receiver) module to treat requests from remote hosts via HTTP(s).


Configuring the Web Service Module
Configuring the Web Service Module
===================================

The module configuration is made in the ws-arbiter.cfg file, in the modules configuration directory. To enable this module, simply add the module to your Arbiter or Receiver daemon configuration.
Expand All @@ -20,7 +20,7 @@ If data is POSTed to this page, it will validate the data to determine if it is
This module listens by default on all IP interfaces, TCP port 7760 and it supports anonymous or authenticated access. This configuration may be changed in the ws-arbiter.cfg file.


Using the Web Service Module
Using the Web Service Module
=============================


Expand All @@ -36,7 +36,7 @@ The web service listens for POSTs to:

- /reload
Makes Shinken reload configuration (/etc/init.d/shinken reload)

Command:
::
curl -u user:password -d '' http://shinken-srv:7760/reload
Expand All @@ -49,15 +49,15 @@ The web service listens for POSTs to:
- action: (default = add)
add, to add an acknowledge for an host/service
delete, to remove current acknowledges on host/service

- host_name:
Host name

- service_description: (default = '' for host acknowledge only)
Service description

- time_stamp: (default = current time)

- sticky: (default = 1)

- notify: (default = 0)
Expand All @@ -68,7 +68,7 @@ The web service listens for POSTs to:

- comment: (default = 'No comment')


Command:
::
curl -u user:password -d "&host_name=host-ack&service_description=service-ack&author=Me&comment=Ack problem" http://shinken-srv:7760/acknowledge
Expand All @@ -81,19 +81,22 @@ The web service listens for POSTs to:
- action: (default = add)
add, to add an acknowledge for an host/service
delete, to remove current downtimes on host/service

- host_name:
Host name

- service_description: (default = '' for host acknowledge only)
Service description


- downtime_id: (default = '')
The downtime id to delete (all downtimes are deleted if missing)

- time_stamp: (default = current time)

- start_time: (default = current time)

- end_time: (default = current time)

- fixed: (default = 1)

- duration: (default = 86400 seconds)
Expand All @@ -104,7 +107,7 @@ The web service listens for POSTs to:

- comment: (default = 'No comment')


Command:
::
curl -u user:password -d "&host_name=host-ack&author=Me&comment=Downtime host" http://shinken-srv:7760/downtime
Expand All @@ -117,11 +120,11 @@ The web service listens for POSTs to:
curl -u user:password -d "time_stamp=$(date +%s)&host_name=host-checked&service_description=service-checked&return_code=0" --data-urlencode "output=Everything OK" http://shinken-srv:7760/push_check_result

Example with more readability:

::

curl
-u user:password
curl
-u user:password
-d "time_stamp=$(date +%s)
&host_name=host-checked
&service_description=service-checked
Expand Down
Loading

0 comments on commit 2aa421c

Please sign in to comment.