-
Notifications
You must be signed in to change notification settings - Fork 0
/
getProxy.py
30 lines (24 loc) · 812 Bytes
/
getProxy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Looks up a host based on its name, and then adds an item to it
"""
import os
from pyzabbix import ZabbixAPI, ZabbixAPIException
import sys
# The hostname at which the Zabbix web interface is available
# Replace with url to interface. Keep the quotes.
ZABBIX_SERVER = 'Zabbix Web Interface URL'
zapi = ZabbixAPI(ZABBIX_SERVER)
#if getting certification errors, the line below is required
zapi.session.verfy=False
# Login to the Zabbix API
#replace username and password with the appropriate data. Keep the quotes around the data.
zapi.login('username', 'password')
try:
item = zapi.proxy.get(
output="extend",
selectInterface="extend"
)
except ZabbixAPIException as e:
print(e)
sys.exit()
print("If there was no output, then there was no proxy")