Properties element
A property is a value configured from SMS that is specific to a device instance.
The
properties element includes zero or more
pageGroup elements.
pageGroup element
A
pageGroup defines a property sheet in the SMS Client. The
pageGroup element has one required attribute,
name. This name is used as the title for the property sheet in the SMS Client.
The
pageGroup element contains zero or more
propertyGroup elements. A
propertyGroup element defines a property grouping on a property sheet. The property grouping is
boxed in the SMS Client and uses the
name attribute for the title of the box.
Following is an example page group declaration:
<pageGroup title="Trap Destination"> <description><![CDATA[ Specify the destination agent for this SNMP trap: <ul> <li> Hostname or IP address to which this trap should be delivered. <li> UDP port the destination agent is listening on. </ul> By default a trap is sent when a host enters and leaves quarantine. You may uncheck "Send trap on unquarantine" to disable the trap that is sent when a host leaves quarantine. ]]></description> <propertyGroup name="Trap Destination"> <property name="sendto_host" displayName="Host" type="IpAddress" required="true"/> <property name="sendto_port" displayName="Port" type="Integer" required="false" min="1" max="65535" default="162"/> </propertyGroup> <propertyGroup name="Trap Options"> <property name="send_unq_trap" displayName="Send trap on unquarantine" type="boolean" default="true"/> <property name="snmp_test_oid" displayName="Test OID" type="string" regex="\d+(\.\d+)+" maxlen="100" required="true" default="1.3.6.1.4.1.10734.3.4.3.0.1"> </property> </propertyGroup> </pageGroup>
propertyGroup element
The
propertyGroup element contains zero or more
property elements. The
property element describes a property in the SMS Client and available in scripts. The
property element has many attributes. Only
name and
type are required.
Attribute | Type | Description |
name | String | Name of the property that can be accessed in scripts through the device object. |
displayName | String | Label for the property in the SMS Client. |
type | String | Value type of the property. |
required | boolean | Defines whether the user is forced to enter data in the SMS Client for this property. |
min | integer | Minimum allowed value for this property |
max | integer | Maximum allowed value for this property |
default | String | Default value for this property. If not set, booleans default to false. |
maxlen | integer | Maximum length of the property's value. |
cols | integer | Size of the input field in the SMS Client |
rows | integer | Number of rows of the input field in the SMS Client |
regex | String | Regular expression used to validate the entry in the SMS Client. See the Pattern object in the Java 1.6 documentation for more information. |
dependsTarget
dependsValue
|
String String | Specifies another property and its value(s) required for this property to be editable in the SMS Client. |
Valid property types include the following:
Type | Description | SMS Client |
string | Character string | Text area if rows > 1, otherwise Text field |
password | Password string. This value is hidden in the SMS Client, but is stored in the database as plain text. | Password field |
IpAddress | IP address | Text field with an IP Address validator |
EmailAddress | Email address | Text field with an Email Address validator |
Integer | A number | Text field |
boolean | True or false value | Checkbox |
enum | A list of values to choose from | Drop down (combo box) |
array | Collects a list of values | List |
blurb | A psuedo-property only used to display additional text in the SMS Client. | Text pane with HTML content. Uneditable. |
Script element
JavaScript code is contained within script elements. A single package can contain
multiple scripts. Trend recommends that you wrap the JavaScript code within a CDATA
tag
to avoid the need to escape special characters.
The
script element has two attributes. The
name attribute is required and is the name used to reference the script. The
depends attribute is optional and refers to one or more names of scripts included in the
same package that are referenced by the current script. This allows you to create
common functions in one script and call them from multiple scripts.
For example, most of the device packages have scripts named
RADIUSFunctions, SNMPFunctions, SNMPActionFunctions, andSNMPDeviceFunctions. RADIUSFunctions contains common functions that are available for RADIUS enforcement.
SNMPFunctions contains common functions available for any SNMP use.
SNMPActionFunctions contains common functions available for use by any action scripts.
SNMPDeviceFunctions contains common functions available for use by any device scripts. The real difference
between the last two are that certain objects are globally available for action scripts
and a different set of objects are globally available for device scripts.
<script name="test "><![CDATA[ var result = "Nothing to test"; result += "<br>"; ]]></script>
systemObjectID element
The systemObjectID element only appears in device packages and defines which systemObjectIDs
this package supports. Currently, it is only used during SNMP discovery. If two device
packages contain the same systemObjectID, it is not defined which package is selected
during SNMP discovery.
The only attribute is
oid and it is the systemObjectID returned by the device.
<!-- Supported devices --> <systemObjectID oid="1.3.6.1.4.1.43.10.27.4.1.2.4">3Com Switch 4400</systemObjectID>
There can be multiple
systemObjectID elements in a single device package.