Ad Widget

Collapse

hddtemp monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 753713
    Senior Member
    • Apr 2006
    • 137

    #1

    hddtemp monitoring

    Hi,

    I have a problem with hddtemp monitoring. The zabbix_agent are no values.
    see commands:

    home/zabbix/bin# hddtemp /dev/sda
    /dev/sda: Maxtor 6Y080M0: 35°C
    home/zabbix/bin# hddtemp /dev/sda|cut -c27-28
    34

    home/zabbix/bin# ./zabbix_agentd UserParameter=disk.temp,hddtemp /dev/sda|cut -c27-28
    home/zabbix/bin#

    root@i1rrzszabbix01:/home/zabbix/bin# hddtemp -n /dev/sda
    34

    home/zabbix/bin# ./zabbix_agent UserParameter=disksda.temp,hddtemp -n /dev/sda
    ./zabbix_agent [28868]: illegal zbx_option -- n
    usage: ./zabbix_agent [-Vhp] [-c <file>] [-t <metric>]


    How can I produce output?

    Christian
    Last edited by 753713; 09-04-2008, 16:22.
    ______________________________
    Version : 2.0.x
    Server OS: Ubuntu 12.04
    Zabbix Servers: 12
    Monitored Windows Server: ~ 1000
    ______________________________
  • SciFi-Bob
    Junior Member
    • May 2008
    • 1

    #2
    I fiddled a bit before I got this to work, but here is my solution on debian. It may differ on other distro's.

    First, for the zabbix user to be able to execute 'hddtemp', you need to add a line to /etc/sudoers (use visudo to edit that file):

    Code:
    zabbix   ALL=NOPASSWD:  /usr/sbin/hddtemp
    Next, add a user parameter to zabbix_agentd.conf:

    Code:
    UserParameter=disk.temp[*],sudo hddtemp -n $1
    And last, add an item with the following key to your host in the web interface:

    Code:
    disk.temp[/dev/hda]
    I choose the 'sudo' way, because otherwise I needed to run the agent as root, or add zabbix user to the root or disk group, and that was a bit to much for my opinion.
    The reason hddtemp need to run as root, is that all the disk devices in /dev are owned by root:disk, and others have no access.

    As I said in the beginning, this may be different on other distros, but it works on Debian/Ubuntu.

    Comment

    Working...