Get SNMP4J logs from JBoss ON server

Solution Verified - Updated -

Environment

  • Red Hat JBoss Operation Network (ON) 2, 3
  • JBoss ON server

Issue

  • Get SNMP4J logs from server;
  • Debug an SNMP issue;
  • How do I see the SNMP4J logs?

Resolution

To make SNMP4J logging available to the Log4j logger used by the JBoss ON server, you will need to add a system property to the server's RHQ_SERVER_ADDITIONAL_JAVA_OPTS environment variable:

RHQ_SERVER_ADDITIONAL_JAVA_OPTS="${RHQ_SERVER_ADDITIONAL_JAVA_OPTS} -Dsnmp4j.LogFactory=org.snmp4j.log.Log4jLogFactory"

This can be added to rhq-server-env.sh or rhq-server.sh. Please note a server restart will be required for the JBoss ON server to pick up the new system property.

Once the system property has been defined, you can enable debug logging for SNMP4J by setting the log level to DEBUG for logging category org.snmp4j. This should be done in the same manner that other logging configuration is applies to your JBoss ON server.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments