Package Products :: Package ZenModel :: Module Device :: Class Device
[hide private]
[frames] | no frames]

Class Device

source code

                  ManagedEntity.ManagedEntity --+
                                                |
                      Commandable.Commandable --+
                                                |
                                   object --+   |
                                            |   |
                            Lockable.Lockable --+
                                                |
  MaintenanceWindowable.MaintenanceWindowable --+
                                                |
AdministrativeRoleable.AdministrativeRoleable --+
                                                |
                      ZenMenuable.ZenMenuable --+
                                                |
                                               Device
Known Subclasses:

Device is a base class that represents the idea of a single computer system that is made up of software running on hardware. It currently must be IP enabled but maybe this will change.

Instance Methods [hide private]
 
__init__(self, id, buildRelations=True) source code
 
isTempDevice(self) source code
 
name(self)
Return the name of this device.
source code
 
changeDeviceClass(self, deviceClassPath, REQUEST=None)
Wrapper for DeviceClass.moveDevices.
source code
 
getRRDTemplate(self)
DEPRECATED
source code
list
>>> from Products.ZenModel.Device import manage_addDevice
>>> manage_addDevice(devices, 'test')
>>> devices.test.getRRDTemplates()
[<RRDTemplate at /zport/dmd/Devices/rrdTemplates/Device>]
getRRDTemplates(self)
Returns all the templates bound to this Device
source code
 
getRRDNames(self) source code
list
getDataSourceOptions(self)
Returns the available DataSource options.
source code
int
sysUpTime(self)
Returns the cached sysUpTime for this device
source code
string
availability(self, *args, **kw)
Returns the uptime of this device
source code
 
__getattr__(self, name)
Override from object to handle lastPollSnmpUpTime and snmpLastCollection
source code
 
_setPropValue(self, id, value)
Override from PropertyManager to handle checks and ip creation
source code
 
applyDataMap(self, datamap, relname="", compname="", modname="")
Apply a datamap passed as a list of dicts through XML-RPC.
source code
 
path(self)
Return a sequence of path tuples suitable for indexing by a MultiPathIndex.
source code
list
traceRoute(self, target, ippath=None)
Trace the route to target using our routing table.
source code
 
getMonitoredComponents(self, collector=None, type=None)
Return list of monitored DeviceComponents on this device.
source code
list
getReportableComponents(self, collector=None, type=None)
Return a list of DeviceComponents on this device that should be considered for reporting.
source code
list
getDeviceComponents(self, monitored=None, collector=None, type=None)
Return list of all DeviceComponents on this device.
source code
 
getDeviceComponentsNoIndexGen(self)
Return a list of all device components by walking relations.
source code
SnmpConnInfo object
getSnmpConnInfo(self)
Returns an object containing SNMP Connection Info
source code
string
getHWManufacturerName(self)
DEPRECATED - Return the hardware manufacturer name of this device.
source code
string
getHWProductName(self)
Return the hardware product name of this device.
source code
string
getHWProductClass(self)
Return the hardware product class of this device.
source code
string
getHWProductKey(self)
DEPRECATED - Return the productKey of the device hardware.
source code
string
getOSManufacturerName(self)
DEPRECATED - Return the OS manufacturer name of this device.
source code
string
getOSProductName(self)
DEPRECATED - Return the OS product name of this device.
source code
string
getOSProductKey(self)
DEPRECATED - Return the productKey of the device OS.
source code
 
setOSProductKey(self, prodKey, manufacturer=None)
Set the productKey of the device OS.
source code
string
getHWTag(self)
DEPRECATED - Return the tag of the device HW.
source code
 
setHWTag(self, assettag)
Set the asset tag of the device hardware.
source code
 
setHWProductKey(self, prodKey, manufacturer=None)
Set the productKey of the device hardware.
source code
 
setHWSerialNumber(self, number)
Set the hardware serial number.
source code
string
getHWSerialNumber(self)
DEPRECATED - Return the hardware serial number.
source code
 
followNextHopIps(self)
Return the ips that our indirect routs point to which aren't currently connected to devices.
source code
string
getLocationName(self)
Return the full location name ie /Location/SubLocation/Rack
source code
string
getLocationLink(self)
Return a link to the device's location.
source code
list
getSystemNames(self)
Return the system names for this device
source code
string
getSystemNamesString(self, sep=', ')
Return the system names for this device as a string
source code
list
getDeviceGroupNames(self)
Return the device group names for this device
source code
PerformanceMonitor
getPerformanceServer(self)
Return the device performance server
source code
string
getPerformanceServerName(self)
Return the device performance server name
source code
 
getNetworkRoot(self, version=None)
Return the network root object
source code
DateTime
getLastChange(self)
Return DateTime of last change detected on this device.
source code
string
getLastChangeString(self)
Return date string of last change detected on this device.
source code
DateTime
getSnmpLastCollection(self)
Return DateTime of last SNMP collection on this device.
source code
string
getSnmpLastCollectionString(self)
Return date string of last SNMP collection on this device.
source code
 
_sanitizeIPaddress(self, ip) source code
 
_isDuplicateIp(self, ip) source code
string
setManageIp(self, ip="", REQUEST=None)
Set the manage IP, if IP is not passed perform DNS lookup.
source code
string
getManageIp(self)
Return the management ip for this device.
source code
IpAddress
getManageIpObj(self)
DEPRECATED - Return the management ipobject for this device.
source code
IpInterface
getManageInterface(self)
Return the management interface of a device based on its manageIp.
source code
string
uptimeStr(self)
Return the SNMP uptime
source code
list
getPeerDeviceClassNames(self)
Build a list of all device paths that have the python class pyclass
source code
 
manage_snmpCommunity(self)
Reset the snmp community using the zSnmpCommunities variable.
source code
 
setProductInfo(self, hwManufacturer="", hwProductName="", osManufacturer="", osProductName="") source code
 
updateDevice(self, **kwargs)
Update the device relation and attributes, if passed.
source code
 
manage_editDevice(self, tag="", serialNumber="", zSnmpCommunity="", zSnmpPort=161, zSnmpVer="", rackSlot="", productionState=1000, comments="", hwManufacturer="", hwProductName="", osManufacturer="", osProductName="", locationPath="", groupPaths=[], systemPaths=[], performanceMonitor="localhost", priority=3, zProperties=None, title=None, REQUEST=None)
Edit the device relation and attributes.
source code
 
setTitle(self, newTitle)
Changes the title to newTitle and reindexes the object
source code
boolean
monitorDevice(self)
Returns true if the device production state >= zProdStateThreshold.
source code
boolean
snmpMonitorDevice(self)
Returns true if the device is subject to SNMP monitoring
source code
int
getPriority(self)
Return the numeric device priority.
source code
string
getPriorityString(self)
Return the device priority as a string.
source code
string
getPingStatusString(self)
Return the pingStatus as a string
source code
string
getSnmpStatusString(self)
Return the snmpStatus as a string
source code
 
setProdState(self, state, maintWindowChange=False, REQUEST=None)
Set the device's production state.
source code
 
setPriority(self, priority, REQUEST=None)
Set the device's priority
source code
 
setLastChange(self, value=None)
Set the changed datetime for this device.
source code
 
setSnmpLastCollection(self, value=None)
Set the last time snmp collection occurred.
source code
 
addManufacturer(self, newHWManufacturerName=None, newSWManufacturerName=None, REQUEST=None)
DEPRECATED - Add either a hardware or software manufacturer to the database.
source code
 
setHWProduct(self, newHWProductName=None, hwManufacturer=None, REQUEST=None)
DEPRECATED - Adds a new hardware product
source code
 
setOSProduct(self, newOSProductName=None, osManufacturer=None, REQUEST=None)
DEPRECATED Adds a new os product
source code
 
setLocation(self, locationPath, REQUEST=None)
Set the location of a device.
source code
 
addLocation(self, newLocationPath, REQUEST=None)
DEPRECATED Add a new location and relate it to this device
source code
 
setPerformanceMonitor(self, performanceMonitor, newPerformanceMonitor=None, REQUEST=None)
Set the performance monitor for this device.
source code
 
setGroups(self, groupPaths)
Set the list of groups for this device based on a list of paths
source code
 
addDeviceGroup(self, newDeviceGroupPath, REQUEST=None)
DEPRECATED? Add a device group to the database and this device
source code
 
setSystems(self, systemPaths)
Set a list of systems to this device using their system paths
source code
 
addSystem(self, newSystemPath, REQUEST=None)
DEPRECATED? Add a systems to this device using its system path
source code
 
setTerminalServer(self, termservername)
Set the terminal server of this device
source code
 
_setRelations(self, relName, objGetter, relPaths)
Set related objects to this device
source code
HTML output
getExpandedLinks(self)
Return the expanded zComment property
source code
 
device(self)
Support DeviceResultInt mixin class.
source code
boolean
pastSnmpMaxFailures(self)
Returns true if the device has more SNMP failures than maxFailures on its status mon.
source code
 
getLastPollSnmpUpTime(self)
Get the value of the snmpUpTime status object
source code
 
setLastPollSnmpUpTime(self, value)
Set the value of the snmpUpTime status object
source code
 
snmpAgeCheck(self, hours)
Returns True if SNMP data was collected more than 24 hours ago
source code
 
applyProductContext(self)
Apply zProperties inherited from Product Contexts.
source code
 
_applyProdContext(self, context)
Apply zProperties taken for the product context passed in.
source code
 
collectDevice(self, setlog=True, REQUEST=None, generateEvents=False, background=False, write=None)
Collect the configuration of this device AKA Model Device
source code
 
deleteDevice(self, deleteStatus=False, deleteHistory=False, deletePerf=False, REQUEST=None)
Delete device from the database
source code
 
renameDevice(self, newId=None, REQUEST=None)
Rename device from the DMD.
source code
 
renameDeviceInPerformance(self, old, new)
Rename the directory that holds performance data for this device.
source code
 
index_object(self, idxs=None, noips=False)
Override so ips get indexed on move.
source code
 
unindex_object(self)
Override so ips get unindexed as well.
source code
 
unindex_ips(self)
IpAddresses aren't contained underneath Device, so manage_beforeDelete won't propagate.
source code
 
cacheComponents(self)
Read current RRD values for all of a device's components
source code
 
getUserCommandTargets(self)
Called by Commandable.doCommand() to ascertain objects on which a UserCommand should be executed.
source code
 
getUserCommandEnvironment(self)
Returns the tales environment used to evaluate the command
source code
 
getUrlForUserCommands(self)
Returns a URL to redirect to after a command has executed used by Commandable
source code
 
getHTMLEventSummary(self, severity=4)
Returns HTML Event Summary of a device
source code
 
getDataForJSON(self, minSeverity=0)
Returns data ready for serialization
source code
 
exportXmlHook(self, ofile, ignorerels)
Add export of our child objects.
source code
 
zenPropertyOptions(self, propname)
Returns a list of possible options for a given zProperty
source code
 
pushConfig(self, REQUEST=None)
This will result in a push of all the devices to live collectors
source code
 
bindTemplates(self, ids=(), REQUEST=None)
This will bind available templates to the zDeviceTemplates
source code
 
removeZDeviceTemplates(self, REQUEST=None)
Deletes the local zProperty, zDeviceTemplates
source code
 
addLocalTemplate(self, id, REQUEST=None)
Create a local template on a device
source code
 
getAvailableTemplates(self)
Returns all available templates for this device
source code
 
getLinks(self, OSI_layer='3')
Returns all Links on this Device's interfaces
source code
 
getXMLEdges(self, depth=3, filter="/", start=())
Gets XML
source code
HTML text
getPrettyLink(self, target=None, altHref="")
Gets a link to this device, plus an icon
source code
 
getOSProcessMatchers(self)
Get a list of dictionaries containing everything needed to match processes against the global list of process classes.
source code
 
manageIpVersion(self)
Returns either 4 or 6 depending on the version of the manageIp ip adddress
source code
string
snmpwalkPrefix(self)
This method gets the ip address prefix used for this device when running snmpwalk.
source code
string @return "ping" or "ping6" depending on if the manageIp is ipv6 or not
pingCommand(self)
Used by the user commands this returns which ping command this device should use.
source code
string @return "traceroute" or "traceroute6" depending on if the manageIp is ipv6 or not
tracerouteCommand(self)
Used by the user commands this returns which traceroute command this device should use.
source code
 
updateProcesses(self, relmaps)
Uses ProcessClasses to create processes to monitor
source code
 
getStatus(self, statusclass=None, **kwargs)
Return the status number for this device of class statClass.
source code
 
details(self) source code
 
allowedRolesAndUsers(self) source code
 
ipAddressAsInt(self) source code

Inherited from Commandable.Commandable: compile, doCommandForTarget, getAqChainForUserCommands, getUserCommand, getUserCommandIds, getUserCommands, manage_addUserCommand, manage_deleteUserCommand, manage_doUserCommand, manage_editUserCommand, redirectToUserCommands, write

Inherited from Lockable.Lockable: getNextLockableParent, isLockedFromDeletion, isLockedFromUpdates, isUnlocked, lockFromDeletion, lockFromUpdates, lockStatus, lockWarning, sendEventWhenBlocked, setSendEventWhenBlockedFlag, unlock, unsetSendEventWhenBlockedFlag

Inherited from MaintenanceWindowable.MaintenanceWindowable: getMaintenanceWindows, manage_addMaintenanceWindow, manage_deleteMaintenanceWindow

Inherited from AdministrativeRoleable.AdministrativeRoleable: getAdministrativeRoles, manage_addAdministrativeRole, manage_deleteAdministrativeRole, manage_editAdministrativeRoles, manage_listAdministrativeRoles, setAdminLocalRoles

Inherited from ZenMenuable.ZenMenuable: buildMenus, getMenus, manage_addItemsToZenMenu, manage_addZenMenu, manage_addZenMenuItem, manage_deleteZenMenu, manage_deleteZenMenuItem, manage_saveMenuItemOrdering

Class Variables [hide private]
  meta_type = 'Device'
  portal_type = 'Device'
  event_key = 'Device'
  default_catalog = "deviceSearch"
  relationshipManagerPathRestriction = '/Devices'
  manageIp = ""
  productionState = 1000
  preMWProductionState = 1000
  snmpAgent = ""
  snmpDescr = ""
  snmpOid = ""
  snmpContact = ""
  snmpSysName = ""
  snmpLocation = ""
  rackSlot = ""
  comments = ""
  sysedgeLicenseMode = ""
  priority = 3
  detailKeys = 'tagNumber', 'serialNumber', 'hwModel', 'hwManufa...
  _temp_device = False
  _properties = ManagedEntity._properties+({'id': 'manageIp', 't...
  _relations = ManagedEntity._relations+(("deviceClass", ToOne(T...
  factory_type_information = {'id': 'Device', 'meta_type': 'Devi...
  security = ClassSecurityInfo()

Inherited from Commandable.Commandable: defaultTimeout

Inherited from Lockable.Lockable: modelerLock, sendEventWhenBlockedFlag

Method Details [hide private]

__init__(self, id, buildRelations=True)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

name(self)

source code 

Return the name of this device. Default is titleOrId.

changeDeviceClass(self, deviceClassPath, REQUEST=None)

source code 

Wrapper for DeviceClass.moveDevices. The primary reason to use this method instead of that one is that this one returns the new path to the device.

Parameters:
  • deviceClassPath (string) - device class in DMD path
  • REQUEST (Zope REQUEST object) - Zope REQUEST object

getDataSourceOptions(self)

source code 

Returns the available DataSource options. DataSource options are used to populate the dropdown when adding a new DataSource and is a string. See RRDTemplate.RRDTemplate.getDataSourceOptions for more information.

Returns: list
[(displayName, dsOption),]

availability(self, *args, **kw)

source code 

Returns the uptime of this device

Returns: string

To Do: Performance enhancement: Should move import outside of method

__getattr__(self, name)
(Qualification operator)

source code 

Override from object to handle lastPollSnmpUpTime and snmpLastCollection

To Do: Not sure this is needed, see getLastPollSnmpUpTime and getSnmpLastCollection

_setPropValue(self, id, value)

source code 

Override from PropertyManager to handle checks and ip creation

To Do: Not sure this is needed, see setSnmpLastCollection

traceRoute(self, target, ippath=None)

source code 

Trace the route to target using our routing table. Wrapper method of OperatingSystem.traceRoute

Parameters:
  • target (string) - Device name
  • ippath (list) - IP addesses
Returns: list
IP Addresses

getMonitoredComponents(self, collector=None, type=None)

source code 

Return list of monitored DeviceComponents on this device. Wrapper method for getDeviceComponents

getReportableComponents(self, collector=None, type=None)

source code 

Return a list of DeviceComponents on this device that should be considered for reporting.

Parameters:
  • type (string)
  • collector (string)
Returns: list

Permission: ZEN_VIEW

getDeviceComponents(self, monitored=None, collector=None, type=None)

source code 

Return list of all DeviceComponents on this device.

Parameters:
  • collector (string)
  • monitored (boolean)
  • type (string)
Returns: list

Permission: ZEN_VIEW

getDeviceComponentsNoIndexGen(self)

source code 

Return a list of all device components by walking relations. This is much slower then the normal getDeviceComponents method which uses the component index. It is used when rebuilding the device indexes.

getHWManufacturerName(self)

source code 

DEPRECATED - Return the hardware manufacturer name of this device.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

getHWProductKey(self)

source code 

DEPRECATED - Return the productKey of the device hardware.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

getOSManufacturerName(self)

source code 

DEPRECATED - Return the OS manufacturer name of this device.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

getOSProductName(self)

source code 

DEPRECATED - Return the OS product name of this device.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

getOSProductKey(self)

source code 

DEPRECATED - Return the productKey of the device OS.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

getHWTag(self)

source code 

DEPRECATED - Return the tag of the device HW.

Returns: string

To Do: remove this method and remove the call from testDevice.py

getHWSerialNumber(self)

source code 

DEPRECATED - Return the hardware serial number.

Returns: string

To Do: Remove this method and remove the call from testDevice.py

followNextHopIps(self)

source code 

Return the ips that our indirect routs point to which aren't currently connected to devices.

To Do: Can be moved to zendisc.py

getLocationName(self)

source code 

Return the full location name ie /Location/SubLocation/Rack

Returns: string

Permission: ZEN_VIEW

getLocationLink(self)

source code 

Return a link to the device's location.

Returns: string

Permission: ZEN_VIEW

getSystemNames(self)

source code 

Return the system names for this device

Returns: list

Permission: ZEN_VIEW

getSystemNamesString(self, sep=', ')

source code 

Return the system names for this device as a string

Returns: string

Permission: ZEN_VIEW

getDeviceGroupNames(self)

source code 

Return the device group names for this device

Returns: list

Permission: ZEN_VIEW

getPerformanceServer(self)

source code 

Return the device performance server

Returns: PerformanceMonitor

Permission: ZEN_VIEW

getPerformanceServerName(self)

source code 

Return the device performance server name

Returns: string

Permission: ZEN_VIEW

getLastChange(self)

source code 

Return DateTime of last change detected on this device.

Returns: DateTime

Permission: ZEN_VIEW

getLastChangeString(self)

source code 

Return date string of last change detected on this device.

Returns: string

Permission: ZEN_VIEW

getSnmpLastCollection(self)

source code 

Return DateTime of last SNMP collection on this device.

Returns: DateTime

Permission: ZEN_VIEW

getSnmpLastCollectionString(self)

source code 

Return date string of last SNMP collection on this device.

Returns: string

Permission: ZEN_VIEW

setManageIp(self, ip="", REQUEST=None)

source code 

Set the manage IP, if IP is not passed perform DNS lookup. If there is an error with the IP address format, the IP address will be reset to the result of a DNS lookup.

Returns: string

Permission: ZEN_ADMIN_DEVICE

getManageIp(self)

source code 

Return the management ip for this device.

Returns: string

Permission: ZEN_VIEW

getManageIpObj(self)

source code 

DEPRECATED - Return the management ipobject for this device.

Returns: IpAddress

To Do: This method may not be called anywhere, remove it.

getManageInterface(self)

source code 

Return the management interface of a device based on its manageIp.

Returns: IpInterface

Permission: ZEN_VIEW

uptimeStr(self)

source code 

Return the SNMP uptime

Returns: string

Permission: ZEN_VIEW

manage_snmpCommunity(self)

source code 

Reset the snmp community using the zSnmpCommunities variable.

Permission: ZEN_CHANGE_DEVICE

updateDevice(self, **kwargs)

source code 

Update the device relation and attributes, if passed. If any parameter
is not passed it will not be updated; the value of any unpassed device
propeties will remain the same.

@permission: ZEN_CHANGE_DEVICE
Keyword arguments:
  title              -- device title [string]
  tag                -- tag number [string]
  serialNumber       -- serial number [string]
  zProperties        -- dict of zProperties [dict]
  zSnmpCommunity     -- snmp community (overrides corresponding value is zProperties) [string]
  zSnmpPort          -- snmp port (overrides corresponding value in zProperties) [string]
  zSnmpVer           -- snmp version (overrides corresponding value in zProperties) [string]
  rackSlot           -- rack slot number [integer]
  productionState    -- production state of device [integer]
  priority           -- device priority [integer]
  comment            -- device comment [string]
  hwManufacturer     -- hardware manufacturer [string]
  hwProductName      -- hardware product name [string]
  osManufacturer     -- operating system manufacturer [string]
  osProductName      -- operating system name [string]
  locationPath       -- location [string]
  groupPaths         -- group paths [list]
  systemPaths        -- systen paths [list]
  performanceMonitor -- collector name [string]

manage_editDevice(self, tag="", serialNumber="", zSnmpCommunity="", zSnmpPort=161, zSnmpVer="", rackSlot="", productionState=1000, comments="", hwManufacturer="", hwProductName="", osManufacturer="", osProductName="", locationPath="", groupPaths=[], systemPaths=[], performanceMonitor="localhost", priority=3, zProperties=None, title=None, REQUEST=None)

source code 

Edit the device relation and attributes. This method will update device properties because of the default values that are passed. Calling this method using a **kwargs dict will result in default values being set for many device properties. To update only a subset of these properties use updateDevice(**kwargs).

Parameters:
  • locationPath (string) - path to a Location
  • groupPaths (list) - paths to DeviceGroups
  • systemPaths (list) - paths to Systems
  • performanceMonitor (string) - name of PerformanceMonitor

Permission: ZEN_CHANGE_DEVICE

setProdState(self, state, maintWindowChange=False, REQUEST=None)

source code 

Set the device's production state.

Parameters:
  • state (int) - new production state
  • maintWindowChange (boolean) - are we resetting state from inside a MW?

Permission: ZEN_CHANGE_DEVICE

setPriority(self, priority, REQUEST=None)

source code 

Set the device's priority

Parameters:
  • priority (int)

Permission: ZEN_CHANGE_DEVICE

setLastChange(self, value=None)

source code 

Set the changed datetime for this device.

Parameters:
  • value (float) - secs since the epoch, default is now

Permission: ZEN_CHANGE_DEVICE

setSnmpLastCollection(self, value=None)

source code 

Set the last time snmp collection occurred.

Parameters:
  • value (float) - secs since the epoch, default is now

Permission: ZEN_CHANGE_DEVICE

addManufacturer(self, newHWManufacturerName=None, newSWManufacturerName=None, REQUEST=None)

source code 

DEPRECATED - Add either a hardware or software manufacturer to the database.

Permission: ZEN_CHANGE_DEVICE

To Do: Doesn't really do work on a device object. Already exists on ZDeviceLoader

setHWProduct(self, newHWProductName=None, hwManufacturer=None, REQUEST=None)

source code 

DEPRECATED - Adds a new hardware product

Permission: ZEN_CHANGE_DEVICE

To Do: Doesn't really do work on a device object. Already exists on ZDeviceLoader

setOSProduct(self, newOSProductName=None, osManufacturer=None, REQUEST=None)

source code 

DEPRECATED Adds a new os product

Permission: ZEN_CHANGE_DEVICE

To Do: Doesn't really do work on a device object. Already exists on ZDeviceLoader

setLocation(self, locationPath, REQUEST=None)

source code 

Set the location of a device. If the location is new it will be created.

Permission: ZEN_CHANGE_DEVICE

addLocation(self, newLocationPath, REQUEST=None)

source code 

DEPRECATED Add a new location and relate it to this device

To Do: Doesn't really do work on a device object. Already exists on ZDeviceLoader

setPerformanceMonitor(self, performanceMonitor, newPerformanceMonitor=None, REQUEST=None)

source code 

Set the performance monitor for this device. If newPerformanceMonitor is passed in create it

Permission: ZEN_CHANGE_DEVICE

setGroups(self, groupPaths)

source code 

Set the list of groups for this device based on a list of paths

Permission: ZEN_CHANGE_DEVICE

addDeviceGroup(self, newDeviceGroupPath, REQUEST=None)

source code 

DEPRECATED? Add a device group to the database and this device

Permission: ZEN_CHANGE_DEVICE

To Do: Already exists on ZDeviceLoader

setSystems(self, systemPaths)

source code 

Set a list of systems to this device using their system paths

Permission: ZEN_CHANGE_DEVICE

addSystem(self, newSystemPath, REQUEST=None)

source code 

DEPRECATED? Add a systems to this device using its system path

Permission: ZEN_CHANGE_DEVICE

To Do: Already exists on ZDeviceLoader

setTerminalServer(self, termservername)

source code 

Set the terminal server of this device

Parameters:
  • termservername - device name of terminal server

Permission: ZEN_CHANGE_DEVICE

_setRelations(self, relName, objGetter, relPaths)

source code 

Set related objects to this device

Parameters:
  • relName - name of the relation to set
  • objGetter - method to get the relation
  • relPaths - list of relationship paths

device(self)

source code 

Support DeviceResultInt mixin class. Returns itself

Permission: ZEN_VIEW

getLastPollSnmpUpTime(self)

source code 

Get the value of the snmpUpTime status object

Permission: ZEN_MANAGE_DEVICE_STATUS

setLastPollSnmpUpTime(self, value)

source code 

Set the value of the snmpUpTime status object

Permission: ZEN_MANAGE_DEVICE_STATUS

_applyProdContext(self, context)

source code 

Apply zProperties taken for the product context passed in.

Parameters:
  • context - list of tuples returned from getProductContext on a MEProduct.

collectDevice(self, setlog=True, REQUEST=None, generateEvents=False, background=False, write=None)

source code 

Collect the configuration of this device AKA Model Device

Parameters:
  • setlog - If true, set up the output log of this process

Permission: ZEN_MANAGE_DEVICE

To Do: generateEvents param is not being used.

deleteDevice(self, deleteStatus=False, deleteHistory=False, deletePerf=False, REQUEST=None)

source code 

Delete device from the database

NB: deleteHistory is disabled for the 2.2 release. In some circumstances it was causing many subprocesses to be spawned and creating a gridlock situation.

NOTE: deleteStatus no longer deletes events from the summary table, but closes them.

Permission: ZEN_ADMIN_DEVICE

renameDevice(self, newId=None, REQUEST=None)

source code 

Rename device from the DMD. Disallow assignment of an id that already exists in the system.

Parameters:
  • newId (string) - new name
  • REQUEST (Zope REQUEST object) - Zope REQUEST object

Permission: ZEN_ADMIN_DEVICE

renameDeviceInPerformance(self, old, new)

source code 

Rename the directory that holds performance data for this device.

Parameters:
  • old (string) - old performance directory name
  • new (string) - new performance directory name

unindex_ips(self)

source code 

IpAddresses aren't contained underneath Device, so manage_beforeDelete won't propagate. Thus we must remove those links explicitly.

getUserCommandTargets(self)

source code 

Called by Commandable.doCommand() to ascertain objects on which a UserCommand should be executed.

Overrides: Commandable.Commandable.getUserCommandTargets

getUserCommandEnvironment(self)

source code 

Returns the tales environment used to evaluate the command

Overrides: Commandable.Commandable.getUserCommandEnvironment

getUrlForUserCommands(self)

source code 

Returns a URL to redirect to after a command has executed used by Commandable

Overrides: Commandable.Commandable.getUrlForUserCommands

pushConfig(self, REQUEST=None)

source code 

This will result in a push of all the devices to live collectors

Permission: ZEN_MANAGE_DEVICE

bindTemplates(self, ids=(), REQUEST=None)

source code 

This will bind available templates to the zDeviceTemplates

Permission: ZEN_EDIT_LOCAL_TEMPLATES

removeZDeviceTemplates(self, REQUEST=None)

source code 

Deletes the local zProperty, zDeviceTemplates

Permission: ZEN_EDIT_LOCAL_TEMPLATES

addLocalTemplate(self, id, REQUEST=None)

source code 

Create a local template on a device

Permission: ZEN_EDIT_LOCAL_TEMPLATES

getLinks(self, OSI_layer='3')

source code 

Returns all Links on this Device's interfaces

Permission: ZEN_VIEW

getPrettyLink(self, target=None, altHref="")

source code 

Gets a link to this device, plus an icon

Returns: HTML text

Permission: ZEN_VIEW

getOSProcessMatchers(self)

source code 

Get a list of dictionaries containing everything needed to match processes against the global list of process classes. Used by process modeler plugins.

snmpwalkPrefix(self)

source code 

This method gets the ip address prefix used for this device when running snmpwalk.

Returns: string
Prefix used for snmwalk for this device

Class Variable Details [hide private]

detailKeys

Value:
'tagNumber', 'serialNumber', 'hwModel', 'hwManufacturer', 'osModel', '\
osManufacturer', 'groups', 'systems', 'location'

_properties

Value:
ManagedEntity._properties+({'id': 'manageIp', 'type': 'string', 'mode'\
: 'w'}, {'id': 'snmpAgent', 'type': 'string', 'mode': 'w'}, {'id': 'sn\
mpDescr', 'type': 'string', 'mode': ''}, {'id': 'snmpOid', 'type': 'st\
ring', 'mode': ''}, {'id': 'snmpContact', 'type': 'string', 'mode': ''\
}, {'id': 'snmpSysName', 'type': 'string', 'mode': ''}, {'id': 'snmpLo\
cation', 'type': 'string', 'mode': ''}, {'id': 'snmpLastCollection', '\
type': 'date', 'mode': ''}, {'id': 'snmpAgent', 'type': 'string', 'mod\
e': ''}, {'id': 'rackSlot', 'type': 'string', 'mode': 'w'}, {'id': 'co\
...

_relations

Value:
ManagedEntity._relations+(("deviceClass", ToOne(ToManyCont, "Products.\
ZenModel.DeviceClass", "devices")), ("perfServer", ToOne(ToMany, "Prod\
ucts.ZenModel.PerformanceConf", "devices")), ("location", ToOne(ToMany\
, "Products.ZenModel.Location", "devices")), ("systems", ToMany(ToMany\
, "Products.ZenModel.System", "devices")), ("groups", ToMany(ToMany, "\
Products.ZenModel.DeviceGroup", "devices")), ("maintenanceWindows", To\
ManyCont(ToOne, "Products.ZenModel.MaintenanceWindow", "productionStat\
e")), ("adminRoles", ToManyCont(ToOne, "Products.ZenModel.Administrati\
...

factory_type_information

Value:
{'id': 'Device', 'meta_type': 'Device', 'description': """Base class f\
or all devices""", 'icon': 'Device_icon.gif', 'product': 'ZenModel', '\
factory': 'manage_addDevice', 'immediate_view': 'devicedetail', 'actio\
ns':({'id': 'swdetail', 'name': 'Software', 'action': 'deviceSoftwareD\
etail', 'permissions':(ZEN_VIEW,)}, {'id': 'events', 'name': 'Events',\
 'action': 'viewEvents', 'permissions':(ZEN_VIEW,)}, {'id': 'perfServe\
r', 'name': 'Graphs', 'action': 'viewDevicePerformance', 'permissions'\
:(ZEN_VIEW,)}, {'id': 'edit', 'name': 'Edit', 'action': 'editDevice', \
...