diff --git a/docs/blog/posts/2024/srlinux-arm.md b/docs/blog/posts/2024/srlinux-arm.md
index c204234a..28df6d69 100644
--- a/docs/blog/posts/2024/srlinux-arm.md
+++ b/docs/blog/posts/2024/srlinux-arm.md
@@ -10,7 +10,7 @@ authors:
I still remember the day when we announced general availability of the SR Linux container image that everyone could just `docker pull` and start building their dream labs:
-
🚨This is not a drill🚨 🥳This day has come and I'm delighted it has happened on my birthday.
🚀Nokia makes its Data Center NOS - SR Linux - available to everybody without any regwall, paywall, licwall or any other wall typical for a vendor
The availability of a free, lightweight and fast-to-boot containerized NOS served as a catalyst for the community to start building labs as code and use the image in the CI pipelines as it was easy and quick to run it on the free runners.
However, the container image was only available for x86_64 architecture, and as a result for a long time we were saying that running SR Linux on macOS, for instance, was a "no-go".
diff --git a/docs/htmltest.yml b/docs/htmltest.yml
index af9526d9..09c7d584 100644
--- a/docs/htmltest.yml
+++ b/docs/htmltest.yml
@@ -17,6 +17,7 @@ IgnoreURLs:
- https://linkedin.com/in
- https://www.nokia.com/networks/products/service-router-linux-NOS
- https://www.nanog.org # responds with 403
+ - x.com
IgnoreDirectoryMissingTrailingSlash: true
IgnoreAltMissing: true
diff --git a/docs/snmp/snmp_framework.md b/docs/snmp/snmp_framework.md
index 32bda40d..e6804c61 100644
--- a/docs/snmp/snmp_framework.md
+++ b/docs/snmp/snmp_framework.md
@@ -15,12 +15,12 @@ The framework defines:
Built-in MIB mappings are defined in the configuration file available on the SR Linux's file system:
-```bash
+```{.bash .no-select}
cat /opt/srlinux/snmp/snmp_files_config.yaml
```
-A simple list of supported OIDs for monitoring is in `/etc/opt/srlinux/snmp/numbers.txt`, and a detailed list with script information is in `/etc/opt/srlinux/snmp/exportOids` when an `access-group` is configured. These files are created at runtime when the SNMP server is started.
+A simple list of supported OIDs for monitoring is in `/etc/opt/srlinux/snmp/numbers.txt`, and a detailed list with script information is in `/etc/opt/srlinux/snmp/exportedOids` when an `/ system snmp access-group` is configured. These files are created at runtime when the SNMP server is started.
### Table Definitions
@@ -268,7 +268,7 @@ You can create custom MIB definitions following these steps:
1. Define the mapping file: Specify paths, tables, scalars, and their structure in YAML.
2. Write the conversion script: Implement a `snmp_main` function in Python that processes the input JSON and generates SNMP objects.
-3. Add the mapping file to the list of table definitions under `/etc/opt/srlinux/snmp/snmp_files_config.yaml`.
+3. Add the mapping file to the list of table definitions to `/etc/opt/srlinux/snmp/snmp_files_config.yaml`.
/// admonition | Location of Built-in and Custom SNMP Framework Files
type: subtle-note
@@ -288,7 +288,7 @@ The Python script receives data in JSON format, including global SNMP informatio
"_snmp_info_": {
"boottime": "2024-11-11T16:42:44Z",
"datetime": "2024-11-15T19:23:29Z",
- "debug": true,
+ "debug": false,
"is-cold-boot": false,
"network-instance": "mgmt",
"platform-type": "7220 IXR-D2",
@@ -555,7 +555,7 @@ To define custom traps:
1. Define the mapping file: Define the trap triggers, contexts, and variable bindings in YAML.
2. Write the conversion script: Implement trigger events and generate trap data in the `snmp_main` function.
-3. Add the mapping file to the list of trap-definitions under `/etc/opt/srlinux/snmp/snmp_files_config.yaml`.
+3. Add the mapping file to the list of trap definitions to `/etc/opt/srlinux/snmp/snmp_files_config.yaml`.
### Input JSON Format
@@ -668,7 +668,7 @@ Place user-defined files in `/etc/opt/srlinux/snmp`.
Changes to mapping files and scripts are not automatically read by the SNMP server, a restart of the SNMP server is required.
```srl
---{ + running }--[ ]--
+--{ running }--[ ]--
A:srl1# /tools system app-management application snmp_server-mgmt restart
```
@@ -676,16 +676,20 @@ A:srl1# /tools system app-management application snmp_server-mgmt restart
Debug files are generated in `/tmp/snmp_debug/$NETWORK_INSTANCE` when `debug: true` is set in the YAML configuration file.
+* For MIBs: check `/etc/opt/srlinux/snmp/exportedOids` for your OIDs and make sure an `/ system snmp access-group` is configured.
+* For traps: check `/etc/opt/srlinux/snmp/installedTraps` for your traps and make sure a `/ system snmp trap-group` is configured.
* Input/output logs: Check `.json_input`, `.json_output`, `.console` and `.error` files for debugging script execution. The `.console` files contain output printed by the scripts and the `.error` files contain mapping and scripts errors.
* Path data: Inspect debug outputs for issues in path retrieval.
-## Example: gRPCServer MIB
+## Examples
+
+### gRPCServer MIB
Let's add a custom SNMP MIB to SR Linux at **runtime**, no feature requests, no software upgrades, by creating a gRPC server SNMP MIB 🤪.
-### Table Definition
+#### Table Definition
-Add a new table definition under `/etc/opt/srlinux/snmp/scripts/grpc_mib.yaml`.
+Add a new table definition to `/etc/opt/srlinux/snmp/scripts/grpc_mib.yaml`.
This MIB has a single index `gRPCServerName` and 6 columns; the gRPC server network instance, its admin and operational states, the number of accepted and rejected RPCs and the last time an RPC was accepted.
@@ -695,7 +699,7 @@ All of these fields can be mapped from leafs that are found under the XPath `/sy
--8<-- "https://raw.githubusercontent.com/srl-labs/srl-snmp-framework-lab/refs/heads/main/grpc_mib.yaml"
```
-### Python Script
+#### Python Script
The YAML file references a Python script called `grpc_mib.py`. It must be placed in the same directory as the `grpc_mib.yaml` file.
@@ -705,27 +709,27 @@ The script is fairly simple; it grabs the JSON input and sets some global SNMP i
--8<-- "https://raw.githubusercontent.com/srl-labs/srl-snmp-framework-lab/refs/heads/main/grpc_mib.py"
```
-### Custom MIBs File
+#### Custom MIBs File
-Reference to the YAML mapping file in the your `snmp_files_config.yaml` so that the SNMP server loads it.
+Reference the YAML mapping file in the your `snmp_files_config.yaml` so that the SNMP server loads it.
-```bash
+```{.bash .no-select}
cat /etc/opt/srlinux/snmp/snmp_files_config.yaml
```
-### SNMP Server Restart
+#### SNMP Server Restart
Restart the SNMP server process for it to load the new custom MIB definitions.
```srl
---{ + running }--[ ]--
+--{ running }--[ ]--
A:srl1# /tools system app-management application snmp_server-mgmt restart
/system/app-management/application[name=snmp_server-mgmt]:
Application 'snmp_server-mgmt' was killed with signal 9
@@ -734,11 +738,24 @@ A:srl1# /tools system app-management application snmp_server-mgmt restart
Application 'snmp_server-mgmt' was restarted
```
-And test your new MIB.
+#### Test Your New MIB
+
+You can test your new MIB using tools like `snmpwalk`.
+
+```{.bash .no-select}
+snmpwalk -v 2c -c public snmp-srl 1.3.6.1.4.1.6527.115 #(1)!
+```
+
+1. If you do not have `snmpwalk` CLI installed, you can use the docker container and setup a handy alias:
-```bash
-$ snmpwalk -v2c -c public clab-snmp-srl1 1.3.6.1.4.1.6527.115
+ ```{.bash .no-select}
+ alias snmpwalk='sudo docker run --network clab \
+ -i ghcr.io/hellt/net-snmp-tools:5.9.4-r0 \
+ snmpwalk -O n'
+ ```
+
-Have a look at `/tmp/snmp_debug` to see the input and output JSON blobs.
+Have a look at `/tmp/snmp_debug` to see the input and output JSON blobs when `debug: true` is set in the YAML configuration file.
There you have it: a user-defined SNMP MIB added to SR Linux at **runtime**, no feature request, no software upgrade needed.
-### Lab Example
+### gRPCServer Traps
+
+Similar to the SNMP MIB, let's add custom SNMP traps to SR Linux at **runtime**, no feature requests, no software upgrades, by creating a gRPC server SNMP trap 🤪. Traps are independent from MIBs and do not need a corresponding MIB that is used for SNMP gets.
+
+#### Trap Definitions
+
+Add a new trap definitions to `/etc/opt/srlinux/snmp/scripts/grpc_traps.yaml`.
+
+Two traps are defined:
+
+* **gRPCServerDown:** sent when a gRPC server goes down.
+* **gRPCServerUp:** sent when a gRPC server comes up, including at startup.
+
+Both of these traps are triggered from the `/system/grpc-server/oper-state` XPath.
+
+```{.yaml .code-scroll-lg}
+--8<-- "https://raw.githubusercontent.com/srl-labs/srl-snmp-framework-lab/refs/heads/main/grpc_traps.yaml"
+```
+
+#### Python Script
+
+The YAML file references a Python script called `grpc_traps.py`. It must be placed in the same directory as the `grpc_mib.yaml` file.
+
+The script is fairly simple; it grabs the JSON input and looks for the gRPC server name to add as a variable binding. You can add additional variable bindings to traps that are relevant if you want, but in this case we only need one for the server name. Finally it returns the output dict as a JSON blob.
+
+```{.python .code-scroll-lg}
+--8<-- "https://raw.githubusercontent.com/srl-labs/srl-snmp-framework-lab/refs/heads/main/grpc_traps.py"
+```
+
+#### Custom Traps File
+
+Reference the YAML mapping file in the your `snmp_files_config.yaml` so that the SNMP server loads it.
+
+```{.bash .no-select}
+cat /etc/opt/srlinux/snmp/snmp_files_config.yaml
+```
+
+
+
+#### SNMP Server Restart
+
+Restart the SNMP server process for it to load the new custom traps.
+
+```srl
+--{ running }--[ ]--
+A:srl1# /tools system app-management application snmp_server-mgmt restart
+/system/app-management/application[name=snmp_server-mgmt]:
+ Application 'snmp_server-mgmt' was killed with signal 9
+
+/system/app-management/application[name=snmp_server-mgmt]:
+ Application 'snmp_server-mgmt' was restarted
+```
+
+#### Test Your New Traps
+
+Test your new traps by sending them from SR Linux.
+
+```srl
+--{ running }--[ ]--
+A:srl1# /tools system snmp trap gRPCServerDown force trigger "/system/grpc-server[name=mgmt]/oper-state"
+/:
+ Trap gRPCServerDown was sent
+
+--{ running }--[ ]--
+A:srl1# /tools system snmp trap gRPCServerUp force trigger "/system/grpc-server[name=mgmt]/oper-state"
+/:
+ Trap gRPCServerUp was sent
+```
+
+You can see the traps being received on a Unix host using tools like `snmptrapd`.
+
+```{.text .no-select}
+snmptrapd -f -Lo
+```
+
+
+
+Have a look at `/tmp/snmp_debug` to see the input and output JSON blobs when `debug: true` is set in the YAML configuration file.
+
+#### Input JSON Blob
+
+```{.bash .no-select}
+cat /tmp/snmp_debug/mgmt/grpc_traps.json_input
+```
+
+
+
+There you have it: user-defined SNMP traps added to SR Linux at **runtime**, no feature request, no software upgrade needed.
+
+## MIB and Trap Lab Example
-We created [a lab](https://github.com/srl-labs/srl-snmp-framework-lab) that implements this custom gRPC server MIB that you can deploy locally or in Codespaces to try it out.
+We created [a lab](https://github.com/srl-labs/srl-snmp-framework-lab) that implements this custom gRPC server MIB and traps that you can deploy locally or in Codespaces to try it out.
## Conclusion
-The SR Linux customizable SNMP framework allows you to define your own SNMP MIBs for gets and traps that customize SNMP functionalities to specific requirements.
+The SR Linux customizable SNMP framework allows you to define your own SNMP MIBs for gets and traps that customize SNMP functionalities to your specific requirements at **runtime**, no feature request, no software upgrade needed.