![Asentria Teleboss 850 Скачать руководство пользователя страница 166](http://html.mh-extra.com/html/asentria/teleboss-850/teleboss-850_user-manual_2981745166.webp)
TeleBoss 850 2.06.280_STD User Manual
Page 160
Additionally these settings are tied to SNMP variables so that they are available to any SNMP based network
management system available. This allows the script to be able to send and receive data via SNMP and thereby
creating the possibility of our units acting as a true SNMP proxy for another device.
scripting.nvstring[x]
= SNMP object: scrNonVolatileString.x
scripting.nvint[x]
= SNMP object: scrNonVolatileInt.x
scripting.vstring[x]
= SNMP object: scrVolatileString.x
scripting.vint[x]
= SNMP object: scrVolatileInt.x
a script can read and write SNMP values. This allows a script to actually
and easily act as a proxy for a device that is not already SNMP compatible. This has very broad range application.
Some simple examples are:
1. Displaying the last 50 lines of a log file.
2. Displaying the current single strength of a radio that isn't SNMP compatible
3. Allowing the SNMP manager to issue an SNMP set and having that translated into a serial command on a
remote device.
4. Having a set of a number value issued by a Network Management System and having a value set to a
certain level on a remote non-networked device.
Which functions should a well-behaved script contain?
Any script that might run for more than a few seconds should watch for a shutdown message from the system. This is
done using the
function. The purpose of this function is to allow communication between
scripts, and to allow a script to watch for system messages.
When the script receives the Terminate message (Message ID 13808) it should stop whatever it is doing and shut
down gracefully, using the
function. If a script does not check for and respond to the Terminate message, it
will be shut down by the system about 20 seconds after the message is initially sent.
If a script uses a device, such as an IO port, for more than a couple of seconds, it should likewise listen for the Yield
Device message (Message ID 13819). This way, if a passthrough session is attempted to that port, the script could
potentially close the device so the passthrough session can use it.
How do I save frequently changing data so it survives a power cycle?
Using settings or even a temporary file to save frequently-changing non-volatile data is not a good idea, as it could
result in premature failure of the flash memory.
function to save up to 500 characters of text (or any other data that can be
stored in a Lua string). This stores the data in a special area of the database, which has provisions for being
maintained regardless of power loss. The data can be retrieved using the normal methods (i.e.
where the file is specified as AUX1 or whatever).
Note:
DIR ALL
displays a directory of all records in the unit in all files.
How can I generate an event?
A script can generate an event using the function
This function allows the script to specify event
message text, actions, class, and trap number (in case one of the specified actions is a trap). The actions are not
specified directly; rather, they are specified by passing the Setting Key of any action setting that specifies the desired
group of actions. It doesn't matter which action setting is used, as long as its setting reflects the desired action
Содержание Teleboss 850
Страница 6: ......