Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Zabbix (Second Edition)

You're reading from   Mastering Zabbix (Second Edition) Learn how to monitor your large IT environments with this one-stop, comprehensive guide to the Zabbix world

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher Packt
ISBN-13 9781785289262
Length 412 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Deploying Zabbix FREE CHAPTER 2. Distributed Monitoring 3. High Availability and Failover 4. Collecting Data 5. Visualizing Data 6. Managing Alerts 7. Managing Templates 8. Handling External Scripts 9. Extending Zabbix 10. Integrating Zabbix Index

Communicating with Zabbix


Now you know how the Zabbix protocol works, so it is time to see some code that implements this protocol. To keep things easy, we have described an example of the zabbix_sender protocol—the simplest way to send data to Zabbix.

Zabbix uses JSON to describe the object contained in the data. There are a lot of efficient JSON libraries that can be used, but to make things easier here, those libraries will not be used.

Implementing the Zabbix_sender protocol in Java

Here, you will see a really simple implementation of the zabbix_sender protocol that, as you know, is the easy way to send traps to Zabbix.

The piece of code that follows has been kept as simple as possible, and the scope is to provide an example from which you can start to develop your own Zabbix monitoring component:

private String buildJSonString(String host, String item,Long timestamp, String value){
  return  "{"
    + "\"request\":\"sender data\",\n"
    + "\"data\":[\n"
    +          "{\n"
      +    ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image