Created
April 19, 2019 07:19
-
-
Save DoMINAToR98/d9be397ac36185cd0ebef96c60a424f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from pyzabbix import ZabbixAPI | |
import sys | |
import logging | |
stream = logging.StreamHandler(sys.stdout) | |
stream.setLevel(logging.DEBUG) | |
log = logging.getLogger('pyzabbix') | |
log.addHandler(stream) | |
log.setLevel(logging.DEBUG) | |
zapi = ZabbixAPI("http://10.10.10.108/zabbix") | |
zapi.login("zapper", "zapper") | |
print ("Connected to %s" % zapi.api_version() ) | |
zapi.do_request('user.create', | |
{ | |
"alias": "root", | |
"passwd": "root", | |
"type": 3, | |
"usrgrps": [ | |
{ | |
"usrgrpid": "11" | |
} | |
] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment