4 # rafael@e-mc2.net / https://e-mc2.net/
6 # Copyright (c) 2016-2017 USIT-University of Oslo
8 # get_webapps_instances.py is free software: you can redistribute
9 # it and/or modify it under the terms of the GNU General Public
10 # License as published by the Free Software Foundation, either version
11 # 3 of the License, or (at your option) any later version.
13 # get_webapps_instances.py is distributed in the hope that it will
14 # be useful, but WITHOUT ANY WARRANTY; without even the implied
15 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 # See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with sms_send. If not, see <http://www.gnu.org/licenses/>.
28 zabbix_mgmt_url = 'http://zabbix-mgmt.uio.no/zabbix/V2'
30 # ############################################
31 # get_webapps_servers()
32 # ############################################
34 def get_webapp_instances(application):
38 request_data = requests.get(zabbix_mgmt_url + "/" + application + ".json")
40 if request_data.status_code != 200:
43 autodiscovery_data = request_data.content
44 print autodiscovery_data
50 # ############################################
52 # ############################################
54 if __name__ == '__main__':
57 application = sys.argv[1]
58 get_webapp_instances(application)