Skip to content

Instantly share code, notes, and snippets.

@DoMINAToR98
Created April 19, 2019 07:19
Show Gist options
  • Save DoMINAToR98/d9be397ac36185cd0ebef96c60a424f2 to your computer and use it in GitHub Desktop.
Save DoMINAToR98/d9be397ac36185cd0ebef96c60a424f2 to your computer and use it in GitHub Desktop.
#!/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