Testing attribute lookup programs – HP Transcend Traffix Manager User Manual

Page 149

Advertising
background image

Writing your own program

149

Other points to note about user-defined attribute lookup programs:

If your program exits prematurely, for example, it crashes, then the
Traffix Service stops. Therefore you must ensure that your program is
reliable.

Your program must startup within 30 seconds. This means that your
program must call

GetNextLookup

within 30 seconds. If 30 seconds

is not long enough for your program, then you can control this
time-out by setting a system environment variable

TFX_ATTRSTART_TIME

to a number of seconds, for example,

60

. Once

your machine has been rebooted, this new time-out takes effect.

Your program must complete the lookup of attributes for a device
within 30 seconds. After 30 seconds any attribute values your
program assigns are ignored. Note that this time-out can also be
controlled by setting a system environment variable

TFX_ATTRLOOK_TIME

to a number of seconds. Once your machine has

been rebooted this new time-out takes effect.

Testing Attribute

Lookup Programs

If you want to test your attribute lookup program or test a data file for
one of the standard attribute lookup programs before adding it to the
user-defined attribute program configuration file, there is a very simple
utility provided which allows you to do this. This utility can only test

GetAttribute

Should be called sometime after GetNextLookup. Takes an
attribute name as an argument. Returns the currently
assigned value of that attribute for the current device as a
string. Returns an empty string if the specified attribute is not
assigned.

SetAttribute

Should be called sometime after GetNextLookup. Takes an
attribute name and an attribute value as arguments. Assigns
the specified attribute value for the current device.

IsAttributeSet

Should be called sometime after GetNextLookup. Takes an
attribute name as an argument. Returns an integer/Boolean.
Returns 1/True if the named attribute is currently assigned for
the current device and 0/False if the named attribute is not
currently assigned for the current device.

LogError,
LogInfo

These functions take a string as an argument. The string is
logged to the Traffix Manager Event List directory, such that it
can be viewed in the Traffix Manager Event List. LogError logs
an error message, while LogInfo logs a normal informational
message.

Table 21 Functions available to lookup programs in the attripc DLL library

Function

Description

Advertising