Load-Time Modifiers

Load-time modifiers enable dynamic setting of initial OID values each time a simulated agent is created and its configuration file is loaded.

Load-time modifiers have the following syntax:

//^type.modifer(args)^//

Where:

typevalue type returned by modifier (as defined by SMI), e.g., int, ipa, etc.
modifiermodifier name (described below), e.g., rnd()
argsmodifier-specific arguments

For example:

.1.3.6.1.2.1.1.5.0 = STRING: "switch//^int.rnd(10,1000)^//.nextian.com_//^int.unq()^//"
.1.3.6.1.2.1.4.20.1.1.//^ipa.adr(0)^// = IpAddress: //^ipa.adr(0)^//
.1.3.6.1.2.1.4.20.1.3.//^ipa.adr(1,192.168.200.100)^// = IpAddress: //^ipa.net(1,255.255.0.0)^//
ImportantIt is possible to use multiple modifiers in a single line.

Random MAC Address

Generates a random MAC address:

//^mac.rnd(prefix,separator)^//

Where:

  • prefix – prefix of a MAC address (each MAC address will start with this prefix)
  • separator – separator character between MAC address octets

For example:

.1.3.6.1.2.1.2.2.1.6.1 = STRING: "//^mac.rnd(00-11,-)^//"

Random integer modifier

Generates a random integer within a specified range:

//^int.rnd(min,max)^//

Where:

  • min – lower bound
  • max – upper bound

For example:

//^int.rnd(10,1000)^//

(returns a number between 10 and 1000, e.g. 763)

Unique integer modifier

Generates a unique integer:

//^int.unq()^//

Assigned IP Address & Network Address modifier

Assigned IP Address & Network Address modifier generates a device or a network IP address.

For IP addresses:

//^ipa.adr(idx)^//
//^ipa.adr(idx,default)^//

For network addresses:

//^ipa.net(idx)^//
//^ipa.net(idx,default)^//

Where:

  • idx – index of address entry (if 0, address is equal to the address of a given device, if greater than 0, the address is retrieved from Advanced network configuration file)
  • default – default value substituted if the address has not been found in Advanced network configuration file

If default value is not defined, then the simulator returns the address with index equals to idx%max_idx, where max_idx is the maximum number of address entries found.

For example:

.1.3.6.1.2.1.4.20.1.1.//^ipa.adr(1,127.0.0.1)^// = IpAddress: //^ipa.adr(1,127.0.0.1)^// 
.1.3.6.1.2.1.4.20.1.2.//^ipa.adr(1,127.0.0.1)^// = INTEGER: 1 
.1.3.6.1.2.1.4.20.1.3.//^ipa.adr(1,127.0.0.1)^// = IpAddress: //^ipa.net(1,255.255.255.0)^// 
.1.3.6.1.2.1.4.20.1.4.//^ipa.adr(1,127.0.0.1)^// = INTEGER: 1
.1.3.6.1.2.1.4.20.1.5.//^ipa.adr(1,127.0.0.1)^// = INTEGER: 4096
Was this page helpful?