Skip to main content

Manuale Utente (Inglese)

Setting up the SNMP server

KeeneticOS implements an SNMP server for obtaining information about the status of the Keenetic device via the SNMPv1/2c protocol. A special component, SNMP server, must be installed for it to work. You can install it on the General System Settings page in the OS Update and Component Options section by clicking Component options.

snmp-server-component-en.png

After installing the component, you need to start the SNMP server via the device's Command-line interface (CLI) using the service snmp command.

snmp-server-01-en.png

You can disable the server with the command no service snmp

snmp-server-02-en.png

After executing the command, you must save the parameters in the device's non-volatile memory using the command system configuration save

snmp-server-03-en.png

You can also specify the community, contact, and location parameters in the server settings.

snmp community — sets a new SNMP community name, default is public. The community provides simple security and verification of this text field when accessed.

snmp contact — sets the contact name (not defined by default). For convenience, you can specify the person responsible for this equipment, for example, their last name.

snmp location — sets the location of the equipment (not defined by default). For convenience, you can specify the city, street, district, room number, etc.

snmp-server-04-en.png

Let's check the SNMP operation using the free iReasoning MIB Browser application in Windows (in Linux operating systems, you can use the standard snmp package). In the connection settings, you need to specify the IP address, port (default), and SNMP community (Read Community) — public.

snmp-server-05-en.png

Download the missing MIB files. Go to the File and click Load MIBs.

snmp-server-06-en.png
snmp-server-07-en.png

After that, you can try requesting a specific OID to obtain information. For example, let's check the information specified in Contact and Location and see the device's operating time.

snmp-server-08-en.png

In addition, you can obtain all possible OIDs supported by the device using the SNMP Walk mode.

snmp-server-09-en.png

Supported MIB files can be found in the MIBs.zip file.

The OIDs available for the device can be found in the CLI Command Reference Guide, which is available in the Download Center.

Please note that the example above is for accessing the device from a local network. If you want to configure SNMP to receive device status information from an external network (the Internet), you must additionally create permission rules in the device for traffic to pass through TCP and UDP port 161.

snmp-server-10-en.png

Importante

Be sure to change the default SNMP community: public to another value. This is necessary for device security when operating on the Internet.

Then execute a query to obtain the required information. For example (query executed from Linux OS with the snmp package installed):

~ $ snmpget -v2c -ckeenetic 86.87.88.89 .1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (21111146) 2 days, 10:38:31.46

To view all interfaces and their data, follow the steps below.

In MIB Browser, go to MIB Tree > mgmt > mib-2 > interfaces > ifTable.

snmp-server-11-en.png

It displays statistics for interfaces. Right-click on ifTable and then select Table View. After that, you can see a complete table of all configured interfaces in the device and various traffic counters available on the device. For example, traffic is available both through the ports of the built-in switch and through PPPoE, L2TP, and other interfaces. The names of these interfaces are available in the ifDescr column. Traffic statistics are available in the ifInOctets/ifOutOctets columns.

snmp-server-12-en.png

To find out the specific OID for a particular interface, find that cell in the table and click on it. After that, the OID of this parameter for the desired interface will be indicated at the bottom of the table. Below is an example for the PPPoE interface, for the incoming (In) traffic counter ifInOctets (OID .1.3.6.1.2.1.2.2.1.10.29).

snmp-server-13-en.png

Please note that the interfaces branch contains 32-bit traffic counters that reset to zero when 4 GB of traffic is reached. There is another branch that contains 64-bit counters. Go to MIB Tree > mgmt > mib-2 > ifMIB > ifMIBObjects > ifXEntry.

snmp-server-14-en.png

Open the table of all interfaces and ports by clicking Table View. The ifHCInOctets parameter for ISP will be the value of bytes incoming (In) to the interface (OID .1.3.6.1.2.1.31.1.1.1.8.12), and ifHCOutOctets will be for outgoing to the interface.

snmp-server-15-en.png

You can also view the interface OID from a Linux OS with the snmp package installed. For example:

~ $ snmpwalk -v 2c -c public -O fn 192.168.1.1 |grep ISP
.1.3.6.1.2.1.31.1.1.1.1.9 = STRING: ISP