Zabbix: LLD monitoring of IPMI sensors

Hello everyone, my name is Andrey. And I love iron. I also love monitoring. And finally, a real server with IPMI and other adult technologies appeared in my life. And I hope that there will be more. That is what motivates me to search for universal solutions. So: LLD detection of IPMI sensors.
What do you get out of the box:
- Detection of temperature, voltage, RPM sensors
- SDR based triggers
Well, it looks like this:

Total needed:
- Bash script
- Template
- Documentation or the Internet for renaming items
First, I’ll clarify that you must have a prepared working Zabbix 3.2 server with ipmitool installed, an IPMI host configured.
Script
It runs on the server as an external check, so it must be in the externalscripts folder , which is specified in the server configuration. The default in Ubuntu is / usr / lib / zabbix / externalscripts . Do not forget to set the appropriate rights to execute this script.
ipmi.sh
Template
For each connected node, 4 macros must be specified, namely: {$ IPMIIP}, {$ IPMIPRIV}, {$ IPMIUSER}, {$ IPMIPASS}. Their values are intuitive, except that just {$ IPMIPRIV} is the user role (ADMIN, USER, etc.). You need to make them, since in Zabbix there are no standard macros in this regard. Perhaps in the future they will appear.
A feature of the template, as in the previous article, is the double conversion of macros {$ {# X}}. It allows you to replace the names of sensors with readable ones. Agree, the “BIOS Battery Voltage” looks nicer than the “BB_3.3V_VBAT Voltage”.
All you need to do for this is to add the corresponding macro to the template list in the form:
{$ CPU1_TEMPERATURE} = CPU1
The list already has several conversions for the Intel S1200 and Asus RS300.
Some cuts
BB - BaseBoard
VR - Voltage Regulator
SSB - Server South Bridge
VR - Voltage Regulator
SSB - Server South Bridge
Template
A little bit about filtering
Not all sensors need to be read, this is a fact. For example, why do I need a total margin (Agg Margin) in temperature? For such cases, each detection has its own filter. But alas, you cannot switch it to the “does not match” mode. A possible solution is to use global regular expressions (Result FALSE). The name of the expression with the @ symbol is added to the filter.
For each of the discoveries I made for myself: IPMI-FAN, IPMI-VOLT, IPMI-TEMP (they do not fall into the template).
IPMI-FAN, IPMI-VOLT, IPMI-TEMP



A little bit about triggers
Values for trigger conditions are taken from the SDR, that is, from the controller itself. SDR fields contain 6 threshold columns: lower dangerous, lower critical, lower non-critical, upper non-critical, upper critical, upper dangerous. If the value of one of the fields is absent, then the trigger is not created. IMHO, the most logical way to change a trigger is to change the SDR fields of the device to fit your needs. How to do this - read the instructions for your controller or MP.
Total
Its zabbix