You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <no...@gi...> - 2010-01-12 15:49:32
|
Branch: refs/heads/hqapi-2.x Home: http://github.com/hyperic/hqapi Commit: 1f33b56c892e221d49e3db56fc34352f7ae4971e http://github.com/hyperic/hqapi/commit/1f33b56c892e221d49e3db56fc34352f7ae4971e Author: pnguyen <pnguyen@192.168.1.66> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- [HHQ-3624] For resource type alert definitions, update the "basic" information in a separate call so that the instance alert definitions are also updated Commit: 6c4572d55eb923073ac57c1b1fc112451567bc9b http://github.com/hyperic/hqapi/commit/6c4572d55eb923073ac57c1b1fc112451567bc9b Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: eca4f40a329ed396848c751af6bd52e449acfb8f http://github.com/hyperic/hqapi/commit/eca4f40a329ed396848c751af6bd52e449acfb8f Author: pnguyen <pnguyen@192.168.1.66> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M ChangeLog Log Message: ----------- Update ChangeLog with fix for HHQ-3624 |
From: <no...@gi...> - 2010-01-12 15:49:30
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 1f33b56c892e221d49e3db56fc34352f7ae4971e http://github.com/hyperic/hqapi/commit/1f33b56c892e221d49e3db56fc34352f7ae4971e Author: pnguyen <pnguyen@192.168.1.66> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- [HHQ-3624] For resource type alert definitions, update the "basic" information in a separate call so that the instance alert definitions are also updated Commit: 6c4572d55eb923073ac57c1b1fc112451567bc9b http://github.com/hyperic/hqapi/commit/6c4572d55eb923073ac57c1b1fc112451567bc9b Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: eca4f40a329ed396848c751af6bd52e449acfb8f http://github.com/hyperic/hqapi/commit/eca4f40a329ed396848c751af6bd52e449acfb8f Author: pnguyen <pnguyen@192.168.1.66> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M ChangeLog Log Message: ----------- Update ChangeLog with fix for HHQ-3624 Commit: 9ca0d938f8a83fe749cb8f5bff9d5e1e550918c9 http://github.com/hyperic/hqapi/commit/9ca0d938f8a83fe749cb8f5bff9d5e1e550918c9 Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M ChangeLog M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- Merge branch 'hqapi-2.x' |
From: <no...@gi...> - 2010-01-12 15:49:30
|
Branch: refs/heads/hqapi-1.0 Home: http://github.com/hyperic/hqapi Commit: 1f33b56c892e221d49e3db56fc34352f7ae4971e http://github.com/hyperic/hqapi/commit/1f33b56c892e221d49e3db56fc34352f7ae4971e Author: pnguyen <pnguyen@192.168.1.66> Date: 2010-01-12 (Tue, 12 Jan 2010) Changed paths: M hqu/hqapi1/app/AlertdefinitionController.groovy Log Message: ----------- [HHQ-3624] For resource type alert definitions, update the "basic" information in a separate call so that the instance alert definitions are also updated |
From: <bo...@hy...> - 2010-01-12 09:17:29
|
Author: bob Date: 2010-01-12 01:17:19 -0800 (Tue, 12 Jan 2010) New Revision: 14166 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14166 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1317 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-12 02:13:27 UTC (rev 14165) +++ trunk/etc/version.properties 2010-01-12 09:17:19 UTC (rev 14166) @@ -1,3 +1,3 @@ -#Mon Jan 11 00:27:28 PST 2010 +#Tue Jan 12 00:27:26 PST 2010 version=4.3.0 -build=1316 +build=1317 |
From: <dcr...@hy...> - 2010-01-12 02:13:36
|
Author: dcrutchf Date: 2010-01-11 18:13:27 -0800 (Mon, 11 Jan 2010) New Revision: 14165 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14165 Modified: trunk/src/org/hyperic/hq/ui/security/InternalAuthenticationProvider.java trunk/src/org/hyperic/hq/ui/security/SessionInitializationStrategy.java trunk/web/META-INF/security-context.xml trunk/web/WEB-INF/web.xml Log: Updated web.xml (had filters out of order) Updated auth provider and session init strategy to load dashboard preferences Updated security context to load list of auth providers (this may change later on) Modified: trunk/src/org/hyperic/hq/ui/security/InternalAuthenticationProvider.java =================================================================== --- trunk/src/org/hyperic/hq/ui/security/InternalAuthenticationProvider.java 2010-01-12 01:44:14 UTC (rev 14164) +++ trunk/src/org/hyperic/hq/ui/security/InternalAuthenticationProvider.java 2010-01-12 02:13:27 UTC (rev 14165) @@ -18,16 +18,30 @@ import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.GrantedAuthorityImpl; -import org.springframework.stereotype.Component; /* - * This class is responsible for authenticating a user using HQ's internal user store. + * This class is responsible for authenticating a user using HQ's internal user store. It can also be configured to enable guest user access as well as override the guest username. * */ -@Component public class InternalAuthenticationProvider implements AuthenticationProvider { private static Log log = LogFactory.getLog(InternalAuthenticationProvider.class.getName()); + private String guestUserName = "guest"; + private boolean guestEnabled = false; + + // TODO get this from the db instead + public String getGuestUserName() { + return guestUserName; + } + + public boolean isGuestEnabled() { + return guestEnabled; + } + + public void setGuestEnabled(boolean guestEnabled) { + this.guestEnabled = guestEnabled; + } + public Authentication authenticate(Authentication authentication) throws AuthenticationException { // TODO: Once this is evolution, remove the getOne in favor of DI AuthBossLocal authBoss = AuthBossEJBImpl.getOne(); @@ -38,8 +52,16 @@ // ...then we attempt to authenticate using authBoss... try { - int sid = authBoss.login(username, password); - + // ...check to see if we the user is trying to log in as guest user... + int sid; + + if (this.isGuestEnabled() && this.getGuestUserName().equalsIgnoreCase(username)) { + sid = authBoss.loginGuest(); + } else { + // ...this is a non guest user, authenticate... + sid = authBoss.login(username, password); + } + if (log.isTraceEnabled()) { log.trace("Logged in as [" + username + "] with session id [" + sid + "]"); } Modified: trunk/src/org/hyperic/hq/ui/security/SessionInitializationStrategy.java =================================================================== --- trunk/src/org/hyperic/hq/ui/security/SessionInitializationStrategy.java 2010-01-12 01:44:14 UTC (rev 14164) +++ trunk/src/org/hyperic/hq/ui/security/SessionInitializationStrategy.java 2010-01-12 02:13:27 UTC (rev 14165) @@ -5,6 +5,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; import javax.ejb.FinderException; import javax.servlet.ServletContext; @@ -28,7 +30,11 @@ import org.hyperic.hq.bizapp.shared.AuthzBoss; import org.hyperic.hq.ui.Constants; import org.hyperic.hq.ui.WebUser; +import org.hyperic.hq.ui.server.session.DashboardManagerEJBImpl; +import org.hyperic.hq.ui.server.session.UserDashboardConfig; +import org.hyperic.hq.ui.shared.DashboardManagerLocal; import org.hyperic.hq.ui.util.ContextUtils; +import org.hyperic.image.widget.ResourceTree; import org.hyperic.util.config.ConfigResponse; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.session.SessionAuthenticationException; @@ -105,6 +111,10 @@ session.setAttribute(Constants.USER_OPERATIONS_ATTR, userOperationsMap); + // Load up the user's dashboard preferences + loadDashboard(ctx, webUser, authzBoss); + setXlibFlag(session); + if (log.isDebugEnabled()) { log.debug("Stashing user operations in the session"); } @@ -127,7 +137,63 @@ } } + private boolean mergeValues(ConfigResponse config, ConfigResponse other, boolean overWrite) { + boolean updated = true; + Set<Entry<Object,Object>> entrySet = other.toProperties().entrySet(); + + for (Iterator<Entry<Object, Object>> i = entrySet.iterator(); i.hasNext();) { + Entry<Object, Object> entry = i.next(); + String key = (String) entry.getKey(); + String value = (String) entry.getValue(); + + if (overWrite || config.getValue(key) == null) { + config.setValue(key, value); + updated = true; + } + } + return updated; + } + private static void setXlibFlag(HttpSession session) { + try { + new ResourceTree(1); // See if graphics engine is present + session.setAttribute(Constants.XLIB_INSTALLED, Boolean.TRUE); + } catch (Throwable t) { + session.setAttribute(Constants.XLIB_INSTALLED, Boolean.FALSE); + } + } + + private void loadDashboard(ServletContext ctx, WebUser webUser, AuthzBoss authzBoss) { + try { + DashboardManagerLocal dashManager = DashboardManagerEJBImpl.getOne(); + ConfigResponse defaultUserDashPrefs = + (ConfigResponse) ctx.getAttribute(Constants.DEF_USER_DASH_PREFS); + AuthzSubject me = + authzBoss.findSubjectById(webUser.getSessionId(), + webUser.getSubject().getId()); + UserDashboardConfig userDashboard = dashManager.getUserDashboard(me, me); + + if (userDashboard == null) { + userDashboard = dashManager.createUserDashboard(me, me, webUser.getName()); + } + + ConfigResponse userDashobardConfig = userDashboard.getConfig(); + + if (mergeValues(userDashobardConfig, defaultUserDashPrefs, false)) { + dashManager.configureDashboard(me, userDashboard, + userDashobardConfig); + } + } catch (PermissionException e) { + e.printStackTrace(); + } catch (SessionNotFoundException e) { + // User not logged in + } catch (SessionTimeoutException e) { + // User session has expired + } catch (RemoteException e) { + // Cannot look up this user + } + } + private static Map<String, Boolean> loadUserPermissions(Integer sessionId, AuthzBoss authzBoss) throws SessionTimeoutException, SessionNotFoundException, PermissionException, RemoteException, FinderException { // look up the user's permissions Modified: trunk/web/META-INF/security-context.xml =================================================================== --- trunk/web/META-INF/security-context.xml 2010-01-12 01:44:14 UTC (rev 14164) +++ trunk/web/META-INF/security-context.xml 2010-01-12 02:13:27 UTC (rev 14165) @@ -1,132 +1,139 @@ - <beans xmlns="http://www.springframework.org/schema/beans" +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:sec="http://www.springframework.org/schema/security" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-2.5.xsd - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.0.xsd"> - <!-- Auto wire our custom security beans --> - <context:component-scan base-package="org.hyperic.hq.ui.security" /> - - <!-- This bean handles the actual of authentication user credentials --> - <sec:authentication-manager alias="authenticationManager"> - <sec:authentication-provider ref="internalAuthenticationProvider" /> - </sec:authentication-manager> + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-2.5.xsd + http://www.springframework.org/schema/security + http://www.springframework.org/schema/security/spring-security-3.0.xsd"> + <!-- Auto wire our custom security beans --> + <context:component-scan base-package="org.hyperic.hq.ui.security" /> - <bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy"> - <sec:filter-chain-map path-type="ant"> - <sec:filter-chain pattern="/login.jsp" filters="none" /> - <sec:filter-chain pattern="/*.ico" filters="none" /> - <sec:filter-chain pattern="/css/**" filters="none" /> - <sec:filter-chain pattern="/js/**" filters="none" /> - <sec:filter-chain pattern="/images/**" filters="none" /> - <sec:filter-chain pattern="/ui-docs/**" filters="none" /> - <sec:filter-chain pattern="/hqu/hqapi*/**" filters="securityContextPersistenceFilter, + <bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy"> + <sec:filter-chain-map path-type="ant"> + <sec:filter-chain pattern="/login.jsp" filters="none" /> + <sec:filter-chain pattern="/*.ico" filters="none" /> + <sec:filter-chain pattern="/css/**" filters="none" /> + <sec:filter-chain pattern="/js/**" filters="none" /> + <sec:filter-chain pattern="/images/**" filters="none" /> + <sec:filter-chain pattern="/ui-docs/**" filters="none" /> + <sec:filter-chain pattern="/hqu/hqapi*/**" filters="securityContextPersistenceFilter, basicAuthenticationFilter, basicAuthenticationExceptionTranslationFilter, sessionManagementFilter, - filterSecurityInterceptor" /> - <sec:filter-chain pattern="/**" filters="securityContextPersistenceFilter, - logoutFilter, - basicAuthenticationFilter, - formBasedAuthenticationFilter, - sessionManagementFilter, - formAuthenticationExceptionTranslationFilter, - filterSecurityInterceptor" /> - </sec:filter-chain-map> - </bean> - - <!-- Setup security context persistence filter --> - <bean id="securityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository" /> - - <bean id="securityContextPersistenceFilter" class="org.springframework.security.web.context.SecurityContextPersistenceFilter"> - <property name="securityContextRepository" ref="securityContextRepository" /> - </bean> - - <!-- For logout --> - <bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"> - <constructor-arg value="/login.jsp" /> - <constructor-arg> - <list> - <bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"></bean> - </list> - </constructor-arg> - </bean> - - <!-- For basic authentication --> - <bean id="basicAuthenticationFilter" class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter"> - <property name="authenticationManager" ref="authenticationManager" /> - <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint" /> - </bean> - - <bean id="basicAuthenticationEntryPoint" class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint"> - <property name="realmName" value="HQ-Realm" /> - </bean> - - <bean id="basicAuthenticationExceptionTranslationFilter" class="org.springframework.security.web.access.ExceptionTranslationFilter"> - <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint" /> - <property name="accessDeniedHandler"> - <bean class="org.springframework.security.web.access.AccessDeniedHandlerImpl" /> - </property> - </bean> - - <!-- For form-based authentication --> - <bean id="formBasedAuthenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"> - <property name="authenticationManager" ref="authenticationManager" /> - <property name="sessionAuthenticationStrategy" ref="sessionInitializationStrategy" /> - <property name="authenticationSuccessHandler"> - <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler"> - <property name="defaultTargetUrl" value="/Dashboard.do" /> - </bean> - </property> - <property name="authenticationFailureHandler"> - <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"> - <property name="defaultFailureUrl" value="/login.jsp?authfailed=true" /> - </bean> - </property> - </bean> - - <bean id="formAuthenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"> - <property name="loginFormUrl" value="/login.jsp" /> - </bean> - - <bean id="formAuthenticationExceptionTranslationFilter" class="org.springframework.security.web.access.ExceptionTranslationFilter"> - <property name="authenticationEntryPoint" ref="formAuthenticationEntryPoint" /> - </bean> - - <!-- Setup session management filter --> - <bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter"> - <constructor-arg ref="securityContextRepository" /> - <property name="sessionAuthenticationStrategy" ref="sessionInitializationStrategy" /> - </bean> - - <!-- Setup the filter security interceptor --> - <bean id="filterSecurityInterceptor" class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"> - <property name="authenticationManager" ref="authenticationManager" /> - <property name="accessDecisionManager"> - <bean class="org.springframework.security.access.vote.AffirmativeBased"> - <property name="allowIfAllAbstainDecisions" value="false" /> - <property name="decisionVoters"> - <list> - <bean class="org.springframework.security.access.vote.RoleVoter" /> - </list> - </property> - </bean> - </property> - <property name="securityMetadataSource"> - <sec:filter-security-metadata-source> - <sec:intercept-url pattern="/login.jsp" /> - <sec:intercept-url pattern="/favicon.ico" /> - <sec:intercept-url pattern="/css/**" /> - <sec:intercept-url pattern="/js/**" /> - <sec:intercept-url pattern="/images/**" /> - <sec:intercept-url pattern="/ui_docs/**" /> - <sec:intercept-url pattern="/hqu/hqapi*/**" access="ROLE_USER" /> - <sec:intercept-url pattern="/**" access="ROLE_USER" /> - </sec:filter-security-metadata-source> - </property> - </bean> - </beans> \ No newline at end of file + filterSecurityInterceptor" /> + <sec:filter-chain pattern="/**" filters="securityContextPersistenceFilter, + logoutFilter, + basicAuthenticationFilter, + formBasedAuthenticationFilter, + sessionManagementFilter, + formAuthenticationExceptionTranslationFilter, + filterSecurityInterceptor" /> + </sec:filter-chain-map> + </bean> + + <!-- Setup security context persistence filter --> + <bean id="securityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository" /> + + <bean id="securityContextPersistenceFilter" class="org.springframework.security.web.context.SecurityContextPersistenceFilter"> + <property name="securityContextRepository" ref="securityContextRepository" /> + </bean> + + <!-- For logout --> + <bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"> + <constructor-arg value="/login.jsp" /> + <constructor-arg> + <list> + <bean class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"></bean> + </list> + </constructor-arg> + </bean> + + <!-- For basic authentication --> + <bean id="basicAuthenticationFilter" class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter"> + <property name="authenticationManager" ref="authenticationManager" /> + <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint" /> + </bean> + + <bean id="basicAuthenticationEntryPoint" class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint"> + <property name="realmName" value="HQ-Realm" /> + </bean> + + <bean id="basicAuthenticationExceptionTranslationFilter" class="org.springframework.security.web.access.ExceptionTranslationFilter"> + <property name="authenticationEntryPoint" ref="basicAuthenticationEntryPoint" /> + <property name="accessDeniedHandler"> + <bean class="org.springframework.security.web.access.AccessDeniedHandlerImpl" /> + </property> + </bean> + + <!-- For form-based authentication --> + <bean id="formBasedAuthenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"> + <property name="authenticationManager" ref="authenticationManager" /> + <property name="sessionAuthenticationStrategy" ref="sessionInitializationStrategy" /> + <property name="authenticationSuccessHandler"> + <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler"> + <property name="defaultTargetUrl" value="/Dashboard.do" /> + </bean> + </property> + <property name="authenticationFailureHandler"> + <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"> + <property name="defaultFailureUrl" value="/login.jsp?authfailed=true" /> + </bean> + </property> + </bean> + + <bean id="formAuthenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"> + <property name="loginFormUrl" value="/login.jsp" /> + </bean> + + <bean id="formAuthenticationExceptionTranslationFilter" class="org.springframework.security.web.access.ExceptionTranslationFilter"> + <property name="authenticationEntryPoint" ref="formAuthenticationEntryPoint" /> + </bean> + + <!-- Setup session management filter --> + <bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter"> + <constructor-arg ref="securityContextRepository" /> + <property name="sessionAuthenticationStrategy" ref="sessionInitializationStrategy" /> + </bean> + + <!-- Setup the filter security interceptor --> + <bean id="filterSecurityInterceptor" class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"> + <property name="authenticationManager" ref="authenticationManager" /> + <property name="accessDecisionManager"> + <bean class="org.springframework.security.access.vote.AffirmativeBased"> + <property name="allowIfAllAbstainDecisions" value="false" /> + <property name="decisionVoters"> + <list> + <bean class="org.springframework.security.access.vote.RoleVoter" /> + </list> + </property> + </bean> + </property> + <property name="securityMetadataSource"> + <sec:filter-security-metadata-source> + <sec:intercept-url pattern="/login.jsp" /> + <sec:intercept-url pattern="/favicon.ico" /> + <sec:intercept-url pattern="/css/**" /> + <sec:intercept-url pattern="/js/**" /> + <sec:intercept-url pattern="/images/**" /> + <sec:intercept-url pattern="/ui_docs/**" /> + <sec:intercept-url pattern="/hqu/hqapi*/**" access="ROLE_USER" /> + <sec:intercept-url pattern="/**" access="ROLE_USER" /> + </sec:filter-security-metadata-source> + </property> + </bean> + + <bean id="internalAuthenticationProvider" class="org.hyperic.hq.ui.security.InternalAuthenticationProvider"> + <property name="guestEnabled" value="true" /> + </bean> + + <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager"> + <property name="providers"> + <list> + <ref local="internalAuthenticationProvider" /> + </list> + </property> + </bean> +</beans> \ No newline at end of file Modified: trunk/web/WEB-INF/web.xml =================================================================== --- trunk/web/WEB-INF/web.xml 2010-01-12 01:44:14 UTC (rev 14164) +++ trunk/web/WEB-INF/web.xml 2010-01-12 02:13:27 UTC (rev 14165) @@ -75,11 +75,6 @@ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> - <filter-mapping> - <filter-name>filterChainProxy</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <filter> <filter-name>Resource-Filter</filter-name> <filter-class>org.hyperic.hq.ui.ResourceFilter</filter-class> @@ -100,6 +95,11 @@ <url-pattern>/*</url-pattern> </filter-mapping> + <filter-mapping> + <filter-name>filterChainProxy</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> <filter-name>Resource-Filter</filter-name> <url-pattern>/images/*</url-pattern> |
From: <dcr...@hy...> - 2010-01-12 02:12:52
|
Author: dcrutchf Date: 2010-01-11 17:44:14 -0800 (Mon, 11 Jan 2010) New Revision: 14164 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14164 Modified: trunk/web/login.jsp Log: updated markup Modified: trunk/web/login.jsp =================================================================== --- trunk/web/login.jsp 2010-01-11 22:05:52 UTC (rev 14163) +++ trunk/web/login.jsp 2010-01-12 01:44:14 UTC (rev 14164) @@ -48,17 +48,29 @@ </div> </p> </c:if> - <p> - <label for="j_username"><fmt:message key="login.field.username" /></label> - <input type="text" id="j_username" name="j_username" value="" /> - </p> - <p> - <label for="j_password"><fmt:message key="login.field.password" /></label> - <input type="password" id="j_password" name="j_password" /> - </p> - <p> - <input name="submit" type="submit" class="button42" value="<fmt:message key="login.signin" />" /> - </p> + <table> + <tr> + <td> + <label for="j_username"><fmt:message key="login.field.username" /></label> + </td> + <td> + <input type="text" id="j_username" name="j_username" value="" /> + </td> + </tr> + <tr> + <td> + <label for="j_password"><fmt:message key="login.field.password" /></label> + </td> + <td> + <input type="password" id="j_password" name="j_password" /> + </td> + </tr> + <tr> + <td colspan="2" align="right"> + <input name="submit" type="submit" class="button42" value="<fmt:message key="login.signin" />" /> + </td> + </tr> + </table> </fieldset> </form> </div> |
From: <bo...@hy...> - 2010-01-11 09:21:13
|
Author: bob Date: 2010-01-11 01:21:04 -0800 (Mon, 11 Jan 2010) New Revision: 14162 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14162 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1316 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-10 09:30:49 UTC (rev 14161) +++ trunk/etc/version.properties 2010-01-11 09:21:04 UTC (rev 14162) @@ -1,3 +1,3 @@ -#Sun Jan 10 00:36:05 PST 2010 +#Mon Jan 11 00:27:28 PST 2010 version=4.3.0 -build=1315 +build=1316 |
From: <bo...@hy...> - 2010-01-10 09:31:03
|
Author: bob Date: 2010-01-10 01:30:49 -0800 (Sun, 10 Jan 2010) New Revision: 14161 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14161 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1315 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-09 09:23:42 UTC (rev 14160) +++ trunk/etc/version.properties 2010-01-10 09:30:49 UTC (rev 14161) @@ -1,3 +1,3 @@ -#Sat Jan 09 00:34:23 PST 2010 +#Sun Jan 10 00:36:05 PST 2010 version=4.3.0 -build=1314 +build=1315 |
From: <bo...@hy...> - 2010-01-09 09:23:52
|
Author: bob Date: 2010-01-09 01:23:42 -0800 (Sat, 09 Jan 2010) New Revision: 14160 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14160 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1314 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-08 19:46:39 UTC (rev 14159) +++ trunk/etc/version.properties 2010-01-09 09:23:42 UTC (rev 14160) @@ -1,3 +1,3 @@ -#Fri Jan 08 00:36:49 PST 2010 +#Sat Jan 09 00:34:23 PST 2010 version=4.3.0 -build=1313 +build=1314 |
From: <no...@gi...> - 2010-01-09 01:11:15
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 58891a7c9805ae88a4ffa45320319a7ab4ac567e http://github.com/hyperic/hqapi/commit/58891a7c9805ae88a4ffa45320319a7ab4ac567e Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M src/org/hyperic/hq/hqapi1/HQConnection.java Log Message: ----------- Backport fix for handling of multiple query parameters of the same name Commit: c9df798c1859236639ae47a954ae38f1ad123685 http://github.com/hyperic/hqapi/commit/c9df798c1859236639ae47a954ae38f1ad123685 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M hqu/hqapi1/app/MetricController.groovy M hqu/hqapi1/plugin.properties M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/Metric.xsd Log Message: ----------- [HHQ-3658] Add MetricApi.reschedule() API. Commit: 525c0dce0bcdee089bcba8a07ff72af64497c584 http://github.com/hyperic/hqapi/commit/525c0dce0bcdee089bcba8a07ff72af64497c584 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: a0088967bf6f00ed60fc00fc3d08357fe67b424e http://github.com/hyperic/hqapi/commit/a0088967bf6f00ed60fc00fc3d08357fe67b424e Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M ChangeLog M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/HQApi1.xsd Log Message: ----------- [HHQ-3658] Add MetricApi.reschedule() API. Commit: 1f2cef9f53cdd6b84a48434e496388a9e44f1ed9 http://github.com/hyperic/hqapi/commit/1f2cef9f53cdd6b84a48434e496388a9e44f1ed9 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M ChangeLog M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/HQApi1.xsd Log Message: ----------- Fix merge conflicts. |
From: <no...@gi...> - 2010-01-09 01:11:13
|
Branch: refs/heads/hqapi-2.x Home: http://github.com/hyperic/hqapi Commit: a0088967bf6f00ed60fc00fc3d08357fe67b424e http://github.com/hyperic/hqapi/commit/a0088967bf6f00ed60fc00fc3d08357fe67b424e Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M ChangeLog M hqu/hqapi1/app/MetricController.groovy M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/HQApi1.xsd Log Message: ----------- [HHQ-3658] Add MetricApi.reschedule() API. |
From: <no...@gi...> - 2010-01-09 01:03:49
|
Branch: refs/heads/hqapi-1.0 Home: http://github.com/hyperic/hqapi Commit: 58891a7c9805ae88a4ffa45320319a7ab4ac567e http://github.com/hyperic/hqapi/commit/58891a7c9805ae88a4ffa45320319a7ab4ac567e Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M src/org/hyperic/hq/hqapi1/HQConnection.java Log Message: ----------- Backport fix for handling of multiple query parameters of the same name Commit: c9df798c1859236639ae47a954ae38f1ad123685 http://github.com/hyperic/hqapi/commit/c9df798c1859236639ae47a954ae38f1ad123685 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M hqu/hqapi1/app/MetricController.groovy M hqu/hqapi1/plugin.properties M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/Metric.xsd Log Message: ----------- [HHQ-3658] Add MetricApi.reschedule() API. |
From: <no...@gi...> - 2010-01-09 01:03:49
|
Branch: refs/heads/hqapi-2.x Home: http://github.com/hyperic/hqapi Commit: 58891a7c9805ae88a4ffa45320319a7ab4ac567e http://github.com/hyperic/hqapi/commit/58891a7c9805ae88a4ffa45320319a7ab4ac567e Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M src/org/hyperic/hq/hqapi1/HQConnection.java Log Message: ----------- Backport fix for handling of multiple query parameters of the same name Commit: c9df798c1859236639ae47a954ae38f1ad123685 http://github.com/hyperic/hqapi/commit/c9df798c1859236639ae47a954ae38f1ad123685 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Changed paths: M hqu/hqapi1/app/MetricController.groovy M hqu/hqapi1/plugin.properties M src/org/hyperic/hq/hqapi1/MetricApi.java A src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java M src/org/hyperic/hq/hqapi1/tools/MetricCommand.java M xsd/Metric.xsd Log Message: ----------- [HHQ-3658] Add MetricApi.reschedule() API. Commit: 525c0dce0bcdee089bcba8a07ff72af64497c584 http://github.com/hyperic/hqapi/commit/525c0dce0bcdee089bcba8a07ff72af64497c584 Author: Ryan Morgan <rm...@hy...> Date: 2010-01-08 (Fri, 08 Jan 2010) Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x |
From: <bo...@hy...> - 2010-01-08 19:46:49
|
Author: bob Date: 2010-01-08 11:46:39 -0800 (Fri, 08 Jan 2010) New Revision: 14159 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14159 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.3 build #1270 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2010-01-08 09:26:36 UTC (rev 14158) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2010-01-08 19:46:39 UTC (rev 14159) @@ -1,3 +1,3 @@ -#Mon Dec 07 16:34:36 PST 2009 +#Fri Jan 08 11:11:51 PST 2010 version=4.2.0.3 -build=1269 +build=1270 |
From: <no...@gi...> - 2010-01-08 19:08:08
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: b99b10d8774e574af2b716f55306d3da5903a91e http://github.com/hyperic/hqapi/commit/b99b10d8774e574af2b716f55306d3da5903a91e Author: Ryan Morgan <rm...@hy...> Date: 2009-12-11 (Fri, 11 Dec 2009) Changed paths: M ChangeLog M hqu/hqapi1/app/ResourceController.groovy M xsd/HQApi1.xsd Log Message: ----------- [HHQ-3603] Add support for location field for Resources. Commit: 9034d518653c344567ef2e8770ca34d090c4d062 http://github.com/hyperic/hqapi/commit/9034d518653c344567ef2e8770ca34d090c4d062 Author: Ryan Morgan <rm...@hy...> Date: 2009-12-11 (Fri, 11 Dec 2009) Changed paths: M ChangeLog M hqu/hqapi1/app/ResourceController.groovy M xsd/HQApi1.xsd Log Message: ----------- Merge branch 'hqapi-2.x' Commit: c59a3b59a5e8d9190cb1e5dcf782081b7cd6e93f http://github.com/hyperic/hqapi/commit/c59a3b59a5e8d9190cb1e5dcf782081b7cd6e93f Author: Ryan Morgan <rm...@hy...> Date: 2009-12-15 (Tue, 15 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- Clarify path to client.properties must be absolute. Commit: 45fd6f891a4c41af912d53fa249802bba98134dc http://github.com/hyperic/hqapi/commit/45fd6f891a4c41af912d53fa249802bba98134dc Author: Ryan Morgan <rm...@hy...> Date: 2009-12-17 (Thu, 17 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/test/HQApiTestBase.java M src/org/hyperic/hq/hqapi1/test/MaintenanceSchedule_test.java M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- Merge branch 'master' of github.com:hyperic/hqapi Commit: e67e001fc44533215c18b885fcc970fa65e17f6d http://github.com/hyperic/hqapi/commit/e67e001fc44533215c18b885fcc970fa65e17f6d Author: Ryan Morgan <rm...@hy...> Date: 2010-01-05 (Tue, 05 Jan 2010) Changed paths: M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSync_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionTestBase.java M src/org/hyperic/hq/hqapi1/test/AlertFireRecovery_test.java M src/org/hyperic/hq/hqapi1/test/MaintenanceSchedule_test.java Log Message: ----------- Merge branch 'master' of github.com:hyperic/hqapi |
From: jrallen9 <jus...@te...> - 2010-01-08 18:57:54
|
I was able to correct the problem I described in this thread. I should have added a try/catch block for SigarFileNotFoundException as this code shows: FileSystem[] devices = session.getFileSystemList(); for (FileSystem dev : devices){ try{ switch(dev.getType()){ case FileSystem.TYPE_LOCAL_DISK: DiskUsage disk = session.getDiskUsage(dev.getDirName()); log.debug("DiskUsage for " + dev.getDirName() + " = " + disk.toString()); // do more stuff with the disk object break; case FileSystem.TYPE_CDROM: //Do nothing with CD-ROMS and Removable Disks break; case FileSystem.TYPE_NETWORK: //Ignore Network Shares at this time. break; default: break; } }catch(SigarFileNotFoundException e) { log.debug(dev.getDirName() + "...\n " + e.getMessage()); } As this code shows, getting a FileSystem list of mapped drive letter devices available on the system is useful for accessing DiskUsage information, but has the a problem in that not all devices are accessible even though its mapped by NTFS to a drive letter. To correct this I moved the problematic code under a case statement where the FileSystem type is a local disk (this was the only type I cared about). I also added the try/catch to log the error and continue on with execution. @Doug - I think the documentation under Sigar.getDiskUsage( String name) should be clarified to provide better descriptions on when SigarFileNotFoundExceptions are thrown. There must be a better way to indicate when a mapped drive letter is accessible for statistic collections. Perhaps at least the documentation should specify an approach to testing for stats accessibility prior to making calls to stats collections. I just want to add a thank you for the hard work which has gone into developing SIGAR. It's a great utility tool and has made Windows performance monitoring accessible for developers. I've looked at the WindowsAPI and its a beast, but the dlls provided have made a great interface for Java program development. |
From: <bo...@hy...> - 2010-01-08 09:26:46
|
Author: bob Date: 2010-01-08 01:26:36 -0800 (Fri, 08 Jan 2010) New Revision: 14158 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14158 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1313 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-08 01:05:02 UTC (rev 14157) +++ trunk/etc/version.properties 2010-01-08 09:26:36 UTC (rev 14158) @@ -1,3 +1,3 @@ -#Thu Jan 07 00:31:01 PST 2010 +#Fri Jan 08 00:36:49 PST 2010 version=4.3.0 -build=1312 +build=1313 |
From: <pn...@hy...> - 2010-01-08 01:05:15
|
Author: pnguyen Date: 2010-01-07 17:05:02 -0800 (Thu, 07 Jan 2010) New Revision: 14157 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14157 Modified: trunk/web/WEB-INF/tiles/events-def.xml Log: undo inadvertent revision 14060 Modified: trunk/web/WEB-INF/tiles/events-def.xml =================================================================== --- trunk/web/WEB-INF/tiles/events-def.xml 2010-01-07 09:22:40 UTC (rev 14156) +++ trunk/web/WEB-INF/tiles/events-def.xml 2010-01-08 01:05:02 UTC (rev 14157) @@ -163,6 +163,10 @@ path="/resource/common/monitor/alerts/config/ViewEscalation.jsp" controllerUrl="/alerts/ViewEscalation.do"/> + <definition name=".events.config.view.notifications.snmp.details" + path="/resource/common/monitor/alerts/config/SnmpActionProps.jsp" + controllerUrl="/alerts/ViewNotificationsSnmp.do"/> + <definition name=".events.config.view.controlaction" path="/resource/common/monitor/alerts/config/ViewDefinitionControlAction.jsp"/> |
From: <bo...@hy...> - 2010-01-07 09:22:50
|
Author: bob Date: 2010-01-07 01:22:40 -0800 (Thu, 07 Jan 2010) New Revision: 14156 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14156 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1312 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-01-06 20:55:39 UTC (rev 14155) +++ trunk/etc/version.properties 2010-01-07 09:22:40 UTC (rev 14156) @@ -1,3 +1,3 @@ -#Wed Jan 06 00:28:32 PST 2010 +#Thu Jan 07 00:31:01 PST 2010 version=4.3.0 -build=1311 +build=1312 |
From: <tr...@hy...> - 2010-01-06 20:22:50
|
Author: trader Date: 2010-01-06 11:54:09 -0800 (Wed, 06 Jan 2010) New Revision: 14141 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14141 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkHostDetector.java Log: Same as revision 14087, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkHostDetector.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkHostDetector.java 2010-01-06 19:53:23 UTC (rev 14140) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkHostDetector.java 2010-01-06 19:54:09 UTC (rev 14141) @@ -1,17 +1,18 @@ /* - * NOTE: This copyright does *not* cover user programs that use HQ program - * services by normal system calls through the application program interfaces - * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client - * Development Kit - this is merely considered normal use of the program, and - * does *not* fall under the heading of "derived work". Copyright (C) [2004, - * 2005, 2006], Hyperic, Inc. This file is part of HQ. HQ is free software; you - * can redistribute it and/or modify it under the terms version 2 of the GNU - * General Public License as published by the Free Software Foundation. This - * program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * 'NetworkHostDetector.java' NOTE: This copyright does *not* cover user + * programs that use HQ program services by normal system calls through the + * application program interfaces provided as part of the Hyperic Plug-in + * Development Kit or the Hyperic Client Development Kit - this is merely + * considered normal use of the program, and does *not* fall under the heading + * of "derived work". Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], + * Hyperic, Inc. This file is part of HQ. HQ is free software; you can + * redistribute it and/or modify it under the terms version 2 of the GNU General + * Public License as published by the Free Software Foundation. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA. */ @@ -26,13 +27,11 @@ public class NetworkHostDetector extends NetworkDeviceDetector { - private static final String STORAGE_NAME = "Storage"; private static final String PROP_STORAGE = STORAGE_NAME.toLowerCase(); private static final String STORAGE_COLUMN = "hrStorageDescr"; public List discoverServices(ConfigResponse serverConfig) throws PluginException { - List services = super.discoverServices(serverConfig); openSession(serverConfig); @@ -41,13 +40,16 @@ for (int i = 0; i < storageDesc.size(); i++) { ConfigResponse config = new ConfigResponse(); + String name = storageDesc.get(i).toString().trim(); ServiceResource service = createServiceResource(STORAGE_NAME); config.setValue(PROP_STORAGE, name); + service.setProductConfig(config); - // required to auto-enable metric + + // Required to auto-enable metric... service.setMeasurementConfig(); service.setServiceName(name + " " + STORAGE_NAME); |
From: <tr...@hy...> - 2010-01-06 20:12:20
|
Author: trader Date: 2010-01-06 12:12:10 -0800 (Wed, 06 Jan 2010) New Revision: 14153 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14153 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java Log: Same as revision 14087, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java 2010-01-06 20:11:44 UTC (rev 14152) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java 2010-01-06 20:12:10 UTC (rev 14153) @@ -1,44 +1,43 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ program - * services by normal system calls through the application program interfaces - * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client - * Development Kit - this is merely considered normal use of the program, and - * does *not* fall under the heading of "derived work". Copyright (C) - * [2004-2008], Hyperic, Inc. This file is part of HQ. HQ is free software; you - * can redistribute it and/or modify it under the terms version 2 of the GNU - * General Public License as published by the Free Software Foundation. This - * program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.hyperic.hq.plugin.netdevice; - -import org.hyperic.hq.product.Collector; -import org.hyperic.hq.product.Metric; -import org.hyperic.hq.product.MetricNotFoundException; -import org.hyperic.hq.product.MetricUnreachableException; -import org.hyperic.hq.product.MetricValue; -import org.hyperic.hq.product.PluginException; -import org.hyperic.hq.product.SNMPMeasurementPlugin; - -public class NetworkDeviceMeasurementPlugin - extends SNMPMeasurementPlugin -{ - - public MetricValue getValue(Metric metric) throws MetricUnreachableException, - MetricNotFoundException, - PluginException - { - - if (metric.getDomainName().equals(DOMAIN)) { - return super.getValue(metric); - } else { - // if-snmp totals - return Collector.getValue(this, metric); - } - } -} +/* + * 'NetworkDeviceMeasurementPlugin.java' NOTE: This copyright does *not* cover + * user programs that use HQ program services by normal system calls through the + * application program interfaces provided as part of the Hyperic Plug-in + * Development Kit or the Hyperic Client Development Kit - this is merely + * considered normal use of the program, and does *not* fall under the heading + * of "derived work". Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], + * Hyperic, Inc. This file is part of HQ. HQ is free software; you can + * redistribute it and/or modify it under the terms version 2 of the GNU General + * Public License as published by the Free Software Foundation. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package org.hyperic.hq.plugin.netdevice; + +import org.hyperic.hq.product.Collector; +import org.hyperic.hq.product.Metric; +import org.hyperic.hq.product.MetricNotFoundException; +import org.hyperic.hq.product.MetricUnreachableException; +import org.hyperic.hq.product.MetricValue; +import org.hyperic.hq.product.PluginException; +import org.hyperic.hq.product.SNMPMeasurementPlugin; + +public class NetworkDeviceMeasurementPlugin + extends SNMPMeasurementPlugin +{ + public MetricValue getValue(Metric metric) throws MetricUnreachableException, + MetricNotFoundException, + PluginException + { + if (metric.getDomainName().equals(DOMAIN)) { + return super.getValue(metric); + } else { + // IF-SNMP totals + return Collector.getValue(this, metric); + } + } +} |
From: <tr...@hy...> - 2010-01-06 20:11:54
|
Author: trader Date: 2010-01-06 12:11:44 -0800 (Wed, 06 Jan 2010) New Revision: 14152 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14152 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java Log: Same as revision 9972, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java 2010-01-06 20:11:00 UTC (rev 14151) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.java 2010-01-06 20:11:44 UTC (rev 14152) @@ -1,30 +1,19 @@ -/* - * 'NetworkDeviceMeasurementPlugin.java' - * - * - * NOTE: This copyright does *not* cover user programs that use HQ - * program services by normal system calls through the application - * program interfaces provided as part of the Hyperic Plug-in Development - * Kit or the Hyperic Client Development Kit - this is merely considered - * normal use of the program, and does *not* fall under the heading of - * "derived work". - * - * Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], Hyperic, Inc. - * This file is part of HQ. - * - * HQ is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ +/* + * NOTE: This copyright does *not* cover user programs that use HQ program + * services by normal system calls through the application program interfaces + * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client + * Development Kit - this is merely considered normal use of the program, and + * does *not* fall under the heading of "derived work". Copyright (C) + * [2004-2008], Hyperic, Inc. This file is part of HQ. HQ is free software; you + * can redistribute it and/or modify it under the terms version 2 of the GNU + * General Public License as published by the Free Software Foundation. This + * program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + */ package org.hyperic.hq.plugin.netdevice; @@ -36,20 +25,20 @@ import org.hyperic.hq.product.PluginException; import org.hyperic.hq.product.SNMPMeasurementPlugin; -public class NetworkDeviceMeasurementPlugin extends SNMPMeasurementPlugin +public class NetworkDeviceMeasurementPlugin + extends SNMPMeasurementPlugin { - public MetricValue getValue ( Metric metric ) throws MetricUnreachableException, - MetricNotFoundException, - PluginException - { - if ( metric.getDomainName().equals ( DOMAIN ) ) - { - return super.getValue ( metric ); - } - else - { - // IF-SNMP totals - return Collector.getValue(this, metric); - } - } + + public MetricValue getValue(Metric metric) throws MetricUnreachableException, + MetricNotFoundException, + PluginException + { + + if (metric.getDomainName().equals(DOMAIN)) { + return super.getValue(metric); + } else { + // if-snmp totals + return Collector.getValue(this, metric); + } + } } |
From: <tr...@hy...> - 2010-01-06 20:11:11
|
Author: trader Date: 2010-01-06 12:11:00 -0800 (Wed, 06 Jan 2010) New Revision: 14151 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14151 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java Log: Same as revision 14087, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java 2010-01-06 20:10:23 UTC (rev 14150) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java 2010-01-06 20:11:00 UTC (rev 14151) @@ -1,67 +1,74 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ program - * services by normal system calls through the application program interfaces - * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client - * Development Kit - this is merely considered normal use of the program, and - * does *not* fall under the heading of "derived work". Copyright (C) [2004, - * 2005, 2006], Hyperic, Inc. This file is part of HQ. HQ is free software; you - * can redistribute it and/or modify it under the terms version 2 of the GNU - * General Public License as published by the Free Software Foundation. This - * program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.hyperic.hq.plugin.netdevice; - -import java.util.Map; - -import org.hyperic.snmp.SNMPSession; -import org.hyperic.snmp.SNMPValue; - -public class HrStorageCollector - extends SNMPCollector -{ - - private static final String SIZE = "hrStorageSize"; - private static final String USED = "hrStorageUsed"; - private static final String UNITS = "hrStorageAllocationUnits"; - - public static class HrUnitsConverter implements ColumnValueConverter { - - private Map _units; - - public HrUnitsConverter(Map units) { - _units = units; - } - - // convert value to bytes - // see HOST-RESOURCES-MIB::hrStorageAllocationUnits - public double convert(String index, SNMPValue value) throws Exception { - double val = value.toLong(); - SNMPValue unit = (SNMPValue) _units.get(index); - if (unit != null) { - val *= unit.toLong(); - } - return val; - } - } - - public void collect() { - String columnName = getColumnName(); - if (columnName.equals(SIZE) || columnName.equals(USED)) { - try { - SNMPSession session = getSession(); - Map units = getIndexedColumn(session, UNITS, false); - collectIndexedColumn(new HrUnitsConverter(units)); - } catch (Exception e) { - return; - } - } else { - collectIndexedColumn(); - } - } -} +/* + * 'HrStorageCollector.java' NOTE: This copyright does *not* cover user programs + * that use HQ program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development Kit or + * the Hyperic Client Development Kit - this is merely considered normal use of + * the program, and does *not* fall under the heading of "derived work". + * Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], Hyperic, Inc. This file + * is part of HQ. HQ is free software; you can redistribute it and/or modify it + * under the terms version 2 of the GNU General Public License as published by + * the Free Software Foundation. This program is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. You should have received a copy of the GNU + * General Public License along with this program; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.plugin.netdevice; + +import java.util.Map; + +import org.hyperic.snmp.SNMPSession; +import org.hyperic.snmp.SNMPValue; + +public class HrStorageCollector + extends SNMPCollector +{ + private static final String SIZE = "hrStorageSize"; + private static final String USED = "hrStorageUsed"; + private static final String UNITS = "hrStorageAllocationUnits"; + + public static class HrUnitsConverter implements ColumnValueConverter { + private Map _units; + + public HrUnitsConverter(Map units) { + _units = units; + } + + // + // Convert value to bytes... + // See HOST-RESOURCES-MIB::hrStorageAllocationUnits + // + public double convert(String index, SNMPValue value) throws Exception { + double val = value.toLong(); + + SNMPValue unit = (SNMPValue) _units.get(index); + + if (unit != null) { + val *= unit.toLong(); + } + + return val; + } + } + + public void collect() { + String columnName = getColumnName(); + + if (columnName.equals(SIZE) || columnName.equals(USED)) { + try { + SNMPSession session = getSession(); + + Map units = getIndexedColumn(session, UNITS, false); + + collectIndexedColumn(new HrUnitsConverter(units)); + } catch (Exception e) { + return; + } + } else { + collectIndexedColumn(); + } + } +} |
From: <tr...@hy...> - 2010-01-06 20:10:34
|
Author: trader Date: 2010-01-06 12:10:23 -0800 (Wed, 06 Jan 2010) New Revision: 14150 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14150 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java Log: Same as revision 9853, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java 2010-01-06 20:09:32 UTC (rev 14149) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/HrStorageCollector.java 2010-01-06 20:10:23 UTC (rev 14150) @@ -1,30 +1,19 @@ -/* - * 'HrStorageCollector.java' - * - * - * NOTE: This copyright does *not* cover user programs that use HQ - * program services by normal system calls through the application - * program interfaces provided as part of the Hyperic Plug-in Development - * Kit or the Hyperic Client Development Kit - this is merely considered - * normal use of the program, and does *not* fall under the heading of - * "derived work". - * - * Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], Hyperic, Inc. - * This file is part of HQ. - * - * HQ is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ +/* + * NOTE: This copyright does *not* cover user programs that use HQ program + * services by normal system calls through the application program interfaces + * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client + * Development Kit - this is merely considered normal use of the program, and + * does *not* fall under the heading of "derived work". Copyright (C) [2004, + * 2005, 2006], Hyperic, Inc. This file is part of HQ. HQ is free software; you + * can redistribute it and/or modify it under the terms version 2 of the GNU + * General Public License as published by the Free Software Foundation. This + * program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA. + */ package org.hyperic.hq.plugin.netdevice; @@ -33,63 +22,46 @@ import org.hyperic.snmp.SNMPSession; import org.hyperic.snmp.SNMPValue; -public class HrStorageCollector extends SNMPCollector +public class HrStorageCollector + extends SNMPCollector { - private static final String SIZE = "hrStorageSize"; - private static final String USED = "hrStorageUsed"; - private static final String UNITS = "hrStorageAllocationUnits"; - public static class HrUnitsConverter implements ColumnValueConverter - { - private Map _units; + private static final String SIZE = "hrStorageSize"; + private static final String USED = "hrStorageUsed"; + private static final String UNITS = "hrStorageAllocationUnits"; - public HrUnitsConverter ( Map units ) - { - _units = units; - } + public static class HrUnitsConverter implements ColumnValueConverter { - // - // Convert value to bytes... - // See HOST-RESOURCES-MIB::hrStorageAllocationUnits - // - public double convert ( String index, - SNMPValue value ) throws Exception - { - double val = value.toLong ( ); + private Map _units; - SNMPValue unit = (SNMPValue)_units.get ( index ); - - if ( unit != null ) - { - val *= unit.toLong ( ); + public HrUnitsConverter(Map units) { + _units = units; + } + + // convert value to bytes + // see HOST-RESOURCES-MIB::hrStorageAllocationUnits + public double convert(String index, SNMPValue value) throws Exception { + double val = value.toLong(); + SNMPValue unit = (SNMPValue) _units.get(index); + if (unit != null) { + val *= unit.toLong(); } - - return val; - } - } + return val; + } + } - public void collect ( ) - { - String columnName = getColumnName ( ); - - if ( columnName.equals ( SIZE ) || columnName.equals ( USED ) ) - { - try - { - SNMPSession session = getSession ( ); - - Map units = getIndexedColumn ( session, UNITS, false ); - - collectIndexedColumn ( new HrUnitsConverter ( units ) ); - } - catch ( Exception e ) - { - return; - } - } - else - { - collectIndexedColumn ( ); - } - } + public void collect() { + String columnName = getColumnName(); + if (columnName.equals(SIZE) || columnName.equals(USED)) { + try { + SNMPSession session = getSession(); + Map units = getIndexedColumn(session, UNITS, false); + collectIndexedColumn(new HrUnitsConverter(units)); + } catch (Exception e) { + return; + } + } else { + collectIndexedColumn(); + } + } } |
From: <tr...@hy...> - 2010-01-06 20:09:41
|
Author: trader Date: 2010-01-06 12:09:32 -0800 (Wed, 06 Jan 2010) New Revision: 14149 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14149 Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/IfTableCollector.java Log: Same as revision 14087, reformatted with project settings Modified: trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/IfTableCollector.java =================================================================== --- trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/IfTableCollector.java 2010-01-06 20:08:56 UTC (rev 14148) +++ trunk/plugins/netdevice/src/org/hyperic/hq/plugin/netdevice/IfTableCollector.java 2010-01-06 20:09:32 UTC (rev 14149) @@ -1,88 +1,97 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ program - * services by normal system calls through the application program interfaces - * provided as part of the Hyperic Plug-in Development Kit or the Hyperic Client - * Development Kit - this is merely considered normal use of the program, and - * does *not* fall under the heading of "derived work". Copyright (C) [2004, - * 2005, 2006], Hyperic, Inc. This file is part of HQ. HQ is free software; you - * can redistribute it and/or modify it under the terms version 2 of the GNU - * General Public License as published by the Free Software Foundation. This - * program is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -package org.hyperic.hq.plugin.netdevice; - -import java.util.HashMap; -import java.util.List; - -import org.hyperic.hq.product.PluginException; -import org.hyperic.snmp.SNMPClient; -import org.hyperic.snmp.SNMPException; -import org.hyperic.snmp.SNMPSession; - -public class IfTableCollector - extends SNMPCollector -{ - private boolean _isVersion1; - private String _columnName; - - private static HashMap counter64 = new HashMap(); - +/* + * 'IfTableCollector.java' NOTE: This copyright does *not* cover user programs + * that use HQ program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development Kit or + * the Hyperic Client Development Kit - this is merely considered normal use of + * the program, and does *not* fall under the heading of "derived work". + * Copyright (C) [2004, 2005, 2006, 2007, 2008, 2009], Hyperic, Inc. This file + * is part of HQ. HQ is free software; you can redistribute it and/or modify it + * under the terms version 2 of the GNU General Public License as published by + * the Free Software Foundation. This program is distributed in the hope that it + * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. You should have received a copy of the GNU + * General Public License along with this program; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.plugin.netdevice; + +import java.util.HashMap; +import java.util.List; + +import org.hyperic.hq.product.PluginException; +import org.hyperic.snmp.SNMPClient; +import org.hyperic.snmp.SNMPException; +import org.hyperic.snmp.SNMPSession; + +public class IfTableCollector + extends SNMPCollector +{ + private boolean _isVersion1; + private String _columnName; + + private static HashMap counter64 = new HashMap(); + + // // Conditionally use Counter64 versions of IF-MIB metrics. - // These metrics are not supported when using snmp v1. - // Not all devices support the 64 bit versions regardless. - static { - counter64.put("ifInOctets", "ifHCInOctets"); - counter64.put("ifOutOctets", "ifHCOutOctets"); - - counter64.put("ifInUcastPkts", "ifHCInUcastPkts"); - counter64.put("ifOutUcastPkts", "ifHCOutUcastPkts"); - - counter64.put("ifInNUcastPkts", "ifInMulticastPkts"); - counter64.put("ifOutNUcastPkts", "ifOutMulticastPkts"); - } - - protected String getColumnName() { - return _columnName; - } - - protected void init(SNMPSession session) throws PluginException { - _isVersion1 = "v1".equals(_props.getProperty(SNMPClient.PROP_VERSION)); - _columnName = super.getColumnName(); - - if (_columnName == null) { - throw new PluginException(PROP_COLUMN + " not defined: " + getProperties() + " (stale template?)"); - } - if (_isVersion1) { - return; - } - String name = (String) counter64.get(_columnName); - if (name != null) { - List list64 = null; - try { - list64 = session.getBulk(name); - } catch (SNMPException e) { - } - if (isEmpty(list64, name)) { - getLog().debug(getInfo() + " does not support Counter64: " + name); - } else { - getLog().debug("Switching to 64 bit counter: " + _columnName + "->" + name + ": " + getInfo()); - _columnName = name; - } - } - setSource(_columnName + "@" + getInfo()); - } - - protected boolean isTotalCounter(String name) { - return name.endsWith("Octets"); - } - - public void collect() { - collectIndexedColumn(); - } -} + // These metrics are not supported when using SNMPv1. + // Not all devices support the 64 bit versions, regardless. + // + static { + counter64.put("ifInOctets", "ifHCInOctets"); + counter64.put("ifOutOctets", "ifHCOutOctets"); + counter64.put("ifInUcastPkts", "ifHCInUcastPkts"); + counter64.put("ifOutUcastPkts", "ifHCOutUcastPkts"); + counter64.put("ifInNUcastPkts", "ifInMulticastPkts"); + counter64.put("ifOutNUcastPkts", "ifOutMulticastPkts"); + } + + protected String getColumnName() { + return _columnName; + } + + protected void init(SNMPSession session) throws PluginException { + _isVersion1 = "v1".equals(_props.getProperty(SNMPClient.PROP_VERSION)); + + _columnName = super.getColumnName(); + + if (_columnName == null) { + throw new PluginException(PROP_COLUMN + " not defined: " + getProperties() + " (stale template?)"); + } + + if (_isVersion1) { + return; + } + + String name = (String) counter64.get(_columnName); + + if (name != null) { + List list64 = null; + + try { + list64 = session.getBulk(name); + } catch (SNMPException e) { + } + + if (isEmpty(list64, name)) { + getLog().debug(getInfo() + " does not support Counter64: " + name); + } else { + getLog().debug("Switching to 64 bit counter: " + _columnName + "->" + name + ": " + getInfo()); + + _columnName = name; + } + } + + setSource(_columnName + "@" + getInfo()); + } + + protected boolean isTotalCounter(String name) { + return name.endsWith("Octets"); + } + + public void collect() { + collectIndexedColumn(); + } +} |