Architecture - Configuration

FriendlySNMP agent is configured using properties object. This properties object must contain at least three absolutely required entries while the rest entries are optional. All optional configuration parameters are using default values. See description of all required and optional configuration parameters below.

Additional FriendlySNMP flexibility could be achieved using advanced configuration.

Example configuration
The SNMP agent configuration is defined in a properties file. This file must have at least the following three entries:

Update localhost addresses and ports in the example above to valid values. Use SNMP credentials v2/public at first and modify them later as required when your SNMP agent becomes functional.

There are many other optional configuration parameters discussed below for the SNMP agent fine tuning.

The java.util.Properties object could be generated at runtime programmatically or loaded from a properties file. It is very convenient to have a single properties file and properties object for all application initialization including SNMP agent initialization.

Viewing agent configuration properties
All agent configuration properties including all default values could be viewed in the MIB browser using the table appConfigTable declared in the MIB FRIENDLY-SNMP-MIB.

Note, some of the values in this table are defined as SET nodes and might be overwritten by MIB browser and persist between sessions.

See also org.friendlysnmp.FConstant for a full list of configuration entries and their default values (if applicable).

The entries below are listed in alphabetical order.

Address of the application's SNMP agent to respond on SET and GET requests. The port 161 might be already used by Windows SNMP service. This entry is required and it does not have a default value.

Address to send notifications. This entry is required and it does not have a default value.

Disallow application boots count reset. The entry is optional. Default value is true. Applications boots count is used in SNMPv3 protocol. The value could be reset from MIB browser if this configuration entry is set to true. See also Boots Counter.

Uncaught exceptions are handled by the agent. The default JVM behavior to display uncaught runtime exceptions stack traces in a console could be enabled or disabled. Set this value to true in development environment to see exceptions stack traces in the console and to false in production to keep the console clean. The entry is optional. Default value is true.

Local engine ID. The entry is optional. This value overrides default generated value. Note, this value for SNMPv3 must match target EngineID in MIB browser if it is set not empty.

FriendlySNMP might receive multiple GET NEXT with subrequests for the same SNMP object in a short period of time. Each of these requests would fire update event. The application might want to coalesce duplicate update events into a single one. If identical update events are received in the following time frame only a single update event will be fired. Allowed values are 0 .. 10,000 ms. The entry is optional. Default value is 1000 ms.

Notification retry count. The entry is optional. Default value is 1 time.

Notification timeout. The entry is optional. Default value is 1000 ms.

Root OID for views. These entries are optional. Default values are "1.3".

Filename to store serialized default persistence storage. The entry is optional. Default filename is generated from the main application class name. See also Persistency.

Persistency policy. The entry is optional. Valid values are on_change and on_exit. Default value is on_change. Upper or lower case is ignored. See also Persistency.
The entry specifies optional plugin class. The entry could be repeated multiple times to specify multiple plugins. The suffix value xxx is not parsed but it must be unique within the properties entries. The default core plugin org.friendlysnmp.plugin.core.PluginCore is always present and cannot be replaced.
Storage type. These values are used in SNMP-COMMUNITY-MIB, SNMP-NOTIFICATION-MIB and SNMP-VIEW-BASED-ACM-MIB tables. The Textual Convention StorageType is declared as: "Describes the memory realization of a conceptual row. A row which is volatile(2) is lost upon reboot. A row which either nonVolatile(3), permanent(4) or readOnly(5), is backed up by stable storage. A row which is permanent(4) can be changed but not deleted. A row which is readOnly(5) cannot be changed nor deleted. If the value of an object with this syntax is either permanent(4) or readOnly(5), it cannot be written. Conversely, if the value is either other(1), volatile(2) or nonVolatile(3), it cannot be modified to be permanent(4) or readOnly(5)." Upper or lower case is ignored. These entries are optional. All defaults are "readOnly".

Thread pool size. The entry is optional. Default value is 4.

Transport. Valid values are: UDP or TCP. The entry is optional. Default value is UDP.

Transport domain. Valid values are: IPV4, IPV4Z, IPV6, IPV6Z. The entry is optional. Default value is IPV4
The SNMPv1/SNMPv2 community, e.g. "public". Multiple communities must be separated by spaces, e.g. "public snmp". The entry is optional. This entry specifies agent target(s). At least one target must be define for the agent.

The SNMPv3 user, e.g. "friend". Multiple users must be separated by spaces, e.g. "john craig". The entry is optional. This entry specifies agent target(s). At least one target must be define for the agent. This entry must be accompanied with security declarations (see below).

Security section for SNMPv3. These section is ignored if snmp.v3.user=.. entry is not specified. Valid auth protocols: none, MD5, SHA Valid priv protocols: none, DES, AES128, AES192, AES256 Default protocols are "none" or define empty value for "none". Authentication and privilege passwords (passphrases) should be encoded using the FriendlyPro tool with the specified or default key. The encoding obfuscates the actual key value in the properties file.

Advanced configuration

Fine agent credentials tuning could be achieved with custom target classes derived from class or from any or or class. Custom target objects must be registered with the agent.

The default persistence implementation could be optionally replaced with custom class. This might be required for storing persistent values in a database. The custom class must be derived from abstract org.friendlysnmp.persist.PersistStorage and registered with the agent.