Ad Widget

Collapse

UserParameter - get temperature and monitore it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alex.polter
    Junior Member
    • Nov 2019
    • 15

    #1

    UserParameter - get temperature and monitore it

    Hi everyone!

    So , i'm trying to get some results using UserParameter;

    In this case I have edited agentd.conf (client) and adding this command

    ####temp template####
    UserParameter=custom.temp.dev.read,cat /sys/class/thermal/thermal_zone0/temp | awk '{print substr ($1,1,2);}'
    ###################
    Where the result of cat /sys/class/thermal/thermal_zone0/temp | awk '{print substr ($1,1,2);}' is printing first two digits of current temperature.

    So how can I proceed to implement this command? I need to create Key itens ( I don't know to archive it) or just use " Show Value = As is" will be sufficient?

    Only with the UserParameter, creating the trigger will it work?

    I'm pretty sure it will not work because I don't know how to create te variable for example :custom.temp.dev.read[???] when creating the item.

    Can you guys help me ?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Step by step tutorial : https://www.zabbix.com/documentation...xtending_agent

    Comment

    • Alex.polter
      Junior Member
      • Nov 2019
      • 15

      #3
      Originally posted by Hamardaban
      Thanks Hamardaban!

      Last day I just archived it with this solution:

      create the entry on Agentd.conf as:


      TEMPLATE
      Create the temperature template

      AGENT
      #####temperature parameter#####
      #1- Uncomment AllowRoot= 0 and anable it
      UserParameter=temperatura,head -c 2 /sys/class/thermal/thermal_zone0/temp
      #remember to refresh your agent with systemctl restart zabbix-agent
      ############################
      Open your templeate then

      ITEM
      Create the Item on the template
      Name it with someting like Temperature
      Type zabbix agent
      Key temperatura (same of your UserParameter)
      Type of information Numeric (Unsigned)
      Interval 3s (select your metric)
      Units c (xen server displays it in ceusius)

      GRAPH
      Create one graph line using Y fixed to 100
      In ITEM add the item template and select the graph type and color


      Observations:

      ***head -c 2 will display only the first two digits of you first line because the temp value is given in 000000 and we need only the two first digits
      ***/sys/class/thermal/thermal_zone0/temp receive the system temperature in Ceusius (xen - redhat)


      Sorry for my bad english,
      Last edited by Alex.polter; 28-11-2019, 15:58.

      Comment

      Working...