Package Products :: Package ZenRRD :: Module CommandParser |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenRRD.CommandParser

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  import logging
    15  log = logging.getLogger('zen.ZenRRD.CommandParser')
    16
    17  from pprint import pformat
    18
    19 -class ParsedResults:
    20
    21 -    def __init__(self):
    22          self.events = []                # list of event dictionaries
    23          self.values = []                # list of (DataPointConfig, value)
    24
    25 -    def __repr__(self):
    26          args = (pformat(self.events), pformat(self.values))
    27          return "ParsedResults\n  events: %s\n  values: %s}" % args
    28
    29 -class CommandParser:
    30
    31 -    def dataForParser(self, context, datapoint):
    32          return {}
    33
    34 -    def processResults(self, cmd, results):
    35          """
    36          Process the results of a running a command.
    37
    38          @type cmd: Products.ZenRRD.zencommand.Cmd
    39
    40          @param cmd: the results of running a command, with the
    41          configuration from ZenHub
    42          @param results: the values and events from the command output
    43          @return: None.
    44          """
    45          raise NotImplementedError
    46