Dear community,
I use Hyperic 4.6.
With the help of HQ API ( Java API), I was able to create Alerts
for the Resources.But I want to make it as an E-Mail Alert.
Say for a Resource Agent , I configure 6 Alerts via API.
Now I have nearly 40 Agents being monitored.
So 40*6=240 Alerts.
How can I configure E-Mail Alerts as well via API ?
I feel that manually mapping 240 Alerts with an Email ID is difficult.
Can you please suggest a way, so that while creating alerts via API itself, I shall be able to mark the alert with an Email Address, so that
when ever alert gets triggered, marked Email addresses will be notified via Email.
-
Sree
One could either make an escalation (Enterprise feature) tied to those alerts.
Or
You could use HQAPI to list these alerts, use a script or sed/awk to add the email action then sync the XML back using HQAPI.
Hello egonzales,
Thanks for the reply.
I use the Open Source version of Hyperic.
>>You could use HQAPI to list these alerts, use a script or sed/awk to add the email action then sync the XML back using HQAPI.
I tried to create an alert manually in Hyperic and I viewed the alert definition through,
hqapi.sh alertdefintion list
After this, I added HQ User Email Address for Alert Notification for that alert and I again
viewed the alert definition through,
hqapi.sh alertdefintion list
by seeing XML, I did not find any differences. In which table, does the Notify Other Recipients details [Other EMail Address ] are stored ?
Could you please guide me inorder to add an EMail Address for an alert through API
-
Sree
Hi,
You have to use alertdefinition sync command after updating the AlertDefinitionsResponse (xml).
The alertdefinition sync command takes an AlertDefinitionsResponse and syncs any changes back into the HQ inventory.
You can read more in Hyperic documentation: https://support.hyperic.com/display/DOCS46/HQApi+alertdefinition+command
Thanks,
Tal
Hello tgoldman,
Thanks for reply.
That link was much helpful.
I configured Alerts and when an alert was triggered,Alerts are shown in Hyperic Dashboard, But no Email was sent.
When I check server.log,
"
0-07-2014 13:24:14,726 IST WARN [org.hyperic.hq.events.server.session.AlertConditionsSatisfiedListener@7bf092f11] [org.hyperic.hq.events.server.session.ClassicEscalatableCreator@165] Error executing action [(id=10005, class="com".hyperic.hq.bizapp.server.action.email.EmailAction)]
org.hyperic.hq.events.ActionExecuteException: Unable to execute action: Unable to get action
at org.hyperic.hq.events.server.session.Action.executeAction(Action.java:275)
at org.hyperic.hq.events.server.session.ClassicEscalatableCreator.executeActions(ClassicEscalatableCreator.java:156)
at org.hyperic.hq.events.server.session.ClassicEscalatableCreator.createEscalatableNoNotify(ClassicEscalatableCreator.java:105)
at org.hyperic.hq.events.server.session.ClassicEscalatableCreator.createEscalatable(ClassicEscalatableCreator.java:94)
at org.hyperic.hq.events.server.session.AlertManagerImpl.fireAlert(AlertManagerImpl.java:474)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at org.hyperic.hq.monitor.aop.aspects.PerformanceMonitor.monitorServiceMethod(PerformanceMonitor.java:84)
at sun.reflect.GeneratedMethodAccessor240.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy89.fireAlert(Unknown Source)
at org.hyperic.hq.events.server.session.AlertConditionsSatisfiedListener.processEvents(AlertConditionsSatisfiedListener.java:83)
at org.hyperic.hq.zevents.TimingListenerWrapper.processEvents(TimingListenerWrapper.java:47)
at org.hyperic.hq.zevents.BufferedListener$BufferedEventRunnable.run(BufferedListener.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hyperic.hq.common.SystemException: Unable to get action
at org.hyperic.hq.events.server.session.Action.getInitializedAction(Action.java:260)
at org.hyperic.hq.events.server.session.Action.executeAction(Action.java:270)
... 32 more
Caused by: java.lang.ClassNotFoundException: com.hyperic.hq.bizapp.server.action.email.EmailAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hyperic.hq.events.server.session.Action.getInitializedAction(Action.java:251)
... 33 more
"
I use Hyperic 5.8.2 Open Source Version in Debian Linux.
My System is able to telnet to smtp server.
Could you, please give your suggestion.
-
Sree
Hi,
Hyperic had a problem to execute the Email action in alert fire process.
You can try to define a new test alert with one email action and test it to verify if it is a system issue or just a specific alert definition issue.
Thanks,
Tal
Hi Tal,
Thanks for the reply.
I tried with for 2 alerts.
One alert created by manually mapping Email Address
Other alert created by HQAPI Web Services.
For both alerts, I am getting same error, when the Alert is triggered.
How shall I proceed further ?
-
Sree
Did you test your email server?
Try to send a message from Hyperic server machine to Email server.
Verify that the email server is defined correctly in Hyperic ( .../conf/hq-server.conf file.)
Tal
Hello Tal,
thanks for the reply.
My hq-server.conf is as follows [EMail]
server.mail.host=smtp.smtp.in
# Change to SMTP port
mail.smtp.port=25
# SMTP properties
mail.smtp.auth=false
mail.smtp.socketFactory.class=javax.net.SocketFactory
mail.smtp.socketFactory.fallback=false
mail.smtp.socketFactory.port=25
mail.smtp.starttls.enable=false
>>Try to send a message from Hyperic server machine to Email server.
Yes it s working
Could you please suggest me what else I need to check from my side ?
-
Sree