#
# entityProps.py -- Entity property listings
#
# Doug White
#
# This and the entityHeaders module should be merged with the entity code
# itself instead of maintaining this metadata externally.
# How this works:
# If a entity has a key in this dictionary, it will list the properties
# that affect that entity's operation. If there is no key, the DEFAULT
# key has the standard two entity properties (status, triggers).
#
# Inside of the entity key is a dictionary of properties. The associated
# values have the following characteristics:
#
# . List: Set of valid values for the key ('on', 'off')
# . Dictionary: Property accepts a table of entries; if the dictionary
# is populated then those are the valid values. An empty dictionary
# indicates there is no defined properties in that subtable.
# . Empty string: Accepts arbitrary text value
#
# Optional items must be listed in the magic key 'optional'.
#
# The magic key 'subents' means the Entity has a subentity list, and the
# definitions in the key are the format for each subentity entry.
#
# Implied properties:
# . The top-level Entity property list has 'type'
# . each subentity has 'name'
#
# Problems:
# . optional properties like 'notify'
# . Handling things with implied units (like triggers)
# . Boolean keys (present=active), a deriviative case of optional props
properties = {
'DEFAULT' : {
'status': ['on', 'off'],
'triggers': {'level':['critical','warn','info'],
'trigger':'',
}
},
'Cpu' : {
'status': ['on', 'off'],
'triggers': {'level':['critical','warn','info'],
'trigger':'',
}
},
'Mem' : {
'status': ['on', 'off'],
'triggers': {'level':['critical','warn','info'],
'trigger':'',
}
},
'Disk' : {
'status': ['on', 'off'],
'triggers': {'level':['critical','warn','info'],
'trigger':'',
}
},
'Command' : {
'subents': {'name':'',
'status':['on', 'off'],
'badMesg':'',
'command':'',
'goodMesg':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'DirQue' : {
'status': ['on', 'off'],
'subents': {'name':'',
'status':['on', 'off'],
'dir':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'DNS' : {
'subents': {'name':'',
'optional':['seconds'],
'status':['on', 'off'],
'dnsName':'',
'ipAddress':'',
'seconds':'', # optional
'Server':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'OraTbSpc' : {
'status': ['on', 'off'],
'OraHome':'',
'OraSID':'',
'OraUserPass':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
}
},
'Ping' : {
'subents':{'status':['on', 'off'],
'pingHost':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'Snmp' : {
'subents': {'name':'',
'status':['on', 'off'],
'community':'',
'host':'',
'oid':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'Tcp' : {
'subents':{'name':'',
'optional': ['goodPhrase','tcpHelo',],
'status':['on', 'off'],
'goodPhrase':'', # optional
'tcpHelo':'', #optional
'tcpHost':'',
'tcpPort':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'Transaction' : {
'subents':{'optional': ['goodPhrase','tcpHelo',],
'name':'',
'status':['on', 'off'],
'startUrl':'',
'steps': { 'action':'',
'fields':'', # magic!
'goodPhrase':'',
'method':['get','post'],
},
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'Web' : {
'subents':{'optional': ['auth','cookie','errorPhrase','goodPhrase','noHostPing','webPort',],
'name':'',
'status':['on', 'off'],
'auth':'', # optional
'cookie':'', # optional
'errorPhrase':'', # optional
'goodPhrase':'', # optional
'noHostPing':'', # boolean
'webHost':'',
'webPort':'', # optional
'webUrl':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
'WebSsl' : {
'subents':{'optional': ['auth','cookie','errorPhrase','goodPhrase','noHostPing','sslCertFile','sslKeyFile','webPort',],
'name':'',
'status':['on', 'off'],
'auth':'', # optional
'cookie':'', # optional
'errorPhrase':'', # optional
'goodPhrase':'', # optional
'noHostPing':'', # boolean
'sslCertFile':'', # optional
'sslKeyFile':'', # optional
'webHost':'',
'webPort':'', # optional
'webUrl':'',
'triggers': {'level':['critical','warn','info'],
'trigger':'',
},
},
},
# end of file
}