com.adventnet.nms.poll
Class PollingObject
java.lang.Object
|
+--com.adventnet.nms.poll.PollingObject
- All Implemented Interfaces:
- java.io.Serializable
- public class PollingObject
- extends java.lang.Object
- implements java.io.Serializable
This object is for configuring a set of PolledDatas for ManagedObjects
based on match
criteria specified. In a Polling Object both match criteria and the
data collection details have to be given.
Whenever a ManagedObject is discovered , it is passed through every
Polling Object configured. If the ManagedObject satisfies all the match
criteria given for a Polling Object , then, polling for that ManagedObject
will be configured as per that Polling Object.
If two or more Polling Objects
which satisfy a match criteria for a ManagedObject, then the Polling Object
which matches first will be chosen and data collection can be configured
based on that PollingObject. This default behaviour can be overriden by using
the option PASS_THRO_ALL_POLLING_OBJECTS
in WebNMS home/conf/NmsProcessesBE.conf.
At start up Polling
Objects are created from Polling.conf.Users can also add
Polling Objects at run time using API or through UI.
- Since:
- 2.3
- See Also:
Serializable,
PollAPI.addPollingObject(PollingObject,boolean),
PollAPI.modifyPollingObject(PollingObject,boolean),
PollAPI.deletePollingObject(String),
PollAPI.setPollingObjectStatus(String,boolean),
PollAPI.getPollingObjectStatus(String), Serialized Form
|
Method Summary |
java.lang.String |
getHelpURL()
Returns the help url of this polling object. |
java.util.Properties |
getMCProperties()
Returns the match criteria properties of this Polling Object. |
java.lang.String |
getName()
Returns the name of this Polling Object. |
java.lang.String |
getPollingObjectCustomizer()
Returns the customizer class of this polling object. |
java.util.Properties |
getProperties()
Returns the properties(both data collection details and match criteria)
of this polling object. |
boolean |
getStatus()
Returns the status of this Polling Object. |
boolean |
matches(ManagedObject mo)
Matches the ManagedObject with the match criteria and user classes
and returns the status. |
void |
setMCProperties(java.util.Properties p)
Sets the match criteria properties of this Polling Object. |
void |
setName(java.lang.String str)
Sets a unique name to this Polling Object. |
void |
setProperties(java.util.Properties p)
Sets the data collection criteria for this Polling Object. |
void |
setStatus(boolean stat)
Set the status of this Polling Object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PollingObject
public PollingObject()
setName
public void setName(java.lang.String str)
- Sets a unique name to this Polling Object.
- Parameters:
str - the name of this Polling Object.
getName
public java.lang.String getName()
- Returns the name of this Polling Object.
- Returns:
- name of this Polling Object.
setStatus
public void setStatus(boolean stat)
- Set the status of this Polling Object. If the status is false , polling
for all PolledDatas configured under this Polling Object will be
disabled.(i.e., the Active field of PolledDatas will be set to false.)
Once disbled,Polling can be resumed by setting the status to true.
- Parameters:
stat - a boolean value indicating status of this
Polling Object.
getStatus
public boolean getStatus()
- Returns the status of this Polling Object.
- Returns:
- a
boolean value
setMCProperties
public void setMCProperties(java.util.Properties p)
- Sets the match criteria properties of this Polling Object.
The format of the properties should be like this.
"Compare" Vector of Compare Objects
"Class" Vector of user class names
Either one user class or one .Compare object is the minimum
requirement for creating this Polling Object.
The user classes must implement the CheckMOProperties interface.
Note:While setting properties of a PollingObject, match criteria
properties must be set using this method
before setting data collection criteria using
setProperties(Properties).
Match criteria properties can be set only when a PollingObject
is added.i.e.,it cannot be modified by modifying the PollingObject.
- Parameters:
p - Properties to be set.- See Also:
CheckMOProperties,
Compare,
NumericCompare,
StringCompare
getMCProperties
public java.util.Properties getMCProperties()
- Returns the match criteria properties of this Polling Object.
It contains
"Compare" vector of Compare objects
"Class" vector of strings representing user classes.
- Returns:
- match criteria properties
matches
public boolean matches(ManagedObject mo)
- Matches the ManagedObject with the match criteria and user classes
and returns the status.
- Parameters:
mo - a ManagedObject to be compared.- Returns:
- a
boolean status of the operation.
setProperties
public void setProperties(java.util.Properties p)
- Sets the data collection criteria for this Polling Object.
The properties should have the following format.
- CommonCriteria Properties containing common properties for this
PollingObject like pollingPeriod and prefix(optional).
Any property of oid which is listed under CollectionCriteria(except
name , oid , type and interval,insertString,ThresholdName#n)can also
be specified in this property object in which case it will be applicable to
all oids of this PollingObject.
In addition ,
it may also contain user properties which will be applied to all
oids of this PollingObject.(i.e.,) Any property which
does not fall under standard properties will be taken as a user property.
- pollingPeriod the common group interval for this
Polling Object(optional)
- prefix the prefix to be appended to all the oids(optional)
- CollectionCriteria Vector of Properties corresponding to each oid.
Each property object in the above Vector must have the fields ,
oid , type and name.Other fields being optional.It may also contain
user properties.If same property is specified under both
CommonCriteria and in any one of the property objects in
CollectionCriteria,
the value specified
in the property object from CollectionCriteria
will be taken for that oid.
- oid - the oid string .
In SNMP data collection, in case type ='node' , the oid string will be
appended with '0' if it end with a '.' else the oid string will be
taken as such. (eg., 1.2. will become 1.2.0 and 4.2.0 will be taken as
such). In case type is set as 'multiple' , oid string given
should be a columnar oid and it should not have any indices appended to
it. (eg., 2.2.1.10. , 2.2.1.16. ) . If type is set as 'interface' , the
oid string given will be appended with the appropriate index.
- type - type of oid (either 'node' ,
'interface' or 'multiple'). For SNMP polling , type should be set as 'node'
when oid is a scalar. 'interface' type is used when oids from ifTable in
RFC-1213 mib is polled. In this case, first the index
for the ipaddress from the ipAddrTable( The oid polled is ipAdEntIfIndex
which maps ipaddress to the index value) is retrieved . This index is
appended to the oids of type 'interface'. For any other columnar oid ,
set type as 'multiple' which will retrieve all instances of the oid.
For example , if oid="2.2.1.10" and type ="multiple" , all the instances
of 2.2.1.10 will be retrived and stored in the table. If oid="2.2.1.10"
and type="interface", first, index to be appended to this oid is retrieved
and it is appended to this oid (eg., 2.2.1.10.2 or 2.2.1.10.1677769
etc). Hence for 'interface' type the actual oid string stored in database as
part of PolledData object may differ .
- name - a unique name given to this oid.
The optional fields are ,
- interval - individual polling interval for the oid which will
override the group interval.
- protocol - The name of the implementing protocol which will do
the data collection for this oid.The implementing class must have been
specified in Polling.conf.
- community - community string - specific to SNMP
- saveAbsolutes -"true" if absolute value is to be saved,"false"
otherwise. In SNMP polling , this variable is applicable
only to counter type oids only. This is false by default and hence while
polling counter type oids , differential values will be stored. Counter
rollover is also handled internally in the default Snmp protocol
provider while finding differential value.
- timeAvg - whether to time average the collected value or not.
- Active - "true" if polling is enabled, "false" otherwise.
- statsDataTableName - name of the table in
which long type collected data is to be stored. If a "%" is appended to
the table name , the created table will have current date appended to
it and for each new day a new table will be created. If table name given
is "MyTable%" then table name will be "MyTablemm_dd_yyyy" where mm= month
, dd=day and yyyy=year and it will have default table structure . Both 'statsDataTableName' and
'stringDataTableName' properties cannot be given together.
- stringDataTableName - name of the table in
which string type collected data is to be stored.If a "%" is appended to
the table name , the created table will have current date appended to
it and for each new day a new table will be created. If table name given
is "MyTable%" then table name will be "MyTablemm_dd_yyyy" where mm= month
, dd=day and yyyy=year and it will have default table structure. Both 'statsDataTableName' and
'stringDataTableName' properties cannot be given together.
- StoreData - "true" if collected data is to be
stored , "false" otherwise . This can be set to 'false' in case user
specific storage mechanism is followed.
- savePollCount - The number of polls after which the data is to be stored
- Threshold - "true" if Threshold is enabled, "false" otherwise.
- saveOnThreshold - "true" if data is to be stored only when Threshold
is exceeeded
- failureThreshold - The number of consecutive failures after which
threshold is to be generated.
- ThresholdName#n - The various threshold objects associated to this oid
where #n represents a serial no.
- insertString - insertString option for storing data in customized
format in user defined tables.
For example , if the insertString is given as ,
insertString="(TIMEOFCOLLECTION,OIDINSTANCE,ID,COLLECTEDVALUE) values (TIME,INSTANCE,POLLID,VAL)"
then the time of collection will be stored in the column TIMEOFCOLLECTION
, instance will be stored in OIDINSTANCE , id of the polleddata for which
data is collected will be stored in ID and the actual
collected value will be stored in the column COLLECTEDVALUE.
time. To make use of this property a table should be created wither via
PollAPI using
addCreateSchema(String,String) and createtable(String) with the above mentioned columns and the table name
should be associated with the PolledData through PollFilters.
Note:While setting properties of a PollingObject, match criteria
properties must be set using
setMCProperties(Properties)
before setting data collection properties.
- Parameters:
p - Properties to be set.- See Also:
PollFilters
getProperties
public java.util.Properties getProperties()
- Returns the properties(both data collection details and match criteria)
of this polling object.
- Returns:
- Properties of this polling object
getPollingObjectCustomizer
public java.lang.String getPollingObjectCustomizer()
- Returns the customizer class of this polling object.
This is used in client to invoke used specified UI class for
manipulating PollingObject. The customized class can
be specified in WebNMS home/conf/NmsProcessesBE.conf under
Collector process as,
PROCESS com.adventnet.nms.poll.Collector
ARGS POLLING_POLICY_CUSTOMIZER classname
If no customized class is specified , the name of default class
is returned.
- Returns:
- fully qualified name of the customizer class if specified in
NmsProcessesBE.conf , else returns
"com.adventnet.nms.pollui.PollUIFrame"(name of the default class)
getHelpURL
public java.lang.String getHelpURL()
- Returns the help url of this polling object. The string being relative
to the help directory. Since this Polling Object has a customizer,
specifying help string has no effect because everything is handled
by the customizer.
- Returns:
- url as string.