A dynamic trap is a trap that is sent by the SQL Anywhere Extension Agent when a simple expression involving the value of a particular property, statistic, or option is true. Dynamic traps are created in the sasnmp.ini file. The format of the trap information in the sasnmp.ini file entry is as follows:
Traptrapnum=[220.127.116.11.4.1.897.2.]oid[.dbnum] op value
trapnum is the dynamic trap number. It must start at 1 and be sequential.
oid is the OID of the property, statistic, or option. OIDs in either the SQL Anywhere MIB or the RDBMS MIB are supported. If the OID given is an invalid SQL Anywhere or RDBMS OID, the SQL Anywhere MIB prefix (18.104.22.168.4.1.897.2.) is prepended.
For information about the OIDs in the SQL Anywhere MIB, see SQL Anywhere MIB Reference.
For information about the OIDs in the RDBMS MIB, see RDBMS MIB Reference.
You can only use OIDs corresponding to database server or database properties, statistics, or options in dynamic traps.
dbnum is the database number. This field is optional, but if specified, it must match the database number of the [DBn] section of the sasnmp.ini file.
op must have one of the following values:
= or == (equality)
!=, <>, or >< (inequality)
<= or =< (less than or equal)
>= or => (greater than or equal)
< (less than)
> (greater than)
Only equality or inequality are supported for string values.
value is the value to use in the expression. String values may be enclosed in single or double quotes; these quotes are not included in the value. If you want the beginning or closing quotation marks to be included in the string, you must double them. Note that single quotes occurring within the string should not be doubled.
When setting dynamic traps, use k, m, g, or t to specify units of kilobytes, megabytes, gigabytes, or terabytes. For example, you can set a dynamic trap to fire if the current cache size exceeds 200 MB by using:
Trap1=22.214.171.124.4.1.8126.96.36.199.11.1 > 200M
You can specify as many Trap fields as you want in the sasnmp.ini file. The OID used for the trap will be
188.8.131.52.4.1.8184.108.40.206, and the data sent with the trap includes the following:
the trap number (starts at 1 for the first dynamic trap sent by the SQL Anywhere SNMP agent)
the database index
the database name trap index (from the sasnmp.ini file)
the variable name
the variable value (this is the current value of the variable, not necessarily the threshold value)
Once a dynamic trap is triggered, the trap is not be sent again until the condition that caused it to be triggered changes to FALSE and then back to TRUE again.
For example, if you have a dynamic trap set using 220.127.116.11 >= 51200K, then the trap is triggered when the server's cache size reaches 50 MB (= 51200 KB) and the dynamic trap is disabled, so no more traps are sent. The only way the trap is re-enabled is if the cache size later drops below 50 MB. You would then be notified if the cache size grew to 50 MB again.
|Trap1=1.1.5 > 10000||Trap sent when the number of bytes sent from the server is greater than 10000.|
|Trap2=18.104.22.168.22.214.171.124.126.96.36.199.1 >= 10485760||Trap sent if the size of the transaction log file is larger than 10 MB.|