GithubHelp home page GithubHelp logo

zabbix-api's Introduction

zabbix-api

Fork of zabbix-api for java. Planed changes:

  • java level down to 6 - Done (Now fersion up to Java 7)
  • down Zabbix version to 2.2 - Done (Not tested for long time)
  • potential rework to use jaxon JSON parser and serializer for minifiing dependencies - done.
  • down httpclient version - done
  • rework of tests for support local params for Zabbix connections. - Done

https://www.zabbix.com/wiki/doc/api

https://www.zabbix.com/documentation/2.2/manual/api/reference/user/login

Based on zabbix api version 2.2.

##Info API is simple, beacuse java can not process json like dynamic language.

You can build you own Request Object.

public interface ZabbixApi {

	void init();

	void destroy();

	String apiVersion();

	JsonNode call(Request request);

	boolean login(String user, String password);
}

Example - Need to update!

		String url = "http://192.168.90.102/zabbix/api_jsonrpc.php";
		zabbixApi = new DefaultZabbixApi(url);
		zabbixApi.init();
		
		boolean login = zabbixApi.login("zabbix.dev", "goK0Loqua4Eipoe");
		System.err.println("login:" + login);

        Map filter = new HashMap();

        filter.put("host", new String[]{host});
        Request getRequest = RequestBuilder.newBuilder().method("host.get")
                .paramEntry("filter", filter).build();
   
        JsonNode getResponse = zabbixApi.call(getRequest);
   
        System.err.println(getResponse);
        String hostid = getResponse.path("result").path(0).path("hostid").getTextValue();
        System.err.println(hostid);

You can add dependency to Maven project:

        <dependency>
            <groupId>io.github.cgi</groupId>
            <artifactId>zabbix-api</artifactId>
            <version>0.0.5</version>
        </dependency>

##Licence Apache License V2

zabbix-api's People

Contributors

cgi avatar hengyunabc avatar unik avatar v-zhuravlev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

elevennl

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.