http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/part_export/snmp&feed=atom&action=historyFreeside:4:Documentation:Developer/FS/part export/snmp - Revision history2024-03-28T19:37:47ZRevision history for this page on the wikiMediaWiki 1.27.7http://www.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/part_export/snmp&diff=9437&oldid=prevJeremyd: Edit via perl MediaWiki framework (1.13)2015-11-18T15:38:01Z<p>Edit via perl MediaWiki framework (1.13)</p>
<p><b>New page</b></p><div>==FS::part_export::snmp==<br />
This export sends SNMP SETs to a router using the Net::SNMP package. It requires the following custom fields to be defined on a router. If any of the required custom fields are not present, then the export will exit quietly.<br />
<br />
==Required custom fields==<br />
; snmp_address - IP address (or hostname) of the router/agent; snmp_comm - R/W SNMP community of the router/agent; snmp_version - SNMP version of the router/agent<br />
==Optional custom fields==<br />
; snmp_cmd_insert - SNMP SETs to perform on insert. See [[#Formatting|"Formatting"]]; snmp_cmd_replace - SNMP SETs to perform on replace. See [[#Formatting|"Formatting"]]; snmp_cmd_delete - SNMP SETs to perform on delete. See [[#Formatting|"Formatting"]]; snmp_cmd_suspend - SNMP SETs to perform on suspend. See [[#Formatting|"Formatting"]]; snmp_cmd_unsuspend - SNMP SETs to perform on unsuspend. See [[#Formatting|"Formatting"]]<br />
==Formatting==<br />
The values for the snmp_cmd_* fields should be formatted as follows:<br />
<br />
<OID>|<Data Type>|<expr>[||<OID>|<Data Type>|<expr>[...]]<br />
<br />
; OID - SNMP object ID (ex. 1.3.6.1.4.1.1.20). If the OID string starts with a '.', then the Private Enterprise OID (1.3.6.1.4.1) is prepended.; Data Type - SNMP data types understood by [[Freeside:4:Documentation:Developer/Net/SNMP|Net::SNMP]], as well as HEX_STRING for convenience. ex. INTEGER, OCTET_STRING, IPADDRESS, ...; expr - Expression to be eval'd by freeside. By default, the expression is double quoted and eval'd with all FS&#58;&#58;svc_broadband fields available as scalars (ex. $svcnum, $ip_addr, $speed_up). However, if the expression contains a non-escaped double quote, the expression is eval'd without being double quoted. In this case, the expression must be a block of valid perl code that returns the desired value.<br />
:You must escape non-delimiter pipes ("|") with a backslash.<br />
<br />
==Examples==<br />
This is an example for exporting to a Trango Access5830 AP. Newlines inserted for clarity.<br />
<br />
; snmp_cmd_delete -<br />
:1.3.6.1.4.1.5454.1.20.3.5.1|INTEGER|50|| 1.3.6.1.4.1.5454.1.20.3.5.8|INTEGER|1|<br />
; snmp_cmd_insert -<br />
:1.3.6.1.4.1.5454.1.20.3.5.1|INTEGER|50|| 1.3.6.1.4.1.5454.1.20.3.5.2|HEX_STRING|join("",$radio_addr =~ /[0-9a-fA-F]{2}/g)|| 1.3.6.1.4.1.5454.1.20.3.5.7|INTEGER|1|<br />
; snmp_cmd_replace -<br />
:1.3.6.1.4.1.5454.1.20.3.5.1|INTEGER|50|| 1.3.6.1.4.1.5454.1.20.3.5.8|INTEGER|1||1.3.6.1.4.1.5454.1.20.3.5.1|INTEGER|50|| 1.3.6.1.4.1.5454.1.20.3.5.2|HEX_STRING|join("",$new_radio_addr =~ /[0-9a-fA-F]{2}/g)|| 1.3.6.1.4.1.5454.1.20.3.5.7|INTEGER|1|<br />
<br />
==BUGS==<br />
Plenty, I'm sure.</div>Jeremyd