Chapter 5. SNMP Example

This chapter describes how to start JEUS SNMP agent and how the SNMP client application retrieves monitoring information from JEUS.

  1. Modify the SNMP client example program in "4.2. SNMP Client Program Sample" and compile it. In order to compile the example program, SNMP4j is required. SNMP4J API can be downloaded from www.snmp4j.org.

  2. Refer to Configuration in "Chapter 2. SNMP Agent" to configure the SNMP Adaptor. The example uses port 9999 so set SNMP Adapter Port to '9999'.

  3. Restart the server. If SNMP Adapter is in use, the following log will appear.

    . . .
    
    [2016.08.03 16:32:12][0] [adminServer-1] [SNMP-0004] The SNMP agent is ready using the port 9999. 
    
    . . .

    Note

    This example assumes the JEUS server name as ‘adminServer’.

  4. Execute the example program created in step 1. Set the classpath to SNMP4J in order to run the program. This example assumes that SNMP4J is the file 'SNMP4J.jar' in the '/home/user1/lib' directory.

    user1@host1:~/java -classpath /home/user1/lib/SNMP4J.jar SnmpclientSample
    PORT : 9999
    IP : 127.0.0.1
    OID : 1.3.6.1.4.1.14586.100.2.1
    1.3.6.1.4.1.14586.100.2.1.0 = [JEUS:JMXManager=adminServer,j2eeType=J2EEDomain,name=domain1]

    Note

    This program is set to access the port number, 127.0.0.1:9999. In order to access a different address and port, provide parameter values for the port number and IP address when executing the program.