JSON Parser

From Zenoss Wiki
Revision as of 20:08, 10 January 2013 by Eedgar (Talk | contribs)$7

Jump to: navigation, search

General purpose JSON parser for handling JSON objects matching the followingtemplate. This allows many datapoints for many components to be collectedfrom a single COMMAND datasource. It also allows for collection of manyevents from a single COMMAND datasource. The event capabilities are a significant reason to choose this parser instead of the older Nagios parser for example.

If you specify a blank component eg "" it refers to a device level entry.

This example is from Products/ZenRRD/parsers/JSON.py

{    
  "values": {
     "component_id_1": {
        "datapoint1": 123.4,
        "datapoint2": 987.6
      },
 
      "component_id_2": {
        "datapoint1": 56.7,
        "datapoint2": 54.3
      }
    },
 
    "events": [
        {            
           "severity": 2,
           "other_field_1": "value for other field",
           "summary": "event summary"
        },
        {
           "severity": 3,
           "other_field_1": "another value for other field",
           "summary": "another event summary"
        }
    ]
}