NetBurner 3.5.7
PDF Version
snmp_config Class Reference

SNMP agent configuration stored in the system configuration framework. More...

#include <snmp.h>

Inherits config_obj.

Public Member Functions

 snmp_config ()
 Construct the SNMP configuration object.
 
- Public Member Functions inherited from config_obj
 config_obj (config_obj &owner, const char *name, const char *desc)
 Object constructor with the parent/owner leaf parameter.
 
 config_obj (const char *name, const char *desc)
 Object constructor.
 
virtual void GetTextValue (NBString &s) override
 Get the object value as a text string to the specified NBString object.
 
virtual void GetTypeValue (NBString &s) override
 Assigns the object type value to the specified NBString object.
 

Public Attributes

config_string SysContact {"", "SysContact"}
 MIB-II sysContact: contact person for the managed node.
 
config_string SysName {"", "SysName"}
 MIB-II sysName: administratively assigned name for the managed node.
 
config_string SysLocation {"", "SysLocation"}
 MIB-II sysLocation: physical location of the managed node.
 
config_pass ReadCommunity {"public", "ReadCommunity"}
 SNMP read community string (default: "public").
 
config_pass WriteCommunity {"public", "WriteCommunity"}
 SNMP write community string (default: "public").
 
config_IPADDR4 trap_destination {"0.0.0.0", "TrapDest", "SNMP Trap destination"}
 Destination IP address for SNMP traps.
 
config_bool trap_enable_flags {false, "TrapEnable"}
 Enable or disable SNMP trap generation.
 
bool bDirty
 Flag indicating whether the configuration has been modified since last save.
 

Detailed Description

SNMP agent configuration stored in the system configuration framework.

Provides persistent configuration for the SNMP agent, including system contact information, community strings, and trap settings. Configuration values are stored using the NetBurner config_obj framework and can be modified at runtime through the configuration web interface or programmatically.

The global instance TheSnmpConfig is automatically created by the SNMP subsystem.


Expand for Example Usage

Examples

Modifying SNMP Configuration at Runtime
#include <snmp.h>
void ConfigureSnmp()
{
TheSnmpConfig.SysName = "MyDevice";
TheSnmpConfig.SysLocation = "Server Room A";
TheSnmpConfig.ReadCommunity = "myReadCommunity";
TheSnmpConfig.WriteCommunity = "myWriteCommunity";
TheSnmpConfig.trap_destination.SetFromAscii("192.168.1.100");
}
config_string SysName
MIB-II sysName: administratively assigned name for the managed node.
Definition snmp.h:285
config_pass ReadCommunity
SNMP read community string (default: "public").
Definition snmp.h:287
config_string SysLocation
MIB-II sysLocation: physical location of the managed node.
Definition snmp.h:286
config_string SysContact
MIB-II sysContact: contact person for the managed node.
Definition snmp.h:284
config_bool trap_enable_flags
Enable or disable SNMP trap generation.
Definition snmp.h:290
config_IPADDR4 trap_destination
Destination IP address for SNMP traps.
Definition snmp.h:289
config_pass WriteCommunity
SNMP write community string (default: "public").
Definition snmp.h:288
snmp_config TheSnmpConfig
Global SNMP configuration instance.

Constructor & Destructor Documentation

◆ snmp_config()

snmp_config::snmp_config ( )
inline

Construct the SNMP configuration object.

Registers with the system configuration tree under the "SNMP" category.


The documentation for this class was generated from the following file: