I'd like to add a custom metric for the postgresql database. The idea is simple, I need to query the postgresql rhq event table to find the number of error and fatal events in last 5 mins. Below is the query:
select 'metricColumn',count(id) from rhq_event where timestamp >(date_part('epoch',now())*1000-300000) and (severity='ERROR' or severity='FATAL');
This query works on psql console. However, when I imported into JON, it threw error like this:
Failed to manually import resource
Friday, September 21, 2012 10:58:53 AM UTC+12
java.lang.RuntimeException: org.rhq.core.clientapi.agent.PluginContainerException:Failed to add resource with type [Query] and parent resource id  -> org.rhq.core.util.exception.WrappedRemotingException:null
And I cannot find out any logs about this problem.
Any help will be appreicated.
Tried again, this query works fine now.