diff options
author | Matt Woodson <mwoodson@gmail.com> | 2015-10-07 21:00:20 -0400 |
---|---|---|
committer | Matt Woodson <mwoodson@gmail.com> | 2015-10-07 21:00:20 -0400 |
commit | 062a2f23251f0db5ef5867fbe571ade391b1466e (patch) | |
tree | 1a4877bcf2f04206b866c4d6f35413bc85fe2a67 | |
parent | 1dcda754100b8d3e35ccab6cd4c586c8f445f1ec (diff) | |
parent | 6b3d70aec80f1cc9b4f9bd14aab062410e3d77ac (diff) | |
download | openshift-062a2f23251f0db5ef5867fbe571ade391b1466e.tar.gz openshift-062a2f23251f0db5ef5867fbe571ade391b1466e.tar.bz2 openshift-062a2f23251f0db5ef5867fbe571ade391b1466e.tar.xz openshift-062a2f23251f0db5ef5867fbe571ade391b1466e.zip |
Merge pull request #669 from kwoodson/protofix
Fixed a bug where applicationids were not being queried properly.
-rw-r--r-- | roles/lib_zabbix/library/zbx_itemprototype.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roles/lib_zabbix/library/zbx_itemprototype.py b/roles/lib_zabbix/library/zbx_itemprototype.py index 4ec1b8e02..e7fd6fa21 100644 --- a/roles/lib_zabbix/library/zbx_itemprototype.py +++ b/roles/lib_zabbix/library/zbx_itemprototype.py @@ -128,12 +128,12 @@ def get_status(status): return _status -def get_app_ids(zapi, application_names): +def get_app_ids(zapi, application_names, templateid): ''' get application ids from names ''' app_ids = [] for app_name in application_names: - content = zapi.get_content('application', 'get', {'search': {'name': app_name}}) + content = zapi.get_content('application', 'get', {'filter': {'name': app_name}, 'templateids': templateid}) if content.has_key('result'): app_ids.append(content['result'][0]['applicationid']) return app_ids @@ -212,7 +212,7 @@ def main(): 'ruleid': get_rule_id(zapi, module.params['discoveryrule_key'], template['templateid']), 'type': get_type(module.params['ztype']), 'value_type': get_value_type(module.params['value_type']), - 'applications': get_app_ids(zapi, module.params['applications']), + 'applications': get_app_ids(zapi, module.params['applications'], template['templateid']), 'description': module.params['description'], } |