28 |
|
*/ |
29 |
|
public final String REVISION = "$Revision$"; |
30 |
|
|
31 |
+ |
/** |
32 |
+ |
* A description of this monitor |
33 |
+ |
*/ |
34 |
|
public final String DESC = "Who watches the watchmen?"; |
35 |
|
|
36 |
|
private final String SOURCE = "i-scream-server"; |
40 |
|
//---CONSTRUCTORS--- |
41 |
|
|
42 |
|
//---PUBLIC METHODS--- |
43 |
< |
|
43 |
> |
|
44 |
> |
/** |
45 |
> |
* Analyse a packet of data, and generate an alert if |
46 |
> |
* necessary. |
47 |
> |
* |
48 |
> |
* @param packet the XMLPacket to analyse |
49 |
> |
*/ |
50 |
|
public void analysePacket(XMLPacket packet) { |
51 |
|
if (packet.getParam("packet.attributes.type").equals("queueStat")) { |
52 |
|
String source = packet.getParam("packet.attributes.hashCode"); |
161 |
|
} |
162 |
|
|
163 |
|
//---PRIVATE METHODS--- |
164 |
< |
|
164 |
> |
|
165 |
> |
/** |
166 |
> |
* Checks a piece of current data, and returns the |
167 |
> |
* threshold it breaches, if any. |
168 |
> |
* |
169 |
> |
* @param qSize the size of a queue |
170 |
> |
* @param reg the Register for the host |
171 |
> |
* @return the threshold level breached, if any |
172 |
> |
*/ |
173 |
|
private int checkAttributeThreshold(double qSize, Register reg) { |
174 |
|
for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) { |
175 |
|
if (reg.getThreshold(thresholdLevel) != -1.0) { |
182 |
|
} |
183 |
|
|
184 |
|
//---ACCESSOR/MUTATOR METHODS--- |
185 |
< |
|
185 |
> |
|
186 |
> |
/** |
187 |
> |
* Returns a reference to a specific Queue for this |
188 |
> |
* monitor. This Queue returns only the data packets |
189 |
> |
* (based on type) that we want too look at. |
190 |
> |
* |
191 |
> |
* @return a reference to a Queue |
192 |
> |
*/ |
193 |
|
protected Queue getQueue() { |
194 |
|
return MonitorManager.getInstance().getOtherQueue(); |
195 |
|
} |
212 |
|
* A reference to the configuration proxy in use |
213 |
|
*/ |
214 |
|
private ConfigurationProxy _cp = ConfigurationProxy.getInstance(); |
215 |
< |
|
215 |
> |
|
216 |
> |
/** |
217 |
> |
* A HashMap of Registers (or groups of Registers), one |
218 |
> |
* for each host we're monitoring. |
219 |
> |
*/ |
220 |
|
private HashMap _hosts = new HashMap(); |
221 |
|
|
222 |
|
//---STATIC ATTRIBUTES--- |