Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smejdil/zabbix-api
Zabbix API examples
https://github.com/smejdil/zabbix-api
api datascript perl zabbix zabbix-api
Last synced: 1 day ago
JSON representation
Zabbix API examples
- Host: GitHub
- URL: https://github.com/smejdil/zabbix-api
- Owner: smejdil
- License: gpl-2.0
- Created: 2021-11-29T07:20:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-15T12:40:17.000Z (about 1 year ago)
- Last Synced: 2023-11-15T16:51:08.762Z (about 1 year ago)
- Topics: api, datascript, perl, zabbix, zabbix-api
- Language: Perl
- Homepage: https://www.datascript.cz/kurzy/zabbix/
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## zabbix-api
This small project for Zabbix API examples
## Dependencies
- Zabbix API Perl script has been tested on FreeBSD
- Package - Perl - p5-JSON-RPC - JSON::RPC::Legacy::Client- Zabbix API Python script has been tested on FreeBSD
- Package - Python - zabbix-api and pyzabbix### Installation
```console
# Perl
cd /usr/ports/devel/p5-JSON-RPC && make install clean
man JSON::RPC::Legacy::Client# Python
cd /usr/ports/devel/py-pip && make install clean
cd /usr/ports/net-mgmt/py-pyzabbix && make install clean
pip install zabbix-apipip list | grep zabbix
pyzabbix 1.0.0
zabbix-api 0.5.4
```## Examples
```console
./auth.pl
Authentication successful. Auth ID: 8bf1e5e70bddb2bec567e267cc314dfd
``````console
./auth.py
20: url: http://localhost/api_jsonrpc.php
10: Trying to login with 'Admin':'md5(d947a125599f62d7bf378bd4e76a32cb)'
10: json_obj: {'jsonrpc': '2.0', 'method': 'user.login', 'params': {'user':'Admin', 'password': 'zabbix'}, 'id': 0}
20: Sending: {"jsonrpc": "2.0", "method": "user.login", "params": {"user":"Admin", "password":"zabbix"}, "id": 0}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': 'adb84cb506db2dd79fdc02528a902d37', 'id': 0}
10: json_obj: {'jsonrpc': '2.0', 'method': 'apiinfo.version', 'params': {}, 'id': 1}
20: Sending: {"jsonrpc": "2.0", "method": "apiinfo.version", "params": {}, "id": 1}
10: Sending headers: {'Content-Type': 'application/json-rpc', 'User-Agent': 'python/zabbix_api'}
20: Response Code: 200
10: Response Body: {'jsonrpc': '2.0', 'result': '5.0.17', 'id': 1}
Connected to Zabbix API Version 5.0.17
```## To do
- other languages