hddtemp template (update)
Moderators: Developers, Moderators
-
- Posts: 2
- Joined: Thu Jul 03, 2008 2:27 pm
doesn't work for me!
Data Query Debug Information
+ Running data query [19].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 index'
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query device'
+ Found item [device=''] index:
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query model'
+ Found item [model=''] index:
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query unit'
+ Found item [unit=''] index:
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
separately from console:
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 index
/dev/hda
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query device
/dev/hda:/dev/hda
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query model
/dev/hda:TOSHIBA MK3021GAS
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query unit
/dev/hda:C
why doesn't take the values in XML????
+ Running data query [19].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 index'
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query device'
+ Found item [device=''] index:
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query model'
+ Found item [model=''] index:
+ Executing script query '/usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query unit'
+ Found item [unit=''] index:
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/var/www/cacti/resource/script_queries/hddtemp.xml'
separately from console:
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 index
/dev/hda
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query device
/dev/hda:/dev/hda
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query model
/dev/hda:TOSHIBA MK3021GAS
[root@localhost scripts]# /usr/bin/php -q /var/www/cacti/scripts/hddtemp.php 127.0.0.1 query unit
/dev/hda:C
why doesn't take the values in XML????
-
- Posts: 2
- Joined: Thu Jul 03, 2008 2:27 pm
doesn't work for me!
sorry for double post
i am getting this with my 1st HD:
while hddtemp seems to be working fine:
[root@smeserver hddtemp]# hddtemp /dev/hda
/dev/hda: WDC WD2500SB-01KBC0: 36°C
Code: Select all
[root@smeserver hddtemp]# telnet 127.0.0.1 7634
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
|/dev/hda|WDC WD2500SB-01KBC0|UNK|*|Connection closed by foreign host.
[root@smeserver hddtemp]#
[root@smeserver hddtemp]# hddtemp /dev/hda
/dev/hda: WDC WD2500SB-01KBC0: 36°C
I had trouble getting any version to work. Currently on v1.0
my output from telnet
and
So something's not right there.
looking in hddtemp.php
i found this
So column 3 is going to return C. column 2 is going to return the temp.
so change to
and I get
my output from telnet
Code: Select all
|/dev/sg0|WDC WD5000AAKS-00A7B0|34|C||/dev/sg1|Hitachi HDP725050GLA360|32|C||/dev/sg2|SAMSUNG HD501LJ|29|C||/dev/sg3|SAMSUNG HD501LJ|28|C||/dev/sg4|ST340015A|28|C||/dev/sda|WDC WD5000AAKS-00A7B0|34|C||/dev/sdb|Hitachi HDP725050GLA360|32|C||/dev/sdc|SAMSUNG HD501LJ|30|C||/dev/sdd|SAMSUNG HD501LJ|28|C||/dev/sde|ST340015A|28|C|Connection closed by foreign host.
Code: Select all
/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 127.0.0.1 query unit
/dev/sg0:C
/dev/sg1:C
/dev/sg2:C
/dev/sg3:C
/dev/sg4:C
/dev/sda:C
/dev/sdb:C
/dev/sdc:C
/dev/sdd:C
/dev/sde:C
looking in hddtemp.php
i found this
Code: Select all
function query($disks,$query){
switch ($query){
case "device" : $col = 0; break;
case "model" : $col = 1; break;
case "unit" : $col = 3; break;
so change to
Code: Select all
function query($disks,$query){
switch ($query){
case "device" : $col = 0; break;
case "model" : $col = 1; break;
case "unit" : $col = 2; break;
Code: Select all
/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 127.0.0.1 query unit
/dev/sg0:34
/dev/sg1:32
/dev/sg2:29
/dev/sg3:28
/dev/sg4:28
/dev/sda:34
/dev/sdb:32
/dev/sdc:29
/dev/sdd:28
/dev/sde:28
Hi!
I got problems getting your Template working. I'm using Version 0.8.2 with Cacti 0.8.7d.
i'm able to follow the install instructions till the point where I want to create the new graph. I select my host, select "Linux - hddtemp - disk temperature" from the Graph Type dropdown list, but the Data Query () show the following message :
edit: i solved my problem, the hddtemp.php file was in the wrong directory.
I got problems getting your Template working. I'm using Version 0.8.2 with Cacti 0.8.7d.
i'm able to follow the install instructions till the point where I want to create the new graph. I select my host, select "Linux - hddtemp - disk temperature" from the Graph Type dropdown list, but the Data Query () show the following message :
The debug information:This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.
btw: telnet to the hddtemp deamon on the target host gives me the+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/hddtemp.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 10.2.2.214 index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 10.2.2.214 query device'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 10.2.2.214 query model'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/site/scripts/hddtemp.php 10.2.2.214 query unit'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/hddtemp.xml'
+ Found data query XML file at '/usr/share/cacti/site/resource/script_queries/hddtemp.xml'
It would be very nice if someone is able to help me with my problem, this is the first time i'm using cacti.following output:
telnet 10.2.2.214 Trying 10.2.2.X.214..
Connected to 10.2.2.214.
Escape character is '^]'.
|/dev/sg1|ST3160023AS|30|C||/dev/sda|ST3160023AS|30|C|Connection closed by foreign host
edit: i solved my problem, the hddtemp.php file was in the wrong directory.
Re: hddtemp template (update)
Hi
Have installed the templates from cacti-linux-hddtemp-1.0.tar.gz but the templates for 4 or 9 disk will override each other.
A part I want to use the one of 4 disks and all models are shown the same (of the first disk) in graph template.
Nobody else has this issue?
Have installed the templates from cacti-linux-hddtemp-1.0.tar.gz but the templates for 4 or 9 disk will override each other.
A part I want to use the one of 4 disks and all models are shown the same (of the first disk) in graph template.
Nobody else has this issue?
Re: hddtemp template (update)
I wasn't able to get the hddtemp daemon working as required (segfaulting among a few other issues).
So I rolled a work around solution in the form of an xinetd service.
Thought it may be useful to someone here:
And a script:
The script could be refactored into a single perl request, but ... I got lazy, anyone else ??
Note:
The xinetd service runs as root, which is insecure.
Lock down xinetd if you plan on using this ANYWHERE besides a private lan/wan.
So I rolled a work around solution in the form of an xinetd service.
Thought it may be useful to someone here:
Code: Select all
service id-hddtemp
{
disable = no
port = 7530
socket_type = stream
protocol = tcp
wait = no
user = root
server = /root/scripts/id-hddtemp
type = unlisted
}
Code: Select all
#!/bin/bash
# CMDS
SMARTCTL="/usr/sbin/smartctl"
PERL="/usr/bin/perl"
# VARS
PARTITIONS="/proc/partitions"
# LIST THE DISKS
for DISK in $($PERL -ne 'print "$1\n" if /(sd[a-z])$/' "${PARTITIONS}")
do
MODEL=$($SMARTCTL -d sat -i "/dev/${DISK}" | $PERL -ne 'print "$1\n" if /Device Model: +([^ ]+)/')
SERIAL=$($SMARTCTL -d sat -i "/dev/${DISK}" | $PERL -ne 'print "$1\n" if /Serial Number: +([^ ]+)/')
TEMP=$($SMARTCTL -d sat -A "/dev/${DISK}" | $PERL -ne 'print "$1\n" if /^194 [^(]* ([0-9]+)/')
if [[ -z "$TEMP" ]]; then
continue;
fi
echo -n "|/dev/${DISK}|${MODEL}-${SERIAL}|${TEMP}|C|"
done
Note:
The xinetd service runs as root, which is insecure.
Lock down xinetd if you plan on using this ANYWHERE besides a private lan/wan.
Who is online
Users browsing this forum: No registered users and 4 guests