The construction of FTTB has begun and the new equipment of the Edge-core manufacturer has appeared. Naturally I wanted to fasten a new iron to Zabbix. Earlier, I acted simply - set the snmpwalk on the piece of iron and analyzed the data. This path is quite long, as the result obtained can be under several megabytes of text and it is rather difficult to find the necessary values. But there is another way - to use the device MIB. But Zabbix does not know how to work directly with MIB files. What to do?
On the forum, Zabiks found a wonderful utility
SNMP Builder for Zabbix . With its help, you can make a basic device template with its MIB and then handles it to the normal state.
I'll tell you how to do this on the example of equipment Edge-core.
Utility installation
You can download it from
the developer blog of this utility or directly
here . The blog has a brief instruction on its installation and use. But I will repeat it briefly.
1. Download the archive. The archive contains a directory and a single snmp_builder.php file.
2. Unpack the archive into the directory with the frontend.
3. Open snmp_builder.php and, if necessary, adjust the path to the location of the mib files.
define('MIBS_ALL_PATH', '/home/zabbix/public_html/snmp_builder/mibs:/usr/share/snmp/mibs');
4. Add the Snmp Builder menu item to the “Administration” menu of the frontend.
To do this, open include / menu.inc.php and in the area of 203 lines (in my version it was not 203 lines) change the code to
'label' =>S_NOTIFICATIONS
),
array( 'url' => 'locales.php' ,
'label' =>S_LOCALES
),
array( 'url' => 'snmp_builder.php' ,
'label' => 'SNMP Builder'
),
array( 'url' => 'instal.php' ,
'label' =>S_INSTALLATION,
'sub_pages' =>array( 'setup.php' , 'warning.php' )
)
)
* This source code was highlighted with Source Code Highlighter .
')
Creating a template
First we look for iron MIB. The manufacturer, unlike Siemens, did not hide its MiBs. I freely downloaded them from the official website
www.edge-core.ru .
Next, the downloaded mib is placed in any of the directories indicated in paragraph 3.
Open in the Administration / Snmp Builder menu.
We will see a similar picture:

In the
Template list, select the template in which we will add new items. I created a new blank template in advance. In the
MIB list, select the mib of our device, in the
Server field enter the device ip, in the
Community field enter the snmp community string of the device. If everything is correct, then we get the above picture. There may be a situation when there are not enough embedded mibs.

.Cannot find module (CISCO-SMI): At line 21 in / home / zabbix / public_html / snmp_builder / mibs / CISCO-IP-IF-MIB mib Cannot find module (CISCO-SMI): At line 21 in / home / zabbix /public_html/snmp_builder/mibs/CISCO-IP-IF-MIB.mib
As can be seen from the text, there is not enough CISO-SMI mib, as they say, Google in the mouth and we are looking for a not getting MIB, after finding it we place it in the MIB search paths indicated in paragraph 3 above. We repeat the operation until the errors about the missing mibs disappear.
In some cases (in mine as well), you need to adjust the snmp_builder.php code starting from line 315
foreach (glob($path. "/*.mib" ) as $filename){
if (preg_match( '/^' .preg_quote($path, '/' ). '\/(.+)\.mib$/' ,$filename,$matches)){
$result=exec( "cat " .$filename. "| grep -i 'DEFINITIONS.*::=.*BEGIN'|awk '{print $1}'" );
$cmbMibs->addItem($result,$result);
}
}
* This source code was highlighted with Source Code Highlighter .
If everything described above helped, you will see the OID tree

In this tree, select the desired table and it will appear at the top. In this table, it is enough to select the desired parameters by clicking on either the field or the column header to select all the parameters of this column. The selected items and their parameters are displayed at the bottom of the screen. You can delete them either one by one by clicking on the line with the parameter or all at once by pressing
Clear List . If the added elements suit you then click the
Save button. After clicking elements from the bottom table will be added as new item to the existing selected template.
Repeat this operation until all the necessary elements are selected.
I added interface description counters and their status for the selected switch. The state of the STP protocol was also added (interface state, port number root, device weight and number of topology changes), etc.
After adding all the necessary topics to us, it would be very nice to edit them. By default, the polling interval of all items is 60 seconds, which is clearly unnecessary. For non-critical data, such as host name, firmware version, interface alias, you can set an interval of 84600 seconds (24 hours).
With counters, the situation is a bit more complicated: an acceptable polling interval for interfaces, in my opinion, is 300 seconds and you need to change the storage format “to delta per second”.
With the value “StpPortState”, it is also necessary to convert the values into a human-readable form.
To begin, let's configure the conversion of digital values to text in the Administration / General Options / Conversion of values of the code-value pair we pull from the MIB

In the setting item we choose

At a minimum, you need to add a simple ping check to the template.

On this check, you need to hang a trigger that will work in the event that the piece of iron is not available for more than 90 seconds.

You can draw graphs of loading interfaces by IfOctets OutOctets counters

The following triggers and graphics are made by analogy.
For example, I added triggers that work when the interface loads by more than 80%, when the interface role changes in STP, with a low runtime.
I hope that this information will help you add any hardware that has a MIB to the Zabbix monitoring system.
PS: This is a continuation of my articles on zabbix: article 3 , article 2 , article 1