Alert priority format
by Al Amyot
Our shop wants to send alert notifications to the BMC Remedy product
which can automatically create an incident ticket from the email.
Unfortunately it expects a simple numeric priority field not the "!!! -
HIGH" that RHQ puts out. Can anyone point us to the code that formats
this subject line? I have been unable to find it. This chunk of code
appears to build the email:
Map<String, String> alertMessage =
emailManager.getAlertEmailMessage(ancestry.get(resource.getId()), //
746
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l746> resource.getName(), //
747
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l747> alertDefinition.getName(), //
748
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l748> alertDefinition.getPriority().toString(),
//
749
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l749> new Date(alert.getCtime()).toString(), //
750
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l750>
prettyPrintAlertConditions(alert.getConditionLogs(), false), //
751
<http://git.fedorahosted.org/git?p=rhq/rhq.git;a=blob;f=modules/enterpri
se/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManager
Bean.java#l751> prettyPrintAlertURL(alert));
So it seems like the Priority class's toString() method builds it.
Our alternative to customizing the code is passing the email through
some sort of transforming filter. Suggestions are welcome!
I apologize if this is a newbie question - it's been a while since I
looked at the code and I only have rudimentary Java knowledge
Al Amyot | Consultant
Sierra Systems
(eHealth): 204-926-4257 (T): 204-942-2575 (C): 204-230-7911 (F):
204-942-2047
444 St. Mary Avenue, Suite 1050
Winnipeg, MB R3C 3T1
Management Consulting | System Integration | Managed Services
website: www.SierraSystems.com <http://www.sierrasystems.com/>
facebook - www.sierrasystems.com/facebook
google+ - www.sierrasystems.com/google+
linkedin - www.sierrasystems.com/linkedin
twitter - www.sierrasystems.com/twitter
This email and/or any documents in this transmission is intended for the
addressee(s) only and may contain legally privileged or confidential information. Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited. If you receive this transmission in error, please notify the sender immediately and return the original.
Ce courriel et tout document dans cette transmission est destiné à la personne ou aux personnes à qui il est adressé. Il peut contenir des informations privilégiées ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autorisée est strictement défendue. Si vous n'êtes pas le destinataire de ce message, veuillez en informer l'expéditeur immédiatement et lui remettre l'original.
11 years, 10 months
How to avoid late collections?
by Andreas Veithen
We have a somewhat particular RHQ setup where we monitor a large
number of resources remotely from a single agent. Par agent, we have
+/- 25000 scheduled measurements with +/- 1500 measurement collected
per minute. Since most of the metrics are collected with the same
interval (10 minutes), this causes the following problem: when the
agent is started (t=0), it will schedule all these metrics in the same
interval [0s,30s]. However, because of the large number of
measurements, the agent is not able to collect all of them in that 30s
interval and will reschedule the remaining ones to the next interval
in the original schedule, i.e. to [10m,10m+30s]. The same thing again
happens in the interval [10m,10m+30s] and most of the measurements are
rescheduled to the next interval [20m,20m+30s] and so forth. This
means that some metrics are never collected (and are reported as
"late" in the metrics of the RHQ agent).
Note that the issue only occurs after restarting the agent. When the
resources are originally added to the inventory, the corresponding
measurement schedules are spread more or less randomly and the agent
is able to collect all of them.
To solve that issue with RHQ 3.0, I applied the following patch:
Index: src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
===================================================================
--- src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
(revision 141630)
+++ src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java
(revision 141631)
@@ -484,6 +484,13 @@
this.scheduledRequests.offer(scheduledMeasurement);
}
}
+
+ public synchronized void reschedule(Set<ScheduledMeasurementInfo>
scheduledMeasurementInfos, long interval) {
+ for (ScheduledMeasurementInfo scheduledMeasurement :
scheduledMeasurementInfos) {
+ scheduledMeasurement.setNextCollection(scheduledMeasurement.getNextCollection()
+ interval);
+ this.scheduledRequests.offer(scheduledMeasurement);
+ }
+ }
/**
* Sends the given measurement report to the server, if this
plugin container has server services that it can
Index: src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
===================================================================
--- src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
(revision 141630)
+++ src/main/java/org/rhq/core/pc/measurement/MeasurementCollectorRunner.java
(revision 141631)
@@ -71,7 +71,7 @@
log.debug("Measurement collection is falling
behind... Missed requested time by ["
+ (System.currentTimeMillis() -
requests.iterator().next().getNextCollection()) + "ms]");
- this.measurementManager.reschedule(requests);
+ this.measurementManager.reschedule(requests, 30000L);
return report;
}
The idea is that instead of rescheduling the measurement according to
the original schedule (e.g. from [0s,30s] to [10m,10m+30s]), it should
simply be rescheduled to the next interval (from [0s,30s] to
[30s,60s]).
We are currently in the process of upgrading to RHQ 4.4. I didn't test
the patch with that version yet, but after looking at the code I think
it is still applicable. I would like to get some feedback about the
approach: is it a valid way to solve the issue or are there better
ways to do that?
Andreas
11 years, 10 months
monitoring ejb call
by liumin HU
hi,
I want to know if it is possible with rhq to monitoring the call of a
EJB running on a jboss server?
thanks in advance
liumin
11 years, 10 months
Service RHQ-Agent on windows 2008
by Wesley Lago
I need to install the RHQ Agent-in an environment with Windows 2008 X86_64,
I create the service in windows as documentation, yet the RHQ-server does
not see the RHQ Agent-in air, always gets the machine listing in
Alerted or Unavailable
Resources.
Sorry my english
11 years, 10 months
syntax highlighting for blogs
by John Sanda
If you do any blogging where you include any kind of source code in your
posts, then the following may be of interest to you. I have a pretty
simple set up using blogger. I configured my blog to use
SyntaxHighlighter. It is all client side, and it was a bit of a pain to
set up. That criticism might however be better directed at blogger. I
noticed on some of the aggregate feeds like at planet.jboss.org and now
at jboss.org/rhq that the highlighting is lost. The highlighting also
doesn't render so great on mobile devices. Earlier this evening I
switched over to using gist.github.com. If you are not familiar with
gist, it is similar to pastebin. There are some really nice things about
gist though. Every gist is a git repo that can be cloned or forked. You
can make edits and add comments as well. It has nice syntax highlighting
for quite a large number of languages. Including a gist in your blog
only involves a few simple steps:
* Create the gist.
* Click on the "embed" link in the upper right corner of the gist window.
* Copy and past the link into your post.
The link looks something like <script
src="https://gist.github.com/2921426.js?file=discovery_component.clj"></script>.
The syntax highlighting is not lost in the aggregate feeds, and I also
think it looks better on mobile devices as well.
- John
11 years, 10 months