Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Opengear Console Servers 1.0
Browse files Browse the repository at this point in the history
git-svn-id: http://zenpacks.zenoss.org/svn/zenpacks@788 db08cffe-75b9-45d1-af1a-46ad9ef135f6
  • Loading branch information
Matt Ray committed Jul 3, 2010
1 parent c40fda7 commit 0d5f8ec
Show file tree
Hide file tree
Showing 62 changed files with 4,563 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ZenPacks.Opengear.ConsoleServer/COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
All files in this directory and below are:

Copyright (c) 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 change: 1 addition & 0 deletions ZenPacks.Opengear.ConsoleServer/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft ZenPacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
###############################################################################
#
# ActiveUser object class
#
###############################################################################

__doc__ = """ ActiveUser
ActiveUser is a component of a SerialConsoleDevice
$id: $"""

__version__ = "$Revision: 1.1 $"[11:-2]

from Globals import InitializeClass
# from AccessControl import ClassSecurityInfo

from Products.ZenRelations.RelSchema import *
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenUtils.Utils import convToUnits

from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS

_kw = dict(mode='w')

class ActiveUser(DeviceComponent, ManagedEntity):
""" Serial console on an Opengear device
"""

portal_type = meta_type = 'ActiveUser'

ogSerialPortActiveUsersIndex = -1
ogSerialPortActiveUsersPort = 0
ogSerialPortActiveUsersName = ""
snmpindex = -1

_properties = (
dict(id = 'ogSerialPortActiveUsersIndex', type = 'int', **_kw),
dict(id = 'ogSerialPortActiveUsersPort', type = 'int', **_kw),
dict(id = 'ogSerialPortActiveUsersName', type = 'string', **_kw),
)

_relations = (
('SerialConsoleDev',
ToOne(ToManyCont,
'ZenPacks.Opengear.ConsoleServer.SerialConsoleDevice',
'ActiveUsr')),
)

# Screen action bindings (and tab definitions)
factory_type_information = ({
'id' : 'ActiveUser',
'meta_type' : 'ActiveUser',
'description' : 'Opengear Active User info',
'icon' : 'Device_icon.gif',
'product' : 'ConsoleServer',
'factory' : 'manage_addActiveUser',
'immediate_view' : 'activeUserPerformance',
'actions' : ({
'id' : 'perf',
'name' : 'perf',
'action' : 'activeUserPerformance',
'permissions' : (ZEN_VIEW, )
}, {
'id' : 'templates',
'name' : 'Templates',
'action' : 'objTemplates',
'permissions' : (ZEN_CHANGE_SETTINGS, )
},)
},)

def device(self):
return self.SerialConsoleDev()

def managedDeviceLink(self):
#from Products.ZenModel.ZenModelRM import ZenModelRM
#d = self.getDmdRoot("Devices").findDevice(self.serverAlias)
#if d:
# return ZenModelRM.urlLink(d, 'link')
return None

def snmpIgnore(self):
return ManagedEntity.snmpIgnore(self) or self.snmpindex < 0

InitializeClass(ActiveUser)
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
###############################################################################
#
# Emd object class
#
###############################################################################

__doc__ = """ Emd
Emd is a component of a SerialConsoleDevice
$id: $"""

__version__ = "$Revision: 1.1 $"[11:-2]

from Globals import InitializeClass
# from AccessControl import ClassSecurityInfo

from Products.ZenRelations.RelSchema import *
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenUtils.Utils import convToUnits

from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS

_kw = dict(mode='w')

class Emd(DeviceComponent, ManagedEntity):
""" Serial console on an Opengear device
"""

portal_type = meta_type = 'Emd'

emdName = ""
emdDescription = ""
emdConnected = ""
emdLogStatus = False
emdEnabled = False
snmpindex = -1

_properties = (
dict(id = 'emdName', type = 'string', **_kw),
dict(id = 'emdDescription', type = 'string', **_kw),
dict(id = 'emdConnected', type = 'string', **_kw),
dict(id = 'emdLogStatus', type = 'boolean', **_kw),
dict(id = 'emdEnabled', type = 'boolean', **_kw),
)

_relations = (
('SerialConsoleDev',
ToOne(ToManyCont,
'ZenPacks.Opengear.ConsoleServer.SerialConsoleDevice',
'EmdCfg')),
)

# Screen action bindings (and tab definitions)
factory_type_information = ({
'id' : 'Emd',
'meta_type' : 'Emd',
'description' : 'Opengear EMD info',
'icon' : 'Device_icon.gif',
'product' : 'ConsoleServer',
'factory' : 'manage_addEmd',
'immediate_view' : 'emdPerformance',
'actions' : ({
'id' : 'perf',
'name' : 'perf',
'action' : 'emdPerformance',
'permissions' : (ZEN_VIEW, )
}, {
'id' : 'templates',
'name' : 'Templates',
'action' : 'objTemplates',
'permissions' : (ZEN_CHANGE_SETTINGS, )
},)
},)

def device(self):
return self.SerialConsoleDev()

def managedDeviceLink(self):
from Products.ZenModel.ZenModelRM import ZenModelRM
d = self.getDmdRoot("Devices").findDevice(self.emdName)
if d:
return ZenModelRM.urlLink(d, 'link')
return None

def getPerformanceLink(self):
from Products.ZenModel.ZenModelRM import ZenModelRM
d = self.getDmdRoot("Devices").findDevice(self.emdName)
if d:
return ZenModelRM.urlLink(d, 'link')
return None

def snmpIgnore(self):
return ManagedEntity.snmpIgnore(self) or self.snmpindex < 0

InitializeClass(Emd)
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
###############################################################################
#
# EmdStatus object class
#
###############################################################################

__doc__ = """ EmdStatus
EmdStatus is a component of a SerialConsoleDevice
$id: $"""

__version__ = "$Revision: 1.1 $"[11:-2]

from Globals import InitializeClass
# from AccessControl import ClassSecurityInfo

from Products.ZenRelations.RelSchema import *
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenUtils.Utils import convToUnits

from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS

_kw = dict(mode='w')

class EmdStatus(DeviceComponent, ManagedEntity):
""" Serial console on an Opengear device
"""

portal_type = meta_type = 'EmdStatus'

ogEmdStatusIndex = -1
ogEmdStatusName = ""
ogEmdStatusTemp = 0
ogEmdStatusHumidity = 0
ogEmdStatusAlertCount = 0
snmpindex = -1

_properties = (
dict(id = 'ogEmdStatusIndex', type = 'int', **_kw),
dict(id = 'ogEmdStatusName', type = 'string', **_kw),
dict(id = 'ogEmdStatusTemp', type = 'int', **_kw),
dict(id = 'ogEmdStatusHumidity', type = 'int', **_kw),
dict(id = 'ogEmdStatusAlertCount', type = 'int', **_kw),
)

_relations = (
('SerialConsoleDev',
ToOne(ToManyCont,
'ZenPacks.Opengear.ConsoleServer.SerialConsoleDevice',
'EmdStat')),
)

# Screen action bindings (and tab definitions)
factory_type_information = ({
'id' : 'EmdStatus',
'meta_type' : 'EmdStatus',
'description' : 'Opengear EMD info',
'icon' : 'Device_icon.gif',
'product' : 'ConsoleServer',
'factory' : 'manage_addEmdStatus',
'immediate_view' : 'emdStatusPerformance',
'actions' : ({
'id' : 'perf',
'name' : 'perf',
'action' : 'emdStatusPerformance',
'permissions' : (ZEN_VIEW, )
}, {
'id' : 'templates',
'name' : 'Templates',
'action' : 'objTemplates',
'permissions' : (ZEN_CHANGE_SETTINGS, )
},)
},)

def device(self):
return self.SerialConsoleDev()

def managedDeviceLink(self):
#from Products.ZenModel.ZenModelRM import ZenModelRM
#d = self.getDmdRoot("Devices").findDevice(self.serverAlias)
#if d:
# return ZenModelRM.urlLink(d, 'link')
return None

def snmpIgnore(self):
return ManagedEntity.snmpIgnore(self) or self.snmpindex < 0

InitializeClass(EmdStatus)
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
###############################################################################
#
# EnvironmentAlert object class
#
###############################################################################

__doc__ = """ EnvironmentAlert
EnvironmentAlert is a component of a SerialConsoleDevice
$id: $"""

__version__ = "$Revision: 1.1 $"[11:-2]

from Globals import InitializeClass
# from AccessControl import ClassSecurityInfo

from Products.ZenRelations.RelSchema import *
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenUtils.Utils import convToUnits

from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS

_kw = dict(mode='w')

class EnvironmentAlert(DeviceComponent, ManagedEntity):
""" Serial console on an Opengear device
"""

portal_type = meta_type = 'EnvironmentAlert'

ogEnvAlertStatusIndex = -1
ogEnvAlertStatusDevice = ""
ogEnvAlertStatusSensor = ""
ogEnvAlertStatusOutlet = -1
ogEnvAlertStatusValue = -1
ogEnvAlertStatusOldValue = -1
ogEnvAlertStatusStatus = 0
snmpindex = -1

_properties = (
dict(id = 'ogEnvAlertStatusIndex', type = 'int', **_kw),
dict(id = 'ogEnvAlertStatusDevice', type = 'string', **_kw),
dict(id = 'ogEnvAlertStatusSensor', type = 'string', **_kw),
dict(id = 'ogEnvAlertStatusOutlet', type = 'int', **_kw),
dict(id = 'ogEnvAlertStatusValue', type = 'int', **_kw),
dict(id = 'ogEnvAlertStatusOldValue', type = 'int', **_kw),
dict(id = 'ogEnvAlertStatusStatus', type = 'int', **_kw),
)

_relations = (
('SerialConsoleDev',
ToOne(ToManyCont,
'ZenPacks.Opengear.ConsoleServer.SerialConsoleDevice',
'EnvironmentAlrt')),
)

# Screen action bindings (and tab definitions)
factory_type_information = ({
'id' : 'EnvironmentAlert',
'meta_type' : 'EnvironmentAlert',
'description' : 'Opengear EMD Alert info',
'icon' : 'Device_icon.gif',
'product' : 'ConsoleServer',
'factory' : 'manage_addEnvironmentAlert',
'immediate_view' : 'environmentAlertPerformance',
'actions' : ({
'id' : 'perf',
'name' : 'perf',
'action' : 'environmentAlertPerformance',
'permissions' : (ZEN_VIEW, )
}, {
'id' : 'templates',
'name' : 'Templates',
'action' : 'objTemplates',
'permissions' : (ZEN_CHANGE_SETTINGS, )
},)
},)

def device(self):
return self.SerialConsoleDev()

def managedDeviceLink(self):
#from Products.ZenModel.ZenModelRM import ZenModelRM
#d = self.getDmdRoot("Devices").findDevice(self.serverAlias)
#if d:
# return ZenModelRM.urlLink(d, 'link')
return None

def snmpIgnore(self):
return ManagedEntity.snmpIgnore(self) or self.snmpindex < 0

InitializeClass(EnvironmentAlert)
Loading

0 comments on commit 0d5f8ec

Please sign in to comment.