Permalink
Browse files

CiscoCatalyst 1.0

  • Loading branch information...
0 parents commit 56067a2ff1e06e5cdb0c8e06fd26a0585fe54aaa Kells Kearney committed Oct 28, 2010
17 COPYRIGHT.txt
@@ -0,0 +1,17 @@
+
+All files in this directory and below are:
+
+Copyright (c) 2008, 2009, 2010 Zenoss, Inc. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1 MANIFEST.in
@@ -0,0 +1 @@
+graft ZenPacks
8 ZenPacks/Nova/Cisco/Catalyst/__init__.py
@@ -0,0 +1,8 @@
+
+import Globals
+import os.path
+
+skinsDir = os.path.join(os.path.dirname(__file__), 'skins')
+from Products.CMFCore.DirectoryView import registerDirectory
+if os.path.isdir(skinsDir):
+ registerDirectory(skinsDir, globals())
2 ZenPacks/Nova/Cisco/Catalyst/datasources/__init__.py
@@ -0,0 +1,2 @@
+# __init__.py
+
1 ZenPacks/Nova/Cisco/Catalyst/lib/__init__.py
@@ -0,0 +1 @@
+# __init__.py
1 ZenPacks/Nova/Cisco/Catalyst/migrate/__init__.py
@@ -0,0 +1 @@
+# __init__.py
0 ZenPacks/Nova/Cisco/Catalyst/modeler/__init__.py
No changes.
0 ZenPacks/Nova/Cisco/Catalyst/modeler/plugins/__init__.py
No changes.
0 ZenPacks/Nova/Cisco/Catalyst/modeler/plugins/zenoss/__init__.py
No changes.
61 ZenPacks/Nova/Cisco/Catalyst/modeler/plugins/zenoss/snmp/InterfaceCatOsMap.py
@@ -0,0 +1,61 @@
+###########################################################################
+#
+# This program is part of Zenoss Core, an open source monitoring platform.
+# Copyright (C) 2007, 2009, Zenoss Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published by
+# the Free Software Foundation.
+#
+# For complete information please visit: http://www.zenoss.com/oss/
+#
+###########################################################################
+
+__doc__ = """InterfaceCatOsMap
+
+ Extends the standard InterfaceMap to use 1.3.6.1.4.1.9.5.1.4.1.1.4
+ (the CatOS interface description) as the interface's description
+ instead of the standard interface description. Also uses ifName
+ instead of ifDescr.
+"""
+
+from copy import deepcopy
+from Products.DataCollector.plugins.zenoss.snmp.InterfaceMap \
+ import InterfaceMap
+from Products.DataCollector.plugins.CollectorPlugin import GetTableMap
+
+class InterfaceCatOsMap(InterfaceMap):
+
+ snmpGetTableMaps = InterfaceMap.baseSnmpGetTableMaps + (
+ # Extended interface information.
+ GetTableMap('ifalias', '.1.3.6.1.2.1.31.1.1.1',
+ {'.1' : 'ifName',
+ '.6' : 'ifHCInOctets',
+ '.7' : 'ifHCInUcastPkts',
+ '.15': 'highSpeed'}
+ ),
+ GetTableMap('ifcatos', '.1.3.6.1.4.1.9.5.1.4.1.1',
+ {'.11' : 'ifindex',
+ '.4' : 'description'}
+ ),
+ )
+
+ def process(self, device, results, log):
+ """
+ Pre-process the IF-MIB ifXTable to use the ifAlias as the interface's
+ name instead of the ifDescr. Also to use description from alternate OIDs.
+ """
+
+ if 'ifalias' in results[1] and 'iftable' in results[1]:
+ for a_idx, alias in results[1]['ifalias'].items():
+ for i_idx, iface in results[1]['iftable'].items():
+ if a_idx == i_idx:
+ results[1]['iftable'][i_idx]['id'] = alias['ifName']
+
+ if 'ifcatos' in results[1] and 'iftable' in results[1]:
+ for a_idx, catos in results[1]['ifcatos'].items():
+ for i_idx, iface in results[1]['iftable'].items():
+ if catos['ifindex'] == iface['ifindex']:
+ results[1]['ifalias'][i_idx]['description'] = catos['description']
+
+ return super(InterfaceCatOsMap, self).process(device, results, log)
0 ZenPacks/Nova/Cisco/Catalyst/modeler/plugins/zenoss/snmp/__init__.py
No changes.
464 ZenPacks/Nova/Cisco/Catalyst/objects/objects.xml
@@ -0,0 +1,464 @@
+<?xml version="1.0"?>
+<objects>
+<!-- ('', 'zport', 'dmd', 'Devices', 'Network', 'Switch', 'Cisco', 'Catalyst') -->
+<object id='/zport/dmd/Devices/Network/Switch/Cisco/Catalyst' module='Products.ZenModel.DeviceClass' class='DeviceClass'>
+<property visible="True" type="lines" id="zCollectorPlugins" >
+['zenoss.snmp.NewDeviceMap', 'zenoss.snmp.DeviceMap', 'zenoss.snmp.InterfaceMap', 'zenoss.snmp.InterfaceCatOsMap', 'zenoss.snmp.RouteMap', 'zenoss.snmp.CiscoHSRP']
+</property>
+<tomanycont id='rrdTemplates'>
+<object id='Device' module='Products.ZenModel.RRDTemplate' class='RRDTemplate'>
+<property type="text" id="description" mode="w" >
+Cisco template that collects cpu and free memory. Has CPU threshold at 90%
+</property>
+<property type="string" id="targetPythonClass" mode="w" >
+Products.ZenModel.Device
+</property>
+<tomanycont id='datasources'>
+<object id='cpu5min' module='Products.ZenModel.BasicDataSource' class='BasicDataSource'>
+<property select_variable="sourcetypes" type="selection" id="sourcetype" mode="w" >
+SNMP
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Cmd/Fail
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="cycletime" mode="w" >
+300
+</property>
+<property type="string" id="oid" mode="w" >
+1.3.6.1.4.1.9.9.109.1.1.1.1.5.9
+</property>
+<property type="boolean" id="usessh" mode="w" >
+False
+</property>
+<property type="string" id="parser" mode="w" >
+Auto
+</property>
+<tomanycont id='datapoints'>
+<object id='cpu5min' module='Products.ZenModel.RRDDataPoint' class='RRDDataPoint'>
+<property select_variable="rrdtypes" type="selection" id="rrdtype" mode="w" >
+GAUGE
+</property>
+<property type="boolean" id="isrow" mode="w" >
+True
+</property>
+</object>
+</tomanycont>
+</object>
+<object id='mem5minFree' module='Products.ZenModel.BasicDataSource' class='BasicDataSource'>
+<property select_variable="sourcetypes" type="selection" id="sourcetype" mode="w" >
+SNMP
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Cmd/Fail
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="cycletime" mode="w" >
+300
+</property>
+<property type="string" id="oid" mode="w" >
+1.3.6.1.4.1.9.9.48.1.1.1.6.1
+</property>
+<property type="boolean" id="usessh" mode="w" >
+False
+</property>
+<property type="string" id="parser" mode="w" >
+Auto
+</property>
+<tomanycont id='datapoints'>
+<object id='mem5minFree' module='Products.ZenModel.RRDDataPoint' class='RRDDataPoint'>
+<property select_variable="rrdtypes" type="selection" id="rrdtype" mode="w" >
+GAUGE
+</property>
+<property type="boolean" id="isrow" mode="w" >
+True
+</property>
+</object>
+</tomanycont>
+</object>
+<object id='mem5minUsed' module='Products.ZenModel.BasicDataSource' class='BasicDataSource'>
+<property select_variable="sourcetypes" type="selection" id="sourcetype" mode="w" >
+SNMP
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Cmd/Fail
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="cycletime" mode="w" >
+300
+</property>
+<property type="string" id="oid" mode="w" >
+1.3.6.1.4.1.9.9.48.1.1.1.5.1
+</property>
+<property type="boolean" id="usessh" mode="w" >
+False
+</property>
+<property type="string" id="parser" mode="w" >
+Auto
+</property>
+<tomanycont id='datapoints'>
+<object id='mem5minUsed' module='Products.ZenModel.RRDDataPoint' class='RRDDataPoint'>
+<property select_variable="rrdtypes" type="selection" id="rrdtype" mode="w" >
+GAUGE
+</property>
+<property type="boolean" id="isrow" mode="w" >
+True
+</property>
+</object>
+</tomanycont>
+</object>
+<object id='sysUpTime' module='Products.ZenModel.BasicDataSource' class='BasicDataSource'>
+<property select_variable="sourcetypes" type="selection" id="sourcetype" mode="w" >
+SNMP
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Cmd/Fail
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="cycletime" mode="w" >
+300
+</property>
+<property type="string" id="oid" mode="w" >
+1.3.6.1.2.1.1.3.0
+</property>
+<property type="boolean" id="usessh" mode="w" >
+False
+</property>
+<property type="string" id="parser" mode="w" >
+Auto
+</property>
+<tomanycont id='datapoints'>
+<object id='sysUpTime' module='Products.ZenModel.RRDDataPoint' class='RRDDataPoint'>
+<property select_variable="rrdtypes" type="selection" id="rrdtype" mode="w" >
+GAUGE
+</property>
+<property type="boolean" id="isrow" mode="w" >
+True
+</property>
+</object>
+</tomanycont>
+</object>
+</tomanycont>
+<tomanycont id='graphs'>
+<object id='CPU Utilization' module='Products.ZenModel.RRDGraph' class='RRDGraph'>
+<property type="lines" id="dsnames" mode="w" >
+['cpu5min_cpu5min']
+</property>
+<property type="int" id="sequence" mode="w" >
+0
+</property>
+<property type="int" id="height" mode="w" >
+100
+</property>
+<property type="int" id="width" mode="w" >
+500
+</property>
+<property type="string" id="units" mode="w" >
+percentage
+</property>
+<property type="int" id="linewidth" mode="w" >
+1
+</property>
+<property type="boolean" id="log" mode="w" >
+False
+</property>
+<property type="boolean" id="base" mode="w" >
+False
+</property>
+<property type="boolean" id="stacked" mode="w" >
+False
+</property>
+<property type="boolean" id="summary" mode="w" >
+True
+</property>
+<property type="int" id="miny" mode="w" >
+-1
+</property>
+<property type="int" id="maxy" mode="w" >
+-1
+</property>
+<property type="lines" id="colors" mode="w" >
+('#00cc00', '#0000ff', '#00ffff', '#ff0000', '#ffff00', '#cc0000', '#0000cc', '#0080c0', '#8080c0', '#ff0080', '#800080', '#0000a0', '#408080', '#808000', '#000000', '#00ff00', '#fb31fb', '#0080ff', '#ff8000', '#800000')
+</property>
+<property type="boolean" id="hasSummary" mode="w" >
+True
+</property>
+</object>
+<object id='Free Memory' module='Products.ZenModel.RRDGraph' class='RRDGraph'>
+<property type="lines" id="dsnames" mode="w" >
+['mem5minFree_mem5minFree']
+</property>
+<property type="int" id="sequence" mode="w" >
+1
+</property>
+<property type="int" id="height" mode="w" >
+100
+</property>
+<property type="int" id="width" mode="w" >
+500
+</property>
+<property type="string" id="units" mode="w" >
+memory
+</property>
+<property type="int" id="linewidth" mode="w" >
+1
+</property>
+<property type="boolean" id="log" mode="w" >
+False
+</property>
+<property type="boolean" id="base" mode="w" >
+True
+</property>
+<property type="boolean" id="stacked" mode="w" >
+False
+</property>
+<property type="boolean" id="summary" mode="w" >
+True
+</property>
+<property type="int" id="miny" mode="w" >
+-1
+</property>
+<property type="int" id="maxy" mode="w" >
+-1
+</property>
+<property type="lines" id="colors" mode="w" >
+('#00cc00', '#0000ff', '#00ffff', '#ff0000', '#ffff00', '#cc0000', '#0000cc', '#0080c0', '#8080c0', '#ff0080', '#800080', '#0000a0', '#408080', '#808000', '#000000', '#00ff00', '#fb31fb', '#0080ff', '#ff8000', '#800000')
+</property>
+<property type="boolean" id="hasSummary" mode="w" >
+True
+</property>
+</object>
+</tomanycont>
+<tomanycont id='thresholds'>
+<object id='CPU' module='Products.ZenModel.MinMaxThreshold' class='MinMaxThreshold'>
+<property type="lines" id="dsnames" mode="w" >
+['cpu5min_cpu5min']
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="maxval" mode="w" >
+90
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Perf/CPU
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="escalateCount" mode="w" >
+0
+</property>
+</object>
+<object id='Memory' module='Products.ZenModel.MinMaxThreshold' class='MinMaxThreshold'>
+<property type="lines" id="dsnames" mode="w" >
+['mem5minUsed_mem5minUsed']
+</property>
+<property type="boolean" id="enabled" mode="w" >
+True
+</property>
+<property type="string" id="maxval" mode="w" >
+(here.getRRDValue('mem5minUsed') + here.getRRDValue('mem5minFree')) * 0.9
+</property>
+<property type="string" id="eventClass" mode="w" >
+/Perf/Memory
+</property>
+<property type="int" id="severity" mode="w" >
+3
+</property>
+<property type="int" id="escalateCount" mode="w" >
+0
+</property>
+</object>
+</tomanycont>
+<tomanycont id='graphDefs'>
+<object id='CPU Utilization' module='Products.ZenModel.GraphDefinition' class='GraphDefinition'>
+<property type="int" id="height" mode="w" >
+100
+</property>
+<property type="int" id="width" mode="w" >
+500
+</property>
+<property type="string" id="units" mode="w" >
+percentage
+</property>
+<property type="boolean" id="log" mode="w" >
+False
+</property>
+<property type="boolean" id="base" mode="w" >
+False
+</property>
+<property type="int" id="miny" mode="w" >
+-1
+</property>
+<property type="int" id="maxy" mode="w" >
+-1
+</property>
+<property type="boolean" id="hasSummary" mode="w" >
+True
+</property>
+<tomanycont id='graphPoints'>
+<object id='CPU Threshold' module='Products.ZenModel.ThresholdGraphPoint' class='ThresholdGraphPoint'>
+<property type="string" id="threshId" mode="w" >
+CPU
+</property>
+<property type="string" id="legend" mode="w" >
+${graphPoint/id}
+</property>
+</object>
+<object id='CPU Utilization' module='Products.ZenModel.DataPointGraphPoint' class='DataPointGraphPoint'>
+<property type="long" id="sequence" mode="w" >
+1
+</property>
+<property select_variable="lineTypes" type="selection" id="lineType" mode="w" >
+AREA
+</property>
+<property type="long" id="lineWidth" mode="w" >
+1
+</property>
+<property type="boolean" id="stacked" mode="w" >
+False
+</property>
+<property type="string" id="format" mode="w" >
+%0.2lf
+</property>
+<property type="string" id="legend" mode="w" >
+${graphPoint/id}
+</property>
+<property type="long" id="limit" mode="w" >
+-1
+</property>
+<property type="string" id="dpName" mode="w" >
+cpu5min_cpu5min
+</property>
+<property type="string" id="cFunc" mode="w" >
+AVERAGE
+</property>
+</object>
+</tomanycont>
+</object>
+<object id='Memory Utilization' module='Products.ZenModel.GraphDefinition' class='GraphDefinition'>
+<property type="int" id="height" mode="w" >
+100
+</property>
+<property type="int" id="width" mode="w" >
+500
+</property>
+<property type="string" id="units" mode="w" >
+bytes
+</property>
+<property type="boolean" id="log" mode="w" >
+False
+</property>
+<property type="boolean" id="base" mode="w" >
+True
+</property>
+<property type="int" id="miny" mode="w" >
+-1
+</property>
+<property type="int" id="maxy" mode="w" >
+-1
+</property>
+<property type="boolean" id="hasSummary" mode="w" >
+True
+</property>
+<property type="long" id="sequence" mode="w" >
+1
+</property>
+<tomanycont id='graphPoints'>
+<object id='Memory' module='Products.ZenModel.ThresholdGraphPoint' class='ThresholdGraphPoint'>
+<property type="string" id="threshId" mode="w" >
+Memory
+</property>
+<property type="string" id="legend" mode="w" >
+Memory Threshold
+</property>
+</object>
+<object id='Memory Utilization' module='Products.ZenModel.DataPointGraphPoint' class='DataPointGraphPoint'>
+<property type="long" id="sequence" mode="w" >
+1
+</property>
+<property select_variable="lineTypes" type="selection" id="lineType" mode="w" >
+AREA
+</property>
+<property type="long" id="lineWidth" mode="w" >
+1
+</property>
+<property type="boolean" id="stacked" mode="w" >
+False
+</property>
+<property type="string" id="format" mode="w" >
+%5.2lf%s
+</property>
+<property type="string" id="legend" mode="w" >
+${graphPoint/id}
+</property>
+<property type="long" id="limit" mode="w" >
+-1
+</property>
+<property type="string" id="dpName" mode="w" >
+mem5minUsed_mem5minUsed
+</property>
+<property type="string" id="cFunc" mode="w" >
+AVERAGE
+</property>
+</object>
+<object id='Total Memory' module='Products.ZenModel.DataPointGraphPoint' class='DataPointGraphPoint'>
+<property type="long" id="sequence" mode="w" >
+2
+</property>
+<property select_variable="lineTypes" type="selection" id="lineType" mode="w" >
+LINE
+</property>
+<property type="long" id="lineWidth" mode="w" >
+1
+</property>
+<property type="boolean" id="stacked" mode="w" >
+False
+</property>
+<property type="string" id="format" mode="w" >
+%5.2lf%s
+</property>
+<property type="string" id="legend" mode="w" >
+${graphPoint/id}
+</property>
+<property type="long" id="limit" mode="w" >
+-1
+</property>
+<property type="string" id="rpn" mode="w" >
+Memory_Utilization,+
+</property>
+<property type="string" id="dpName" mode="w" >
+mem5minFree_mem5minFree
+</property>
+<property type="string" id="cFunc" mode="w" >
+AVERAGE
+</property>
+</object>
+</tomanycont>
+</object>
+</tomanycont>
+</object>
+</tomanycont>
+</object>
+</objects>
0 ZenPacks/Nova/Cisco/Catalyst/skins/ZenPacks.Nova.Cisco.Catalyst/placeholder.txt
No changes.
12 ZenPacks/Nova/Cisco/Catalyst/tests/__init__.py
@@ -0,0 +1,12 @@
+# ##########################################################################
+#
+# This program is part of Zenoss Core, an open source monitoring platform.
+# Copyright (C) 2008, Zenoss Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published by
+# the Free Software Foundation.
+#
+# For complete information please visit: http://www.zenoss.com/oss/
+#
+# ##########################################################################
1 ZenPacks/Nova/Cisco/__init__.py
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
1 ZenPacks/Nova/__init__.py
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
1 ZenPacks/__init__.py
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
68 setup.py
@@ -0,0 +1,68 @@
+################################
+# These variables are overwritten by Zenoss when the ZenPack is exported
+# or saved. Do not modify them directly here.
+NAME = "ZenPacks.Nova.Cisco.Catalyst"
+VERSION = "1.0"
+AUTHOR = "Ryan Matte"
+LICENSE = "LGPL"
+NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.Nova', 'ZenPacks.Nova.Cisco']
+PACKAGES = ['ZenPacks', 'ZenPacks.Nova', 'ZenPacks.Nova.Cisco', 'ZenPacks.Nova.Cisco.Catalyst']
+INSTALL_REQUIRES = []
+COMPAT_ZENOSS_VERS = ">= 3.0"
+PREV_ZENPACK_NAME = "Catalyst"
+# STOP_REPLACEMENTS
+################################
+# Zenoss will not overwrite any changes you make below here.
+
+from setuptools import setup, find_packages
+
+setup(
+ # This ZenPack metadata should usually be edited with the Zenoss
+ # ZenPack edit page. Whenever the edit page is submitted it will
+ # overwrite the values below (the ones it knows about) with new values.
+ name = NAME,
+ version = VERSION,
+ author = AUTHOR,
+ license = LICENSE,
+
+ # This is the version spec which indicates what versions of Zenoss
+ # this ZenPack is compatible with
+ compatZenossVers = COMPAT_ZENOSS_VERS,
+
+ # previousZenPackName is a facility for telling Zenoss that the name
+ # of this ZenPack has changed. If no ZenPack with the current name is
+ # installed then a zenpack of this name if installed will be upgraded.
+ prevZenPackName = PREV_ZENPACK_NAME,
+
+ # Indicate to setuptools which namespace packages the zenpack
+ # participates in
+ namespace_packages = NAMESPACE_PACKAGES,
+
+ # Tell setuptools what packages this zenpack provides.
+ packages = find_packages(),
+
+ # Tell setuptools to figure out for itself which files to include
+ # in the binary egg when it is built.
+ include_package_data = True,
+
+ # The MANIFEST.in file is the recommended way of including additional files
+ # in your ZenPack. package_data is another.
+ #package_data = {}
+
+ # Indicate dependencies on other python modules or ZenPacks. This line
+ # is modified by zenoss when the ZenPack edit page is submitted. Zenoss
+ # tries to put add/delete the names it manages at the beginning of this
+ # list, so any manual additions should be added to the end. Things will
+ # go poorly if this line is broken into multiple lines or modified to
+ # dramatically.
+ install_requires = INSTALL_REQUIRES,
+
+ # Every ZenPack egg must define exactly one zenoss.zenpacks entry point
+ # of this form.
+ entry_points = {
+ 'zenoss.zenpacks': '%s = %s' % (NAME, NAME),
+ },
+
+ # All ZenPack eggs must be installed in unzipped form.
+ zip_safe = False,
+)

0 comments on commit 56067a2

Please sign in to comment.