Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kells Kearney
committed
Oct 28, 2010
0 parents
commit 56067a2
Showing
18 changed files
with
638 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
graft ZenPacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# __init__.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# __init__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# __init__.py |
Empty file.
Empty file.
Empty file.
61 changes: 61 additions & 0 deletions
61
ZenPacks/Nova/Cisco/Catalyst/modeler/plugins/zenoss/snmp/InterfaceCatOsMap.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Empty file.
Oops, something went wrong.