diff options
author | hagbard <vyosdev@derith.de> | 2019-07-15 13:07:11 -0700 |
---|---|---|
committer | hagbard <vyosdev@derith.de> | 2019-07-15 13:07:11 -0700 |
commit | be3bd2bac3e586b42c890042555ce0fed1cd1647 (patch) | |
tree | 838b1ab4d42eaf3f453740db5f517cfcaca5487f /docs/services | |
parent | 3bbf15aba8375c5425b0c33d5c775acf733b72a9 (diff) | |
download | vyos-documentation-be3bd2bac3e586b42c890042555ce0fed1cd1647.tar.gz vyos-documentation-be3bd2bac3e586b42c890042555ce0fed1cd1647.zip |
[SNMP] T1299 - documentation for snmp script extension
Diffstat (limited to 'docs/services')
-rw-r--r-- | docs/services/references.rst | 2 | ||||
-rw-r--r-- | docs/services/snmp.rst | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/docs/services/references.rst b/docs/services/references.rst index 6e6e9595..3a2f4b74 100644 --- a/docs/services/references.rst +++ b/docs/services/references.rst @@ -10,4 +10,4 @@ .. _Squid3: http://www.squid-cache.org/ .. _Squidguard: http://www.squidguard.org/ .. _TFTP: https://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol - +.. _`arbitrary extension commands`: http://net-snmp.sourceforge.net/docs/man/snmpd.conf.html#lbAZ diff --git a/docs/services/snmp.rst b/docs/services/snmp.rst index e11e3969..5609de4d 100644 --- a/docs/services/snmp.rst +++ b/docs/services/snmp.rst @@ -176,5 +176,31 @@ After commit the resulting configuration will look like: } } +SNMPv3 Extensions +^^^^^^^^^^^^^^^^^ + +To extend SNMP agent functionality, custom scripts can be executed every time the agent is being called. +This can be achieved by using `arbitrary extension commands`_. +The first step is to create a functional script of course, then upload it to your VyOS instance via the command ``scp your_script.sh vyos@your_router:/config/user-data``. +Once the script is uploaded, it needs to be configured via the command below. + + +.. code-block:: sh + + set service snmp script-extensions extension-name my-extension script your_script.sh + commit + + +The OID ``.1.3.6.1.4.1.8072.1.3.2.3.1.1.4.116.101.115.116``, once called, will contain the output of the extension. + +.. code-block:: sh + + root@vyos:/home/vyos# snmpwalk -v2c -c public 127.0.0.1 nsExtendOutput1 + NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."my-extension" = STRING: hello + NET-SNMP-EXTEND-MIB::nsExtendOutputFull."my-extension" = STRING: hello + NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."my-extension" = INTEGER: 1 + NET-SNMP-EXTEND-MIB::nsExtendResult."my-extension" = INTEGER: 0 + + .. include:: references.rst |