NetSNMP Class | ||
Version
beta www.capesoft.com |
||
Name String (256) | The object identifier of the MIB entry (name of the MIB variable). |
Description String (1024) | A text string describing the MIB variable. Usually this tells you more about the variable, it's function, etc |
Name String (256) | The object identifier of the MIB entry (name of the MIB variable). |
ValueType long | The type of value that the MIB entry holds. See the Equates section. |
Access string(20) | Access Permission to the MIB variable. This restricts the actions that any network element
may perform on the variable. This can be one of:
|
Status string(20) | This is the implementation status of this object. It can be one of:
|
Description String (1024) | A text string describing the MIB variable. Usually this tells you more about the variable, it's function, etc. |
Value String (256) | The actual value of the variable. The value may be a long, ulong or string, depending on the ValueType. |
BSsize long | In the case that the ValueType is a bitstring, this holds the length of the bitstring in bytes. |
BSbits long | In the case that the ValueType is a bitstring, this holds the number of unused bits in the last byte of the bitstring. |
CommunityName String (128 | The name of the community. |
Permission long | The access permission any member of the above community has to it's MIB view on the agent (the collection of subtrees of the MIB that it is allowed to access). This can be one of NetSNMP:ReadOnly or NetSNMP:ReadWrite. |
CommunityName String (128) | The name of the community. This name may appear more than once - once for every subtree of the MIB that members of this community are allowed to access. |
SubTree String (256) | The object identifier of the root of the subtree in this MIB view. As an example, if 'Public' was the name of a community that was allowed access to subtrees with roots 1.3.6.1.2.1.1 and 1.3.6.1.2.1.2 then there would be two entries for 'Public' in this queue, namely ('Public', '1.3.6.1.2.1.1') and ('Public', '1.3.6.1.2.1.2'). |
Name String (256) | The object identifier (name) of the MIB variable. |
ValueType long | The type of value that this Variable Bindings List entry holds. See the Equates section. |
Value String (256) | The actual value of the variable. This may be a long, ulong or string, depending on the ValueType |
BSsize Long | In the case that the ValueType is a bitstring, this holds the length of the bitstring in bytes. |
BSbits Long | In the case that the ValueType is a bitstring, this holds the number of unused bits in the last byte of the bitstring. |
Description String (1024) | A text string describing the MIB variable. Usually this tells you more about the variable, it's function, etc. |
NetSNMP:BitString | A string of bits
(zeroes and ones). In this implementation this is stored in a usual string
with each individual bit in the bitstring being represented by the corresponding
bit in the string.
For example, if our bitstring is 11101001101 and our usual clarion
string that holds this is bstring then we would set Since there might be some trailing zeroes at the end of a bitstring that are relevant, it is important that the length in bytes that the bitstring takes up as well as the number of unused bits in the last byte are recorded. |
NetSNMP:Counter | This is a value used to represent a count. It is stored in a long and can have a value from 0 to 2e32 - 1. |
NetSNMP:Gauge | This is a non-negative integer (stored in a long) having a value that may range between 0 and 2e32 - 1. Usually however, there are maximum and/or minimum values for this range and whenever the value goes above or below these limits the maximum/minimum value is maintained. |
NetSNMP:Integer | This is just the usual integer (stored in a long) with a value ranging from -2e31 to 2e31- 1. |
NetSNMP:IPAddress | This is just a usual IP address stored in a usual Clarion string e.g. myIpAddress = '196.2.141.67' |
NetSNMP:NetworkAddress | This is the same thing as NetSNMP:IPAddress, although it was initially intended to store any type of network address. |
NetSNMP:Null | The value of the involved variable is null. |
NetSNMP:ObjectIdentifier | Indicates that the value of the variable is an object identifier, i.e. a name of a variable in the MIB. This is stored in a usual Clarion string. Currently this implementation only supports object identifiers that are written in dot notation with integers only, i.e. 1.3.6.1.2.1.2 is an acceptable object identifier but interfaces is not, although they refer to the same object. |
NetSNMP:Opaque | Used to specify octets (bytes) of binary information. Stored in a usual Clarion string. |
NetSNMP:String | (also called an OCTETSTRING in SNMP) This is the same as the usual string in clarion. |
NetSNMP:TimeTicks | This is a non-negative integer ranging from 0 to 2e32 - 1 stored in a long. It is used to specify the time between two events in one-hundredths of a second. |
AgentAddr String(128) | This should be set before SendTrap() is called, and is given a value when a trap packet is received in ProcessTrap(). It is the network address of the network element that generated the trap. |
Community String(128) | This should be set to the name of an appropriate SNMP community to which this object (network element) belongs before a GetValue(), SetValue(), or GetNextValue() operation is performed. If the object belongs to more than one community, the community name that will give it the required access rights to perform the desired operation should be included. |
qCommunityProfiles Queue (NetSNMP:ComProfilesQueueType) | This is a list
of community profiles on the agent. Each community name is specified
in this queue together with an MIBView name (which is a collection
of subtrees that a member of this community may access) and an access
permission (which indicates whether a member of this community has read
or write access to variables in the MIBView). For more details see
NetSNMP:ComProfilesQueueType and the
MIBViews
property. |
Enterprise String(128) | This should be
set before SendTrap() is called,
and is given a value when a trap packet is received in
ProcessTrap().
This is an object identifier under whose registration authority this
trap is defined (for enterprise specific traps). |
ErrorIndex long | This is given
a value when a response to a GetValue(),
GetNextValue() or
SetValue() is received from an agent. If
ErrorStatus is zero, this will be too. If an error that occurred
on the agent and was caused as a result of a specific entry in the
VarBindList,
ErrorIndex will contain the position of that variable in the list. Otherwise
ErrorIndex will be zero. |
ErrorStatus long | This is given
a value when a response to a GetValue(),
GetNextValue() or
SetValue() is received from an agent, and the best place
where this value can be obtained is in the
ProcessResponse()
procedure. If this has a value other than 0 (NetSNMP:NoError) then the
requested operation was not performed on the agent. It's value will
be one of the following:
|
GenericTrap long | This should be
set before SendTrap() is called,
and is given a value when a trap packet is received in
ProcessTrap().
This will be one of:
|
qMIBEntries Queue (NetSNMP:MIBQueueType) | This queue is
intended to contain all of the variables in this particular agent's
MIB. The variables should be ordered in this queue as was explained
earlier in the
The
NetSNMP Object section. When an agent receives a request to get
or set an MIB variable, this is where the variable and it's value is
obtained or changed. See NetSNMP:MIBQueueType
for a complete description of the queue fields. |
qMIBViews Queue (NetSNMP:MIBViewsQueueType) | This is a list
of SNMP communities and the subtrees of the agent's MIB that members
of the community may access. If a view contains more than one subtree,
the Name of the view appears once next to each subtree in this queue
(i.e. for each subtree there is a separate entry in this queue). For
More details see NetSNMP:MIBViewsQueueType
and CommunityProfiles. |
RequestID long | This should be
assigned a number before a GetValue(),
SetValue or
GetNextValue() operation is performed on an agent. When a
request to perform this operation is sent to the agent, the response
the agent sends back contains this exact same
RequestID to identify which request the response is to. |
SendAuthFailureTrap byte | If this is set
to true, an authentication failure trap will be sent when authentication
on a received SNMP message fails. Otherwise no trap will be sent.
This field is meant for use on an SNMP
agent. |
SNMPVersion long | The version of
SNMP that is being used. Although there are three SNMP versions, this
implementation currently only supports SNMP version one and hence this
should be set to zero (not one). |
SpecificTrap long | This should be
set before SendTrap() is called,
and is given a value when a trap packet is received in ProcessTrap().
If GenericTrap has a value of
NetSNMP:enterpriseSpecific,
this will contain a value indicating what kind of trap this is (this
depends on the implementation). |
TimeStamp long | This should be
set before SendTrap() is called,
and is given a value when a trap packet is received in
ProcessTrap().
It is the time that had elapsed in one hundredths of a second between
the last initialization of the network management system of the element
that generated the trap and the generation of the trap. |
ToPort long | The port to which
all SNMP packets to an agent except traps will be sent. This is set
to port 161 as default as this is the port number specified in the SNMP
specification. |
TrapToPort long | The port to which
all SNMP Trap packets to an agent will be sent. This is set to port
162 as default as this is the port number specified in the SNMP specification.
|
qVarBindList Queue (NetSNMP:VarBindListType) | This is the variable
bindings list of this object. Essentially it is a list of MIB variable
names and their corresponding values. It needs to be filled in before
doing a GetValue(),
GetNextValue(),
SetValue() or SendTrap()
operation and will be filled with information from a received SNMP packet
which can then be accessed in the ProcessResponse()
and ProcessTrap() procedures. See
NetSNMP:VarBindListType for a complete
description of the fields. |
CheckAuthenticity (), byte | This checks the
authenticity of the received SNMP message. If you want to implement any
authentication scheme other than trivial authentication (all messages
are considered authentic), your code should be placed in this procedure.
Otherwise none is necessary. The idea is to check whether the network
element that sent the packet does in fact belong to the Community whose
name was included in the packet.
When this procedure is called the SNMPVersion and Community properties will already have been extracted and given their values and the packet will only contain the remaining part of the SNMP message that was received. The packet will contain the IP address of whoever sent the packet (self.packet.ToIP). The value returned is 1 if authentication was successful (default), and 0 otherwise. This procedure is called automatically when an SNMP packet is received and the Process() procedure will receive the result and react accordingly. |
Close () | Closes any ports that are opened for listening for SNMP responses and traps. |
DescriptionMapAdd (string p_Name, string p_Description) | Adds items to the .qDescriptionMap queue. |
GetValue () |
This procedure attempts to get the values of the variables specified in the VarBindList from the agent whose IP address is specified in the packet. Before calling this procedure, the SNMPVersion, RequestID and Community properties should be set. The VarBindList should contain the Names of all the variables that you want to get, but their values do not matter. The usual NetSimple properties required to send a packet should also be set. The result is received in the ProcessResponse() procedure. It may however be the case that no reply is received if a "serious" error occurs on the agent's side (for example, it doesn't support SNMP or the included community string is invalid). |
GetNextValue () | This is similar to GetValue(), and the properties that have to be set are exactly the same. This procedure is generally used for retrieving tables from the MIB of the agent.|
Open (ushort port = 161, ushort trapPort = 162) | Port is the port that the object will listen on for Response packets, and TrapPort is the port it will listen on for Trap packets. It is recommended that the default ports are used as they are the ones specified in the SNMP specification. Opens ports Port and TrapPort for listening for SNMP packets. |
ProcessResponse () | This is where the result of a GetValue(), SetValue()
or GetNextValue() operation becomes available. If you intend doing anything
with the received information you must place your code to do that in here. The RequestID will contain the value of the RequestID that was set when the original GetValue(), SetValue() or GetNextValue() operation was performed. If no error occurred, the ErrorStatus and ErrorIndex properties will be zero, otherwise they will contain the received values indicating the nature of the error. If no error occurred, the VarBindList will contain the following values:
|
ProcessTrap () | Whenever a Trap
packet is received by this object, this is where the received information
becomes available. If you intend doing anything with the received information
you must place your code to do that in here. The Enterprise, AgentAddr, GenericTrap, SpecificTrap and TimeStamp properties will all contain the values received. The VarBindList will possibly be empty or will contain information that the agent considered to be useful, depending on the kind of trap that was generated (as indicated by GenericTrap). |
SendTrap () | This procedure is used by an agent to send a Trap packet to the management station (whose
IP address is specified in the packet) to inform it that an important event has occurred. Before calling this procedure, the SNMPVersion and Community properties should be set. The Enterprise, AgentAddr, GenericTrap, SpecificTrap and TimeStamp properties should also be set. The VarBindList is meant to contain information that may be interresting to the receiving entity. The trap will be received by the management station in the ProcessTrap() procedure. |
SetValue () | This procedure attempts to set the values of the variables specified in the
VarBindList on the agent whose IP address is specified in the
packet. Before calling this procedure, the SNMPVersion, RequestID and Community properties should be set. The VarBindListshould contain the Names of all the variables that you want to set, and the corresponding Values that you want to set them to. The ValueType fields in the VarBindList should match the ValueType fields of the variables in the agent's MIB (see Equates). The usual NetSimple properties required to send a packet should also be set. A response is sent from the agent to indicate the level of success and is received in the ProcessResponse() procedure. It may however be the case that no reply is received if a "serious" error occurs on the agent's side (for example, it doesn't support SNMP or the given community string is invalid). |