No Node Left Behind

Currently Being Moderated

This month’s tip comes from the Zenoss Forums thread How Change Performance Graphs Range from hour to minute? with the solution from user ‘jhelgesen’.

 

The default range for performance graphs in Zenoss are 129600 seconds, or 36 hours. You may change the default ranges, so you do not have to zoom in or out each time you view the performance graphs. Unfortunately these values are hard-coded and will have to be added to the source files to override them.

 

render

 

There are three files you will need to edit, make sure you back them up before editing.

 

$ZENHOME/Products/ZenModel/DataRoot.py holds the default ranges for performance graphs. Near line 243 (depending on your Zenoss version) there is a table that holds the list of available time ranges, with time spans in seconds. You may add a new range (e.g. 8 hours or 28800 seconds) and make this the new default. You will change to code to look similar to this (remember to maintain the same spacing):

defaultDateRange = 28800
performanceDateRanges = [
('Today',28800,),
('Hourly',129600,),
('Daily',864000,),
('Weekly',3628800,),
('Monthly',41472000,),
('Yearly',62208000,)
]

Remove the compiled $ZENHOME/Products/ZenModel/DataRoot.pyc file and the update will go into effect.

 

Next you will need to update the template files to default to the range that you prefer.


$ZENHOME/Products/ZenModel/skins/zenmodel/viewPerformanceDetail.pt and $ZENHOME/Products/ZenModel/skins/zenmodel/viewGraphReport.pt each contain a single line defining the default date range.

 

For $ZENHOME/Products/ZenModel/skins/zenmodel/viewPerformanceDetail.pt near line 15 (dependent on your Zenoss version) there is a line:

tableName,'drange',129600)">

you will change this to

tableName,'drange',28800)">

for an 8 hour default.

 

For $ZENHOME/Products/ZenModel/skins/zenmodel/viewGraphReport.pt near line 52 (dependent on your Zenoss version) there is a line:

tableName,'drange',129600)">

you will change this to

tableName,'drange',28800)">

for an 8 hour default.

 

You now have 8 hour defaults for your performance graphs. Note that you will have to re-apply these edits when you upgrade your version of Zenoss.

5,032 Views Tags: zenoss, tips, performance-graphs


There are no comments on this post