Player APIs (BrightScript & Ja...
...
Object Reference
Networking Objects

roSnmpAgent

5min
when this object is created, it starts an snmp process that handles some standard snmp mibs such as system uptime prior to starting the snmp agent, you can register other oids for handling you can set and retrieve these by both an snmp client and the script oid values are retrieved by an snmp client without script interaction setting oid values will generate an rosnmpevent object stating that they have been changed the script event handler can then retrieve new values and take appropriate action setting an oid value from an snmp client doesn't block the client waiting on any script action; there is a short, but indeterminate, time delay for scripts to act on a value change this isn't a problem generally because of the way snmp mibs are designed if you want to provide constantly updating oid values, you can update them using either a timer or state changes the javascript equivalent is net snmp the rosnmpagent object is created with an optional roassociativearray agent = createobject("rosnmpagent") as of brightsignos 8 3 20, the default parameters below can be provided on object construction note that when both ro community and rw community are set, they must be unique values otherwise, simply provide rw community ro community string string optional optional sets the read community string rw community string string optional optional sets the write community string ifsnmpagent addoidhandler(oid string as string, writable flag as boolean, initial value as object) as boolean adds an oid handler with the following parameters to the snmp agent oid string the oid string (e g "1 3 6 1 4 1 26095 1 1 1 4 4 0") all oid strings should be numerical writable flag a boolean value indicating whether the value can be changed by an snmp client initial value the initial value, which can be either an rostring or roint the oid will reflect the type chosen here getoidvalue(oid string as string) as object returns the current value (as either rostring or roint) for a given oid setoidvalue(oid string as string, new value as object) as boolean changes the current value for a given oid the passed value can be either an rostring or roint start() as boolean starts the snmp agent call this method once all oid handlers have been registered example agent = createobject("rosnmpagent") agent addoidhandler("1 3 6 1 4 1 26095 1 1 1 4 4 0", false, "valueofoid") agent addoidhandler("1 3 6 1 4 1 26095 1 1 1 4 5 0", true, 10) agent start() ifuserdata setuserdata(user data as object) sets the user data that will be returned when events are raised getuserdata() as object returns the user data that has previously been set via setuserdata() it will return invalid if no data has been set ifmessageport setport(port as romessageport) posts messages of type rosnmpevent to the attached message port