Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

openldap-plugin: Metric collection fails if slapd restarted

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 4.6.5
  • Component/s: Plugins
  • Case Links:
    none
  • Regression:
    No
  • Tags:

Description

If openldap server is restarted, metric collection fails unless agent is restarted.

Steps to reproduce:

1.) Configure proper monitoring of openldap 2.3 server
2.) Wait for metrics to be collected to confirm successful monitoring
3.) Restart slapd
4.) Wait for next interval. Metric collection will fail.

agent.log:

2011-06-03 07:30:00,096 ERROR [pool-5-thread-1] [ScheduleThread] Metric Value not found while processing Metric 'OpenLDAP 2.3.x:openldap:Type=Server:cn=Max,cn=Threads,cn=Monit
or:monitoredInfo:ldapDriver=com.sun.jndi.ldap.LdapCtxFactory,ldapHostURL=ldap%3A//localhost%3A389,ldapAuthType=simple,ldapTreePathToDN=cn%3DManager%2Cdc%3Dlocaldomain,ldapPass
wd=********'
org.hyperic.hq.product.MetricNotFoundException: Service openldap:Type=Server, cn=Max,cn=Threads,cn=Monitor:monitoredInfo not found
at org.hyperic.hq.plugin.openldap.OpenLDAPMeasurementPlugin.getValue(OpenLDAPMeasurementPlugin.java:134)
at org.hyperic.hq.product.MeasurementPluginManager.getPluginValue(MeasurementPluginManager.java:176)
at org.hyperic.hq.product.MeasurementPluginManager.getValue(MeasurementPluginManager.java:274)
at org.hyperic.hq.measurement.agent.server.ScheduleThread.getValue(ScheduleThread.java:439)
at org.hyperic.hq.measurement.agent.server.ScheduleThread.access$1400(ScheduleThread.java:74)
at org.hyperic.hq.measurement.agent.server.ScheduleThread$MetricTask.run(ScheduleThread.java:505)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name 'cn=Max,cn=Threads,cn=Monitor'
at com.sun.jndi.ldap.LdapCtx.doSearch(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.searchAux(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_search(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(Unknown Source)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(Unknown Source)
at javax.naming.directory.InitialDirContext.search(Unknown Source)
at org.hyperic.hq.plugin.openldap.OpenLDAPMeasurementPlugin.getMetric(OpenLDAPMeasurementPlugin.java:160)
at org.hyperic.hq.plugin.openldap.OpenLDAPMeasurementPlugin.getValue(OpenLDAPMeasurementPlugin.java:129)
... 11 more
Caused by: java.io.IOException: connection closed
at com.sun.jndi.ldap.LdapClient.ensureOpen(Unknown Source)
at com.sun.jndi.ldap.LdapClient.search(Unknown Source)
... 20 more

We should catch IOExceptions and retry (3 times?) instead of requiring that the agent be restarted

Activity

Hide
Wes Schlichter added a comment -

applied above patch

Show
Wes Schlichter added a comment - applied above patch
Hide
German Laullon added a comment -

is not working

Show
German Laullon added a comment - is not working
Hide
German Laullon added a comment -

pervious version doesn't work well when monitoring is not enabled on the server.

Show
German Laullon added a comment - pervious version doesn't work well when monitoring is not enabled on the server.
Hide
Ryan Morgan added a comment -

German,

Can you expand a bit here on what isn't working? The source changes for this commit are mostly whitespace changes making it difficult to see exactly what you changed. As rule, we shouldn't be making whitespace/formatting changes in the same commits as actual code changes.

Also a fix version of 4.x is not helpful. Can you change this to 4.7 to reflect it was placed in master?

Show
Ryan Morgan added a comment - German, Can you expand a bit here on what isn't working? The source changes for this commit are mostly whitespace changes making it difficult to see exactly what you changed. As rule, we shouldn't be making whitespace/formatting changes in the same commits as actual code changes. Also a fix version of 4.x is not helpful. Can you change this to 4.7 to reflect it was placed in master?
Hide
German Laullon added a comment -

Yes, there is a few whitespace/formatting changes but I think those are very important to keep the code easy to read and follow. I also made others changes which required indentation changes.

With the pervious change the plugin only reconnects when the user have the monitoring active on his openldap server, If not, the plugins continue working, but doesn't reconnect.

Show
German Laullon added a comment - Yes, there is a few whitespace/formatting changes but I think those are very important to keep the code easy to read and follow. I also made others changes which required indentation changes. With the pervious change the plugin only reconnects when the user have the monitoring active on his openldap server, If not, the plugins continue working, but doesn't reconnect.
Hide
Ryan Morgan added a comment -

Of course, proper formatting is imperative. Just don't do it along side functional changes, it makes the review of changes much more difficult.

I still don't understand what was fixed here. Can you give an example?

Show
Ryan Morgan added a comment - Of course, proper formatting is imperative. Just don't do it along side functional changes, it makes the review of changes much more difficult. I still don't understand what was fixed here. Can you give an example?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    2 years, 23 weeks, 3 days ago