I have installed zabbix-sensors ( https://github.com/blind-oracle/zabbix-sensors ) on a zabbix agent. /etc/zabbix/zabbix_agentd.d/sensors.conf contains this line:
UserParameter=lmsensors.discover[*],/etc/zabbix/scripts/sensors.py $1
This file is included from /etc/zabbix/zabbix_agent.conf:
Include=/etc/zabbix/zabbix_agentd.d/*.conf
The lm-sensors package was installed correctly. The zabbix agent runs as user "zabbix". I can see that JSON data is exported when I run this:
sudo -u zabbix /etc/zabbix/scripts/sensors.py
Results in something like this:
[
{
"{#ADAPTER}": "k10temp-pci-00c3",
"{#TYPE}": "TEMP",
"{#NAME}": "Tdie",
"{#MIN}": 0.0,
"{#HIGH}": 70.0,
"{#CRIT}": 77.0,
"{#TEMP_ID}": "temp1"
},
{
"{#ADAPTER}": "k10temp-pci-00c3",
"{#TYPE}": "TEMP",
"{#NAME}": "Tctl",
"{#MIN}": 0.0,
"{#HIGH}": 80.0,
"{#CRIT}": 90.0,
"{#TEMP_ID}": "temp2"
},
{
"{#ADAPTER}": "acpitz-acpi-0",
"{#TYPE}": "TEMP",
"{#NAME}": "temp1",
"{#MIN}": 0.0,
"{#HIGH}": 18.720000000000002,
"{#CRIT}": 20.8,
"{#TEMP_ID}": "temp1"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "VOLTAGE",
"{#NAME}": "GPU core",
"{#MIN}": 0.8,
"{#HIGH}": 1.187,
"{#CRIT}": 1.3057,
"{#VOLTAGE_ID}": "in0"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "FAN",
"{#NAME}": "fan1",
"{#MIN}": 0.0,
"{#HIGH}": 0.0,
"{#CRIT}": 0.0,
"{#FAN_ID}": "fan1"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "TEMP",
"{#NAME}": "temp1",
"{#MIN}": 0.0,
"{#HIGH}": 95.0,
"{#CRIT}": 105.0,
"{#TEMP_ID}": "temp1"
}
]
I can also get actucal sensor values, for example:
# sudo -u zabbix sensors -u | grep fan1
fan1:
fan1_input: 3630.000
Next thing I did is that I have imported the zabbix-sensors template to zabbix server, and assigned this template to the given host. I can see that lmsensor discovery rules appeared in the host configuration.
Then I restart the zabbix-agentd service, and I see this in the logs:
7248:20210328:091052.879 IPv6 support: YES
7248:20210328:091052.879 TLS support: YES
7248:20210328:091052.879 **************************
7248:20210328:091052.879 using configuration file: /etc/zabbix/zabbix_agentd.conf
7248:20210328:091052.879 agent #0 started [main process]
7250:20210328:091052.879 agent #1 started [collector]
7251:20210328:091052.879 agent #2 started [active checks #1]
7248:20210328:091102.562 Got signal [signal:15(SIGTERM),sender_pid:7356,sender_uid:113, reason:0]. Exiting ...
7248:20210328:091102.562 Zabbix Agent stopped. Zabbix 5.0.9 (revision 4d07aaafe2).
7811:20210328:091139.375 Starting Zabbix Agent [private.domain.com]. Zabbix 5.0.9 (revision 4d07aaafe2).
7811:20210328:091139.375 **** Enabled features ****
7811:20210328:091139.375 IPv6 support: YES
7811:20210328:091139.375 TLS support: YES
7811:20210328:091139.375 **************************
7811:20210328:091139.375 using configuration file: /etc/zabbix/zabbix_agentd.conf
7811:20210328:091139.375 agent #0 started [main process]
7813:20210328:091139.375 agent #1 started [collector]
7814:20210328:091139.376 agent #2 started [active checks #1]
There are no errors. Everything seems to be fine. Except for the fact that "Latest data" does not show any data from sensors.
The discovery interval is 1h, and I have been running this host for at least a day.
What am I doing wrong?
UserParameter=lmsensors.discover[*],/etc/zabbix/scripts/sensors.py $1
This file is included from /etc/zabbix/zabbix_agent.conf:
Include=/etc/zabbix/zabbix_agentd.d/*.conf
The lm-sensors package was installed correctly. The zabbix agent runs as user "zabbix". I can see that JSON data is exported when I run this:
sudo -u zabbix /etc/zabbix/scripts/sensors.py
Results in something like this:
[
{
"{#ADAPTER}": "k10temp-pci-00c3",
"{#TYPE}": "TEMP",
"{#NAME}": "Tdie",
"{#MIN}": 0.0,
"{#HIGH}": 70.0,
"{#CRIT}": 77.0,
"{#TEMP_ID}": "temp1"
},
{
"{#ADAPTER}": "k10temp-pci-00c3",
"{#TYPE}": "TEMP",
"{#NAME}": "Tctl",
"{#MIN}": 0.0,
"{#HIGH}": 80.0,
"{#CRIT}": 90.0,
"{#TEMP_ID}": "temp2"
},
{
"{#ADAPTER}": "acpitz-acpi-0",
"{#TYPE}": "TEMP",
"{#NAME}": "temp1",
"{#MIN}": 0.0,
"{#HIGH}": 18.720000000000002,
"{#CRIT}": 20.8,
"{#TEMP_ID}": "temp1"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "VOLTAGE",
"{#NAME}": "GPU core",
"{#MIN}": 0.8,
"{#HIGH}": 1.187,
"{#CRIT}": 1.3057,
"{#VOLTAGE_ID}": "in0"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "FAN",
"{#NAME}": "fan1",
"{#MIN}": 0.0,
"{#HIGH}": 0.0,
"{#CRIT}": 0.0,
"{#FAN_ID}": "fan1"
},
{
"{#ADAPTER}": "nouveau-pci-0600",
"{#TYPE}": "TEMP",
"{#NAME}": "temp1",
"{#MIN}": 0.0,
"{#HIGH}": 95.0,
"{#CRIT}": 105.0,
"{#TEMP_ID}": "temp1"
}
]
I can also get actucal sensor values, for example:
# sudo -u zabbix sensors -u | grep fan1
fan1:
fan1_input: 3630.000
Next thing I did is that I have imported the zabbix-sensors template to zabbix server, and assigned this template to the given host. I can see that lmsensor discovery rules appeared in the host configuration.
Then I restart the zabbix-agentd service, and I see this in the logs:
7248:20210328:091052.879 IPv6 support: YES
7248:20210328:091052.879 TLS support: YES
7248:20210328:091052.879 **************************
7248:20210328:091052.879 using configuration file: /etc/zabbix/zabbix_agentd.conf
7248:20210328:091052.879 agent #0 started [main process]
7250:20210328:091052.879 agent #1 started [collector]
7251:20210328:091052.879 agent #2 started [active checks #1]
7248:20210328:091102.562 Got signal [signal:15(SIGTERM),sender_pid:7356,sender_uid:113, reason:0]. Exiting ...
7248:20210328:091102.562 Zabbix Agent stopped. Zabbix 5.0.9 (revision 4d07aaafe2).
7811:20210328:091139.375 Starting Zabbix Agent [private.domain.com]. Zabbix 5.0.9 (revision 4d07aaafe2).
7811:20210328:091139.375 **** Enabled features ****
7811:20210328:091139.375 IPv6 support: YES
7811:20210328:091139.375 TLS support: YES
7811:20210328:091139.375 **************************
7811:20210328:091139.375 using configuration file: /etc/zabbix/zabbix_agentd.conf
7811:20210328:091139.375 agent #0 started [main process]
7813:20210328:091139.375 agent #1 started [collector]
7814:20210328:091139.376 agent #2 started [active checks #1]
There are no errors. Everything seems to be fine. Except for the fact that "Latest data" does not show any data from sensors.
The discovery interval is 1h, and I have been running this host for at least a day.
What am I doing wrong?
Comment