From: <tk...@hy...> - 2008-03-19 21:35:09
|
Author: tkeeney Date: 2008-03-19 14:35:01 -0700 (Wed, 19 Mar 2008) New Revision: 8356 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=8356 Modified: trunk/ui_plugins/health/app/HealthController.groovy trunk/ui_plugins/health/etc/health_i18n.properties Log: [HHQ-1791] [ported from 3.2.2] Added an HQ Health database query to return all resource alert definitions that are active but disabled. This is useful if resource alert trigger processing fails and a recovery alert def cannot reenable the primary alert def. The query will help the user determine what primary alert defs are suffering from this problem. Modified: trunk/ui_plugins/health/app/HealthController.groovy =================================================================== --- trunk/ui_plugins/health/app/HealthController.groovy 2008-03-19 21:28:36 UTC (rev 8355) +++ trunk/ui_plugins/health/app/HealthController.groovy 2008-03-19 21:35:01 UTC (rev 8356) @@ -398,6 +398,13 @@ aiqIP: [ name: localeBundle['queryAIQIP'], query: "select * from EAM_AIQ_IP"], + resourceAlertsActiveButDisabled: [ + name: localeBundle['queryResourceAlertDefsActiveButDisabled'], + query: {conn -> "select id, name, description, resource_id from EAM_ALERT_DEFINITION where "+ + "(parent_id is null or parent_id > 0) and active="+ + DBUtil.getBooleanValue(true, conn)+" and enabled="+ + DBUtil.getBooleanValue(false, conn)+" and deleted="+ + DBUtil.getBooleanValue(false, conn)}], ] def res = [:] @@ -425,7 +432,17 @@ def runQuery(params) { def id = params.getOne('query') - def query = databaseQueries[id].query + + def query + + if (databaseQueries[id].query in Closure) { + query = withConnection() { conn -> + databaseQueries[id].query(conn) + } + } else { + query = databaseQueries[id].query + } + def name = databaseQueries[id].name def start = now() Modified: trunk/ui_plugins/health/etc/health_i18n.properties =================================================================== --- trunk/ui_plugins/health/etc/health_i18n.properties 2008-03-19 21:28:36 UTC (rev 8355) +++ trunk/ui_plugins/health/etc/health_i18n.properties 2008-03-19 21:35:01 UTC (rev 8356) @@ -46,6 +46,7 @@ queryAIQPlatform=AutoInventory Platforms queryAIQServer=AutoInventory Servers queryAIQIP=AutoInventory IPs +queryResourceAlertDefsActiveButDisabled=Active But Disabled Resource Alert Defs noResultsFound=The query returned no results numPlatforms=# Platforms numServers=# Servers |