Setting up the SNMP function on the router so that you can then query OID. For this, all installation steps on the server and client side are shown. Node RED is used in the second step for a web-based display.
For the implementation with Node RED in the second step
Enable the SNMP function on the router.
You can add information to the two parameters “Contact”
and “Location”
.
For the “Operation mode”
parameter, you can restrict the query options.
For the “Listening port”
option, you can specify a port other than the standard port 161. It is important that you then always specify the port when making a request. Otherwise, a client would always use port 161 for the request if it is not specified.
Further settings can be stored under the “Authentication”
tab.
If you need more than just reading rights and need to query deeper structures of the OID. Must be activated for the admin account to access.
The question of who can make a request can be restricted again using “Allowed host”
. In this test, access was granted to everyone.
To access it, you have to make a change in the user administration.
Please select the pencil icon on the right.
Under this mask, you have to enable the “Store password unencrypted”
option for the SNMP query.
The server side of SNMP would then be set up for the time being.
For more information, you can also refer to the manual.
The queries are carried out via a Linux client on the console.
To do this, you need to install a few programs and adjust a few settings. Debian is used as the Linux system.
The “snmp” package must be installed for the query. The command
“sudo apt-get install snmp”
installs the program with all the necessary components.
Next, please install the standard MIB file for SNMP on the computer. This is set up with the command “sudo apt-get install snmp-mibs-downloader”
.
Now you still need to customize settings and store the NetModule MIB file on the computer.
First create a subdirectory in the Linux user's home directory. It is important that the file name is .snmp
. The dot before the name is important for the file.
Please change to the directory .snmp
with the command “cd”
Now a subdirectory for the NetModule MIB file must be created with mkdir
.
Next, a snmp.conf
control file for the MIB file is still needed. This can be created using the “vi”
program.
Output file contents :~/.snmp$ cat snmp.conf mibs +NB-MIB
This entry “mibs +NB-MIB”
must then be stored in this config file so that the NetModule MIB can then be accessed during queries.
You can download the NetModule MIB directly from the router.
The MIB file that you have downloaded still has to be stored in the SNMP subdirectory. This can be done with this command.
:~/.snmp$ ls mibs snmp.conf
:~/.snmp$ ls mibs/ VENDOR-MIB.txt
For the first request a snmpwalk
is used.
The second query is to test whether the NetModule MIB is stored and can be used.
If the OID is needed, you can cancel the resolution to the name or you can translate the name into an OID directly.
:~$ snmptranslate -On -IR serialNumber.0 .1.3.6.1.4.1.31496.10.40.3.0
If a query is to be carried out with SNMP v3
:~$ snmpget -v3 -l authNoPriv -u admin -a SHA -A admin2024 192.168.1.1/ serialNumber.0 NB-MIB::serialNumber.0 = STRING: 00112BFFDF16