Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-2929

Get sensor readings through libsensors library on Linux

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.0.0alpha2
    • Agent (G)
    • Linux

      Currently sensor[] item on Linux relies on our own code... Well, honestly speaking it's more or less libsensors code adapted to our coding guidelines. From time to time it stops working because of new kernel versions, new drivers, new hardware etc. as we can see in ZBX-282 and ZBX-8899 / ZBX-9678. Unfortunately, response from developers is not as prompt as it should be and users need to invent workarounds and write home-made patches which is annoying.

      Let's fully rely on libsensors in this close to hardware and therefore very complicated area. From developer perspective this seems to be all pro's and no con's solution. From user perspective this will mean additional dependency during compilation but no more headache with patches/workarounds and better support for new hardware. Moreover, users will be able to fine-tune sensor output via libsensors config files (voltage sensor labels, scaling factors and so on).

      Take my machine for example. Typing sensors -u in terminal yields:

      f8000-isa-0a00
      Adapter: ISA adapter
      +3.3V:
        in0_input: 3.376
      3VSB:
        in1_input: 3.360
      Vbat:
        in2_input: 3.280
      

      It is not convenient that I cannot get voltages using their human-readable labels:

      sensor[f8000-isa-0a00,+3.3V]                  [m|ZBX_NOTSUPPORTED] [Cannot obtain sensor information.]
      sensor[f8000-isa-0a00,3VSB]                   [m|ZBX_NOTSUPPORTED] [Cannot obtain sensor information.]
      sensor[f8000-isa-0a00,Vbat]                   [m|ZBX_NOTSUPPORTED] [Cannot obtain sensor information.]
      

      I can however query voltages using their original names:

      sensor[f8000-isa-0a00,in0]                    [d|1.688000]
      sensor[f8000-isa-0a00,in1]                    [d|1.680000]
      sensor[f8000-isa-0a00,in2]                    [d|1.640000]
      

      But values I get need to be scaled to get actual real world voltages. Scaling factors (or sometimes complicated mathematical expressions to rescale sensor readings) and info on what sensor readings mean what are known exclusively to hardware manufacturers. They pass this information to libsensors developers and eventually users can see them in sensors.conf.default provided with lm-sensors package:

      chip "f71858fg-*" "f8000-*"
      
          label in0 "+3.3V"
          label in1 "3VSB"
          label in2 "Vbat"
      
          compute in0  @*2, @/2
          compute in1  @*2, @/2
          compute in2  @*2, @/2
      

      Very good thing is that users can edit labels and fine-tune rescaling factors for their hardware (see http://lm-sensors.org/wiki/VoltageLabelsAndScaling for more info) as they wish which is very convenient. And more reasonable labels and real-world readings will be fed to Zabbix without need to rescale them.

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Votes:
            8 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: