Module: check_mk
Branch: master
Commit: e3a559b747860bd33efbc8288115c9f0aef66f9c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3a559b747860b…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Feb 2 12:51:26 2017 +0100
4018 WATO WebAPI: new functions to manage host, service and contactgroups
A few new functions to manage host, service and contact groups have been introduced.
First of all you can get all groups of a specific type with the url parameter
action=get_all_{groupname}
<tt>
Example calls:
curl
http://localhost/heute/check_mk/webapi.py?action=get_all_hostgroups&_us…
curl
http://localhost/heute/check_mk/webapi.py?action=get_all_servicegroups&…
curl
http://localhost/heute/check_mk/webapi.py?action=get_all_contactgroups&…
</tt>
Furthermore you can add, edit and delete these groups
<tt>
# All group types can be managed with similar requests
# Add
curl
"http://localhost/heute/check_mk/webapi.py?action=add_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1", "alias":
"the hg alias"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=add_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1", "alias":
"the sg alias"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1", "alias":
"the cg alias"}'
# Edit group
curl
"http://localhost/heute/check_mk/webapi.py?action=edit_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1", "alias":
"the hg alias"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=edit_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1", "alias":
"the sg alias"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=edit_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1", "alias":
"the cg alias"}'
# Delete group
curl
"http://localhost/heute/check_mk/webapi.py?action=delete_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=delete_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1"}'
curl
"http://localhost/heute/check_mk/webapi.py?action=delete_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1"}'
# For contact groups you may also specify a list of nagvis maps in the extra attribute
nagivs_maps
curl
"http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "newgroup2", "alias":
"the alias", "nagvis_maps": ["dfdf"]}'
</tt>
Change-Id: Iac0ef79fc5736f115d30bc4b3206c95f896465da
---
.werks/4018 | 43 +++++++++++++++++++++++++++++++++++++++++++
ChangeLog | 2 ++
2 files changed, 45 insertions(+)
diff --git a/.werks/4018 b/.werks/4018
new file mode 100644
index 0000000..d323883
--- /dev/null
+++ b/.werks/4018
@@ -0,0 +1,43 @@
+Title: WATO WebAPI: new functions to manage host, service and contactgroups
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486032438
+Class: feature
+
+
+A few new functions to manage host, service and contact groups have been introduced.
+
+First of all you can get all groups of a specific type with the url parameter
action=get_all_{groupname}
+<tt>
+Example calls:
+curl
http://localhost/heute/check_mk/webapi.py?action=get_all_hostgroups&_us…
+curl
http://localhost/heute/check_mk/webapi.py?action=get_all_servicegroups&…
+curl
http://localhost/heute/check_mk/webapi.py?action=get_all_contactgroups&…
+</tt>
+
+Furthermore you can add, edit and delete these groups
+<tt>
+ # All group types can be managed with similar requests
+
+ # Add
+ curl
"http://localhost/heute/check_mk/webapi.py?action=add_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1", "alias":
"the hg alias"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=add_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1", "alias":
"the sg alias"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1", "alias":
"the cg alias"}'
+
+ # Edit group
+ curl
"http://localhost/heute/check_mk/webapi.py?action=edit_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1", "alias":
"the hg alias"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=edit_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1", "alias":
"the sg alias"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=edit_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1", "alias":
"the cg alias"}'
+
+ # Delete group
+ curl
"http://localhost/heute/check_mk/webapi.py?action=delete_hostgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "hostgroup1"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=delete_servicegroup&_username=automation&_secret=1122"
-d 'request={"groupname": "servicegroup1"}'
+ curl
"http://localhost/heute/check_mk/webapi.py?action=delete_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "contactgroup1"}'
+
+
+ # For contact groups you may also specify a list of nagvis maps in the extra
attribute nagivs_maps
+ curl
"http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122"
-d 'request={"groupname": "newgroup2", "alias":
"the alias", "nagvis_maps": ["dfdf"]}'
+</tt>
+
diff --git a/ChangeLog b/ChangeLog
index ec44cd0..af24d14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -111,6 +111,7 @@
* 4142 New extended search dialog for rulesets and rules...
* 4217 WATO rules can now be moved via drag&drop...
* 4227 New manual WATO configuration lock mechanism...
+ * 4018 WATO WebAPI: new functions to manage host, service and contactgroups...
* 4003 FIX: esx_vsphere_objects: fixed check parameters display bug during WATO
service discovery
* 4146 FIX: Fixed broken "Global settings" when having the Event Console
disabled via "omd config"
* 4218 FIX: Disabling replication with a site did not clear the changes for this site
(1.4.0i3 regression)
@@ -151,6 +152,7 @@
* 4188 snmp_extended_info: Now capable to inventorize cisco backplane chassis...
* 4258 FIX: snmp_extended_info: fixed undefined variable
+
1.4.0i3:
Core & Setup:
* 3978 FIX: mkbackup: Fixed backup to some CIFS shares ([Errno 13] Permission denied)
'...')...