Package ZenRRD :: Module RenderServer :: Class RenderServer
[hide private]
[frames] | no frames]

Class RenderServer

source code

Products.ZenModel.ZenModelRM.ZenModelRM --+    
                                          |    
                    RRDToolItem.RRDToolItem --+
                                              |
                                             RenderServer

Base class for turning graph requests into graphics. NB: Any log messages get logged into the event.log file.

Instance Methods [hide private]
 
__init__(self, id, tmpdir='/tmp/renderserver', cachetimeout=300) source code
 
removeInvalidRRDReferences(self, cmds)
Check the cmds list for DEF commands.
source code
 
render(self, gopts=None, start=None, end=None, drange=None, remoteUrl=None, width=None, ftype='PNG', getImage=True, graphid='', comment=None, ms=None, REQUEST=None)
Render a graph and return it
source code
 
deleteRRDFiles(self, device, datasource=None, datapoint=None, remoteUrl=None, REQUEST=None)
Delete RRD files associated with the given device id.
source code
 
packageRRDFiles(self, device, REQUEST=None)
Tar up RRD files into a nice, neat package
source code
 
unpackageRRDFiles(self, device, REQUEST=None)
Untar a package of RRDFiles
source code
 
receiveRRDFiles(self, REQUEST=None)
Receive a device's RRD Files from another server This function is called by sendRRDFiles()
source code
 
sendRRDFiles(self, device, server, REQUEST=None)
Move a package of RRDFiles
source code
 
moveRRDFiles(self, device, destServer, srcServer=None, REQUEST=None)
Send a device's RRD files to another server
source code
 
plugin(self, name, REQUEST=None)
Render a custom graph and return it
source code
 
summary(self, gopts)
Return summary information as a list but no graph
source code
 
fetchValues(self, paths, cf, resolution, start, end="") source code
 
currentValues(self, paths)
Return the latest values recorded in the RRD file
source code
string
rrdcmd(self, gopts, ftype='PNG')
Generate the RRD command using the graphing options specified.
source code
string
graphId(self, gopts, drange, ftype)
Generate a graph id based on a hash of values
source code
 
_loadfile(self, filename) source code
 
setupCache(self)
Make a new cache if we need one
source code
 
addGraph(self, id, filename)
Add a graph to temporary folder
source code
 
getGraph(self, id, ftype, REQUEST)
Get a previously generated graph
source code

Inherited from RRDToolItem.RRDToolItem: getName

Class Variables [hide private]
  meta_type = "RenderServer"
  cacheName = 'RRDRenderCache'
  security = ClassSecurityInfo()
Method Details [hide private]

removeInvalidRRDReferences(self, cmds)

source code 
Check the cmds list for DEF commands. For each one check that the rrd file specified actually exists. Return a list of commands which excludes commands referencing or depending on non-existent RRD files.
Parameters:
  • cmds - list of RRD commands
Returns:
sanitized list of RRD commands

render(self, gopts=None, start=None, end=None, drange=None, remoteUrl=None, width=None, ftype='PNG', getImage=True, graphid='', comment=None, ms=None, REQUEST=None)

source code 
Render a graph and return it
Parameters:
  • gopts - RRD graph creation options
  • start - requested start of data to graph
  • end - requested start of data to graph
  • drange - min/max values of the graph
  • remoteUrl - if the RRD is not here, where it lives
  • width - size of graphic to create
  • ftype - file type of graphic (eg PNG)
  • getImage - return the graph or a script location
  • graphid - (hopefully) unique identifier of a graph
  • comment - RRD graph comment
  • ms - a timestamp used to force IE to reload images
  • REQUEST - URL-marshalled object containg URL options
Returns:
graph or script location

deleteRRDFiles(self, device, datasource=None, datapoint=None, remoteUrl=None, REQUEST=None)

source code 

Delete RRD files associated with the given device id.
If datapoint is not None then delete the file corresponding to that dp.
Else if datasource is not None then delete the files corresponding to
  all datapoints in the datasource.
Else delete all RRD files associated with the given device.

@param device: device name
@param datasource: RRD datasource (DS) name
@param datapoint: RRD datapoint name (lives in a DS)
@param remoteUrl: if the RRD is not here, where it lives
@param REQUEST: URL-marshalled object containg URL options

packageRRDFiles(self, device, REQUEST=None)

source code 
Tar up RRD files into a nice, neat package
Parameters:
  • device - device name
  • REQUEST - URL-marshalled object containg URL options

unpackageRRDFiles(self, device, REQUEST=None)

source code 
Untar a package of RRDFiles
Parameters:
  • device - device name
  • REQUEST - URL-marshalled object containg URL options

receiveRRDFiles(self, REQUEST=None)

source code 
Receive a device's RRD Files from another server This function is called by sendRRDFiles()
Parameters:
  • REQUEST (URL-marshalled parameters) - 'tarfile', 'tarfilename'

sendRRDFiles(self, device, server, REQUEST=None)

source code 
Move a package of RRDFiles
Parameters:
  • device - device name
  • server - another RenderServer instance
  • REQUEST - URL-marshalled object containg URL options

moveRRDFiles(self, device, destServer, srcServer=None, REQUEST=None)

source code 
Send a device's RRD files to another server
Parameters:
  • device - device name
  • destServer - another RenderServer instance
  • srcServer - another RenderServer instance
  • REQUEST - URL-marshalled object containg URL options

plugin(self, name, REQUEST=None)

source code 
Render a custom graph and return it
Parameters:
  • name - plugin name from Products/ZenRRD/plugins
Returns:
graph or None

summary(self, gopts)

source code 
Return summary information as a list but no graph
Parameters:
  • gopts - RRD graph options
Returns:
values from the graph

rrdcmd(self, gopts, ftype='PNG')

source code 
Generate the RRD command using the graphing options specified.
Parameters:
  • gopts - RRD graphing options
  • ftype - graphic file type (eg PNG)
Returns: string
RRD command usable on the command-line

graphId(self, gopts, drange, ftype)

source code 
Generate a graph id based on a hash of values
Parameters:
  • gopts - RRD graphing options
  • drange - min/max values of the graph
  • ftype - graphic file's type (eg PNG)
Returns: string
An id for this graph usable in URLs

addGraph(self, id, filename)

source code 
Add a graph to temporary folder
Parameters:
  • id - graph id
  • filename - cacheable graphic file

getGraph(self, id, ftype, REQUEST)

source code 
Get a previously generated graph
Parameters:
  • id - graph id
  • ftype - file type of graphic (eg PNG)
  • REQUEST - graph id