The SNMP category allows you to read out the SNMP values of objects and display them in realtime. Using the example scenario of querying a switch we will discuss the requirements and execution in this article.
i-doit requires the SNMP module of PHP in order to use this category. In Debian you can install the module with the following command:
Afterwards, you have to assign the SNMP category to the desired object type in the Quick Configuration Wizard. In our example we only used the Switch object type.
Furthermore, we need a valid host address which in turn needs to be documented in the respective category of course.
In order to avoid failed attempts we test the SNMP connection "manually" by accessing the console of the server via SSH. For this purpose, we install the "snmp" package in order to be provided with the "snmpwalk" command. Afterwards, we use a standard call of the switch which will supply us with the list of all interfaces.
At this point we omit the details on the subject of SNMP and this call. Information about the OID .220.127.116.11.18.104.22.168.1.1 can be found here for example: http://www.oid-info.com/get/22.214.171.124.126.96.36.199.1
In our case the results look like this:
iso.188.8.131.52.184.108.40.206.1.1 = INTEGER: 1
iso.220.127.116.11.18.104.22.168.1.2 = INTEGER: 2
iso.22.214.171.124.126.96.36.199.1.3 = INTEGER: 3
iso.188.8.131.52.184.108.40.206.1.4 = INTEGER: 4
iso.220.127.116.11.18.104.22.168.1.5 = INTEGER: 5
iso.22.214.171.124.126.96.36.199.1.6 = INTEGER: 6
iso.188.8.131.52.184.108.40.206.1.7 = INTEGER: 7
iso.220.127.116.11.18.104.22.168.1.8 = INTEGER: 8
iso.22.214.171.124.126.96.36.199.1.9 = INTEGER: 9
iso.188.8.131.52.184.108.40.206.1.10 = INTEGER: 10
iso.220.127.116.11.18.104.22.168.1.11 = INTEGER: 11
iso.22.214.171.124.126.96.36.199.1.12 = INTEGER: 12
iso.188.8.131.52.184.108.40.206.1.13 = INTEGER: 13
iso.220.127.116.11.18.104.22.168.1.14 = INTEGER: 14
iso.22.214.171.124.126.96.36.199.1.15 = INTEGER: 15
iso.188.8.131.52.184.108.40.206.1.16 = INTEGER: 16
iso.220.127.116.11.18.104.22.168.1.17 = INTEGER: 17
iso.22.214.171.124.126.96.36.199.1.18 = INTEGER: 18
iso.188.8.131.52.184.108.40.206.1.19 = INTEGER: 19
iso.220.127.116.11.18.104.22.168.1.20 = INTEGER: 20
iso.22.214.171.124.126.96.36.199.1.21 = INTEGER: 21
iso.188.8.131.52.184.108.40.206.1.22 = INTEGER: 22
iso.220.127.116.11.18.104.22.168.1.23 = INTEGER: 23
iso.22.214.171.124.126.96.36.199.1.24 = INTEGER: 24
The query was successful and we are dealing with a 24port switch. If timeouts or similar issues arise at this point, you should check the network connectivity to verify whether SNMP is allowed under the firewall rules, the SNMP server is running and whether the i-doit server has access permissions for the SNMP server. Of course also the selected SNMP community (in our example public) has to be available.
Now we switch back to the SNMP category in i-doit. The primary IP address of the switch is automatically shown there and the standard SNMP community public is offered.
Since we are not interested in the interface indices, we will concern ourselves with the OID for the list of faulty packets per interface. This has the OID .188.8.131.52.184.108.40.206.1.1.14.x, where x stands for the index of the respective interface.
With these details we build 24 entries for the corresponding interfaces:
Afterwards, we save the category.
In the command line example the OIDs are shown with a dot. This is not necessary in the SNMP category and is therefore optional.
When you click on the category again, the SNMP values are loaded and displayed in realtime. Unfortunately, the test shows that there are packet errors in two interfaces. Therefore we conclude the practical example at this point and begin to search for the reason of the packet errors.