Ad Widget

Collapse

UserParameters with zabbix_agent2 are not in results

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Apollon77
    Junior Member
    • Dec 2023
    • 2

    #1

    UserParameters with zabbix_agent2 are not in results

    Hi,

    I use Zabbix 6.4 currently

    I want to monitor the CPU temperature and so I found https://github.com/B1T0/zabbix-basic-cpu-temperature ... these commands work and do what they should. because this seems to be for zabbix agent1 I simpüly added the 3 UserParameter lines to the zabbix_agent2.conf file like

    HTML Code:
    ### Option: UserParameter
    #       User-defined parameter to monitor. There can be several user-defined parameters.
    #       Format: UserParameter=<key>,<shell command>
    #       See 'zabbix_agentd' directory for examples.
    #
    # Mandatory: no
    # Default:
    # UserParameter=
    UserParameter=basicCPUTemp.min,sensors | grep Core | awk -F'[:+°]' '{if(min==""){min=$3}; if($3<min) {min=$3};} END {print min}'
    UserParameter=basicCPUTemp.max,sensors | grep Core | awk -F'[:+°]' '{if(max==""){max=$3}; if(max<$3) {max=$3};} END {print max}'
    UserParameter=basicCPUTemp.avg,sensors | grep Core | awk -F'[:+°]' '{avg+=$3}END{print avg/NR}'
    But when I then restart the agent and use "zabbix_agent2 --print" I do not see these new parameters.

    Is there anything else I need to do?

    Thanks for any hint,

    Ingo
  • Blevar
    Member
    • Jan 2025
    • 68

    #2
    You can test if your parameters work by running:
    Code:
    zabbix_agent2 --test "basicCPUTemp.min"
    zabbix_agent2 --test "basicCPUTemp.max"
    zabbix_agent2 --test "basicCPUTemp.avg"

    Comment

    Working...