here is a quick patch i've put together that adds two columns to the
interface section of the os tab. it is for 2.3.2, but hopefully will
apply easily to 2.3.3. i'm not sure about my rrd python calls, but it
seems to be producing data that matches what i see on the graphs most of
the time. i think there is some caching effects (since the python call
has cache in the name, i'm not surprised).
anyway, please let me know if it works for you and any other feedback you
might have. i don't know if something like this is in blue crab, or if i
can make this a zenpack. any feedback from the developers would be great
as well.
--- Products/ZenModel/IpInterface.py.orig 2008-12-15 14:40:15.000000000
-0800
+++ Products/ZenModel/IpInterface.py 2009-03-03 13:33:17.000000000 -0800
@@ -31,6 +31,7 @@
from App.Dialogs import MessageDialog
from AccessControl import ClassSecurityInfo
+from Products.ZenUtils.Utils import convToUnits
from Products.ZenRelations.RelSchema import *
from Products.ZenUtils.Utils import localIpCheck, localInterfaceCheck
@@ -515,5 +516,35 @@
"""
return 'None'
+ def getInput(self):
+ """
+ Trying to return input bandwidth
+ """
+ default = self.cacheRRDValue('ifInOctets', 0)*8
+ if default != default: #test for nan
+ return 0
+ return default
+
+ def getInputString(self):
+ """
+ Human format
+ """
+ return convToUnits(self.getInput(), 1000, 'bps')
+
+ def getOutput(self):
+ """
+ Trying to return input bandwidth
+ """
+ default = self.cacheRRDValue('ifOutOctets', 0)*8
+ if default != default: #test for nan
+ return 0
+ return default
+
+ def getOutputString(self):
+ """
+ Human format
+ """
+ return convToUnits(self.getOutput(), 1000, 'bps')
+
InitializeClass(IpInterface)
--- Products/ZenModel/skins/zenmodel/deviceOsDetail.pt.orig 2008-12-15
14:40:15.000000000 -0800
+++ Products/ZenModel/skins/zenmodel/deviceOsDetail.pt 2009-02-27
15:03:24.000000000 -0800
@@ -71,6 +71,10 @@
<th tal:condition="python: here.getZ('zIfDescription')"
tal:replace="structure python:here.ZenTableManager.getTableHeader(
tableName,'description','Descr')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'getInput','In')"/>
+ <th tal:replace="structure python:here.ZenTableManager.getTableHeader(
+ tableName,'getOutput','Out')"/>
<th class="tableheader" align="center" width="30">O</th>
<th class="tableheader" align="center" width="30">A</th>
<th class="tableheader" align="center" width="30">M</th>
@@ -114,6 +118,12 @@
class="tablevalues" tal:content="intf/description">
A really nice interface
</td>
+ <td class="tablevalues" tal:content="intf/getInputString">
+ In
+ </td>
+ <td class="tablevalues" tal:content="intf/getOutputString">
+ Out
+ </td>
<td class="tablevalues" align="center">
<img border="0"
tal:attributes="src python:test(intf.operStatus==1,
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users