Перейти к содержанию

Навигация

SNMP/en: различия между версиями

Новая страница: «To use the template in the device description in the configuration file, specify the field ''''device_type''''. Among all presented templates, a template with the…»
(Новая страница: «It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/…»)
(Новая страница: «To use the template in the device description in the configuration file, specify the field ''''device_type''''. Among all presented templates, a template with the…»)
Строка 160: Строка 160:
It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/wb-mqtt-snmp/templates and named config-[device-type-name].json, for example, config-test-snmp.json), which contains a basic description of the device (such as the SNMP community name) and a basic description of all its channels.
It is convenient (though not necessary) to use templates to describe devices. The template (device type) is an external configuration file (located in /usr/share/wb-mqtt-snmp/templates and named config-[device-type-name].json, for example, config-test-snmp.json), which contains a basic description of the device (such as the SNMP community name) and a basic description of all its channels.


Для использования шаблона в описании устройства в конфигурационном файле укажите поле "''device_type''". Среди всех представленных шаблонов будет выбран шаблон с таким же значением ''device_type'', при этом
To use the template in the device description in the configuration file, specify the field ''''device_type''''. Among all presented templates, a template with the same ''device_type'' value will be selected, and all fields that were not defined in the configuration file will take values from the template.
все поля, которые не были определены в конфигурационном файле, примут значения из шаблона.


Точно так же это работает с каналами. Сравнение каналов происходит по обязательному полю ''name''; если имя канала из конфигурационного файла совпадёт с именем канала в шаблоне, из шаблона будут взяты  
Точно так же это работает с каналами. Сравнение каналов происходит по обязательному полю ''name''; если имя канала из конфигурационного файла совпадёт с именем канала в шаблоне, из шаблона будут взяты  
12 063

правки