Git Product home page Git Product logo

microzabbixapiconnector's Introduction

micro jscon-rpc connector for zabbix api requests

this connector support:

  • proxy usage (setup in basic jsonrpc class)

#how use?

require and define zabbix-connector class

require __DIR__ . '/zbx.inc.php';

define zabbix connector

$zbx = new zbx;

authorize

for auth u need 3 params,

  • url to zabbix api like http(s)://zabbixurl/api_jsonrpc.php
  • user
  • password

for next requests for zabbix we use returned "access token" from authorization

$zbx->url = zabbixurl;
$zbx->method = 'user.login';
$zbx->query['user'] = $connection['user'];
$zbx->query['password'] = $connection['password'];
$zbx->access_token = $zbx->call()['result'];

###sample of request after auth

  • get host id by host name
$zbx->method = 'template.get';
$zbx->query['output'] = 'hostids';
$zbx->query['filter']['host'] = 'domain_server';
$hostid = $zbx->call()['result']['0']['hostid'];
  • for debug u can use full responce output like:
var_dump($zbx->call());

microzabbixapiconnector's People

Stargazers

 avatar  avatar octaviopezoa avatar grootli avatar Andrew V. avatar José Guilherme avatar Billy D. avatar Deivison Moraes avatar

Watchers

 avatar  avatar Billy D. avatar Daniel Campos avatar

Forkers

diffway blinno

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.