23 |
|
*/ |
24 |
|
public final String REVISION = "$Revision$"; |
25 |
|
|
26 |
+ |
/** |
27 |
+ |
* A description of this monitor |
28 |
+ |
*/ |
29 |
|
public final String DESC = "Monitors number of logged on users."; |
30 |
|
|
31 |
|
//---STATIC METHODS--- |
33 |
|
//---CONSTRUCTORS--- |
34 |
|
|
35 |
|
//---PUBLIC METHODS--- |
36 |
< |
|
36 |
> |
|
37 |
> |
/** |
38 |
> |
* Analyse a packet of data, and generate an alert if |
39 |
> |
* necessary. |
40 |
> |
* |
41 |
> |
* @param packet the XMLPacket to analyse |
42 |
> |
*/ |
43 |
|
public void analysePacket(XMLPacket packet) { |
44 |
|
// what host are we looking at |
45 |
|
String source = packet.getParam("packet.attributes.machine_name"); |
85 |
|
} |
86 |
|
|
87 |
|
//---PRIVATE METHODS--- |
88 |
< |
|
88 |
> |
|
89 |
> |
/** |
90 |
> |
* Checks a piece of current data, and returns the |
91 |
> |
* threshold it breaches, if any. |
92 |
> |
* |
93 |
> |
* @param attributeString a String representing the current data value |
94 |
> |
* @param reg the Register for the host |
95 |
> |
* @return the threshold level breached, if any |
96 |
> |
*/ |
97 |
|
private int checkAttributeThreshold(String attributeString, Register reg) { |
98 |
|
for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) { |
99 |
|
if (reg.getThreshold(thresholdLevel) != -1.0) { |
112 |
|
} |
113 |
|
|
114 |
|
//---ACCESSOR/MUTATOR METHODS--- |
115 |
< |
|
115 |
> |
|
116 |
> |
/** |
117 |
> |
* Returns a reference to a specific Queue for this |
118 |
> |
* monitor. This Queue returns only the data packets |
119 |
> |
* (based on type) that we want too look at. |
120 |
> |
* |
121 |
> |
* @return a reference to a Queue |
122 |
> |
*/ |
123 |
|
protected Queue getQueue() { |
124 |
|
return MonitorManager.getInstance().getDataQueue(); |
125 |
|
} |
136 |
|
* be changed to null for utility classes. |
137 |
|
*/ |
138 |
|
private String _name = "UserCount"; |
139 |
< |
|
139 |
> |
|
140 |
> |
/** |
141 |
> |
* A HashMap of Registers (or groups of Registers), one |
142 |
> |
* for each host we're monitoring. |
143 |
> |
*/ |
144 |
|
private HashMap _hosts = new HashMap(); |
145 |
|
|
146 |
|
//---STATIC ATTRIBUTES--- |