Package ZenModel :: Module PrintGraphPoint
[hide private]
[frames] | no frames]

Source Code for Module ZenModel.PrintGraphPoint

 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  __doc__="""PrintGraphPoint 
15   
16  Handles GraphPoints that define an rrd PRINT 
17  """ 
18   
19  import os 
20  from GraphPoint import GraphPoint 
21  from Globals import InitializeClass 
22   
23   
24 -def manage_addPrintGraphPoint(context, id, REQUEST = None):
25 ''' This is here so than zope will let us copy/paste/rename 26 graphpoints. 27 ''' 28 gp = PrintGraphPoint(id) 29 context._setObject(gp.id, gp) 30 if REQUEST: 31 return context.callZenScreen(REQUEST)
32 33
34 -class PrintGraphPoint(GraphPoint):
35 36 meta_type = 'PrintGraphPoint' 37 38 vname = '' 39 format = '' 40 strftime = '' 41 42 _properties = GraphPoint._properties + ( 43 {'id':'vname', 'type':'string', 'mode':'w'}, 44 {'id':'format', 'type':'string', 'mode':'w'}, 45 {'id':'strftime', 'type':'string', 'mode':'w'}, 46 ) 47
48 - def getDescription(self):
49 return self.format
50 51
52 - def getType(self):
53 return 'PRINT'
54 55
56 - def getGraphCmds(self, cmds, context, rrdDir, addSummary, idx, 57 multiid=-1, prefix=''):
58 ''' Build the graphing commands for this graphpoint 59 ''' 60 return cmds + ['PRINT:%s:%s%s' % ( 61 self.addPrefix(prefix, self.vname), 62 (self.format or self.DEFAULT_FORMAT).replace(':', '\:'), 63 self.strftime and ':%s' % self.strftime or '')]
64 65 66 InitializeClass(PrintGraphPoint) 67