Ad Widget

Collapse

Monitoring HDD temperature

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • UUVtQD
    Junior Member
    • Mar 2009
    • 11

    #1

    Monitoring HDD temperature

    Hi All!
    I'm trying to monitor HDD temperature on my server.
    In /etc/zabbix/zabbix_agentd.conf I add line
    Code:
    UserParameter=HDDTempSDA,hddtemp /dev/sda |cut -f3 -d":" |cut -f1 -d"°"|tr -d ' \011\015\032'
    restart the zabbix-agent, try to test it and got this:
    Code:
    [root@alfa ~]# zabbix_agentd -t HDDTempSDA
    HDDTempSDA                                    [t|25]
    This means the UserParameter HDDTempSDA is working, isn't it?

    So, I tried to add it to "Items":
    Code:
    Description:                     SDA HDD Temp
    Type:                              Zabbix Agent
    Key:                               HDDTempSDA
    Type of information:          Numeric (float)
    Units:                              C
    Use multiplier:                  Do not Use
    Update interval (in sec):     60
    Flexible intervals (sec):	No flexible intervals
    Keep history (in days):       90	  
    Keep trends (in days):        365
    Status:                            Active
    Store value:                     As is
    Applications:                    OS
    Group:                            Linux servers
    And press "Save" button.
    But after pressing "Mass update" at the bottom of "Items" page the status of HDDTempSDA is displayed as "Not supported".
    Why? What am I doing wrong?

    Thanks in advance!
    P.S. Both servers use CentOS 5.2
  • UUVtQD
    Junior Member
    • Mar 2009
    • 11

    #2
    Ok,
    i'm found error.
    Log-file zabbix-agentd contains the following:
    Code:
    /dev/sda: open: Permission denied
    How can I fix this?
    Thanks in advance.

    Comment

    • nelsonab
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2006
      • 1233

      #3
      Looks like a permissions error. Try running hddtemp as a normal user (not root) and see if you get a permissions error. You might need to provide the full path, on my system it's /usr/sbin/hddtemp

      Two ways to fix. One you can wrap sudo around this, and the other is to setuid root for hddtemp if it is not already.
      RHCE, author of zbxapi
      Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
      Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

      Comment

      • UUVtQD
        Junior Member
        • Mar 2009
        • 11

        #4
        Originally posted by nelsonab
        Looks like a permissions error. Try running hddtemp as a normal user (not root) and see if you get a permissions error. You might need to provide the full path, on my system it's /usr/sbin/hddtemp

        Two ways to fix. One you can wrap sudo around this, and the other is to setuid root for hddtemp if it is not already.
        Thanks for help!
        "sudo" does not work - require "real tty" but the idea of "setuid" - is worked!
        Thanks again for your help!

        Comment

        Working...