hddtemp template (update)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

cyril
Posts: 5
Joined: Sat Aug 26, 2006 11:32 am
Location: France
Contact:

hddtemp template (update)

Post by cyril »

Hello,

I've made a template to query hddtemp deamon and graph disks temperature.
Tested with cacti 0.8.6h on fc5, debian and gentoo. It uses only php core functions, no extra librairies are needed.

INSTALLATION :
1 - Install and configure hddtemp daemon
Test it with "telnet <host> 7634" from your cacti box
Output should be similar to :
"|/dev/hda|IBM-DJNA-371350|47|C||/dev/hdc|Maxtor 6Y080L0|44|C|"
2 - Copy hddtemp.xml to resources/script_queries directory
3 - Copy hddtemp.php to scripts directory
4 - Import template file cacti_template_linux_hddtemp_disk_temperature.xml
5 - Add "Linux - hddtemp - disk temperature" data query to your host
6 - Create new graph for this host and select disks

GROUPING GRAPHS :
If you want to group several disks on the same graph :
1 - Import cacti_graph_template_linux_hddtemp_disk_temperature_2x.xml or cacti_graph_template_linux_hddtemp_disk_temperature_
9.xml templates
2 - Create a graph for each disk as described above
3 - Create a graph for your host using 2x or 9x template, let fields empty
4 - Edit the graph and select data sources previously created
5 - You can delete single-disk graphs but not data sources
NOTE : You need exactly 2 or 9 disks, or you'll have to modify the template.

There are some caveats :
- No error handling in script
- With 2x or 9x templates, rrdtool graph command is invalid if graph items don't have associated data source. Request : Could cacti simply ignore these data items ?
- When adding 2x or 9x graph, cacti creates a data source named "- Disk temperature |query_device|", I didn't manage to avoid this. Update: SOLVED in 0.8.1

Regards.

Cyril
Attachments
cacti-linux-hddtemp-0.8.1.tar.gz
(6.04 KiB) Downloaded 6338 times
Example with 9x template
Example with 9x template
graph_image.php.png (39.52 KiB) Viewed 55060 times
cyril
Posts: 5
Joined: Sat Aug 26, 2006 11:32 am
Location: France
Contact:

hddtemp template v0.8.2

Post by cyril »

Here is v0.8.2

There was a litte bug with 9x template, it is now fixed.

Cyril

PS : I didn't get any feeback until now, please let me know if you use it.
Attachments
cacti-linux-hddtemp-0.8.2.tar.gz
(6.27 KiB) Downloaded 3352 times
9x template, monhtly view
9x template, monhtly view
graph_image.php.png (43.63 KiB) Viewed 54826 times
CJNE
Posts: 1
Joined: Fri Sep 22, 2006 5:33 pm

Post by CJNE »

Thanks for the template, it was very easy to install given the excellent description :)
It was just what i was after!
dafresh
Posts: 4
Joined: Sun Sep 24, 2006 2:48 pm

Hllo

Post by dafresh »

Very nice work !

But ... (there is always one ;))

I have a probleme with the disk selection ... i dont know how the devices are find by the script, but i got this when the graph debug mode is turned on :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="BigOne - Disks temperature" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
LINE1:#FF0000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#ED5394:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#35962B:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#F5F800:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#4123A1:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#562B29:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#EE5019:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#C4FD3D:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#000000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s"

RRDTool Says:

ERROR: Not a valid vname: #FF0000 in line LINE1:#FF0000:|query_device| (|query_model|)

Maybe it's because my partitions are on raid devices and not real hard disk partitions ? ( "/" mounted on "/dev/md0" (/dev/sda1 & /dev/sdb1) ... )

If you have an idea ... ;)

Thx in advance

C
dafresh
Posts: 4
Joined: Sun Sep 24, 2006 2:48 pm

Hllo

Post by dafresh »

Very nice work !

But ... (there is always one ;))

I have a probleme with the disk selection ... i dont know how the devices are find by the script, but i got this when the graph debug_mode is turned on :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="BigOne - Disks temperature" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
LINE1:#FF0000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#ED5394:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#35962B:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#F5F800:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#4123A1:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#562B29:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#EE5019:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#C4FD3D:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#000000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s"

RRDTool Says:

ERROR: Not a valid vname: #FF0000 in line LINE1:#FF0000:|query_device| (|query_model|)

Maybe it's because my partitions are on raid devices and not real hard disk partitions ? ( "/" mounted on "/dev/md0" (/dev/sda1 & /dev/sdb1) ... )

If you have an idea ... ;)

Thx in advance

C
dafresh
Posts: 4
Joined: Sun Sep 24, 2006 2:48 pm

Hllo

Post by dafresh »

Very nice work !

But ... (there is always one ;))

I have a probleme with the disk selection ... i dont know how the devices are find by the script, but i got this when the graph debug_mode is turned on :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="BigOne - Disks temperature" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
LINE1:#FF0000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#ED5394:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#35962B:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#F5F800:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#4123A1:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#562B29:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#EE5019:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#C4FD3D:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#000000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s"

RRDTool Says:

ERROR: Not a valid vname: #FF0000 in line LINE1:#FF0000:|query_device| (|query_model|)

Maybe it's because my partitions are on raid devices and not real hard disk partitions ? ( "/" mounted on "/dev/md0" (/dev/sda1 & /dev/sdb1) ... )

If you have an idea ... ;)

Thx in advance

C
dafresh
Posts: 4
Joined: Sun Sep 24, 2006 2:48 pm

Hllo

Post by dafresh »

Very nice work !

But ... (there is always one ;))

I have a probleme with the disk selection ... i dont know how the devices are find by the script, but i got this :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="BigOne - Disks temperature" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
LINE1:#FF0000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#ED5394:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#35962B:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#F5F800:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#4123A1:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#562B29:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#EE5019:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#C4FD3D:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s\n" \
LINE1:#000000:"|query_device| (|query_model|)" \
GPRINT::LAST:"Cur\:%8.2lf%s" \
GPRINT::AVERAGE:"Avg\:%8.2lf%s" \
GPRINT::MAX:"Max\:%8.2lf%s"

RRDTool Says:

ERROR: Not a valid vname: #FF0000 in line LINE1:#FF0000:|query_device| (|query_model|)

Maybe it's because my partitions are on raid devices and not real hard disk partitions ? ( "/" mounted on "/dev/md0" (/dev/sda1 & /dev/sdb1) ... )

If you have an idea ... ;)

Thx in advance

C
cyril
Posts: 5
Joined: Sat Aug 26, 2006 11:32 am
Location: France
Contact:

Post by cyril »

Hello,

The script does not query devices, it queries hddtemp deamon. And hddtemp can query disk even if it isn't mounted since it's a REAL disk, not virtual raid disks.
Please post the results of "telnet host 7634" and/or hddtemp output on /dev/sda and sdb
It also seems you're creating a 9x template without creating single data sources.
Did you try creating single-disk graph ?
Follow carefully the first steps and tell me if it works.

Regards.
cyril
Posts: 5
Joined: Sat Aug 26, 2006 11:32 am
Location: France
Contact:

Post by cyril »

This template can now be downloaded from http://www.pawelko.net/Cacti/3-Hddtemp- ... -For-Cacti

It has been downloaded more than 200 times, and no bug was reported, I suppose it works correctly.

Cyril.
[url=http://www.pawelko.net/]http://www.pawelko.net/[/url]
ravton
Posts: 3
Joined: Mon Jan 19, 2004 6:24 pm

Post by ravton »

cyril wrote:This template can now be downloaded from http://www.pawelko.net/Cacti/3-Hddtemp- ... -For-Cacti

It has been downloaded more than 200 times, and no bug was reported, I suppose it works correctly.

Cyril.
Works great! Thanks for setting up the 9x so it's easy for everybody who has fewer drives!
User avatar
ruud
Cacti User
Posts: 64
Joined: Tue Aug 22, 2006 3:07 am
Location: Rotterdam, The Netherlands
Contact:

Trouble creating a 6 disk setup

Post by ruud »

I am having trouble creating a 6 disk setup..

I tried editing the 9 disk version back to 6 in the XML file itself and import it and i tried importing the 9 disk version and stripping 3 drives off but to no avail..

The logfile shows strange errors and 6 graphs get created without any name or anything !?!?

This is what showed up in the log after stripping 3 drives from the 9 drive import :


Any chance on somebody helping me out here ??
02/27/2007 09:50:44 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
02/27/2007 09:50:44 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
02/27/2007 09:50:44 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
02/27/2007 09:50:44 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
02/27/2007 09:50:44 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
02/27/2007 09:50:43 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"
Server #1 : Cacti 0.8.7b | cmd.php | HP Proliant DL380 G5 (Dual Core Xeon 3.2 GHz, 14 Gb, 2x73 Gb RAID1 - System + 3x73 Gb RAID5 - SQL/RRA) | Gentoo Linux
_________SYSTEM STATS: Time:114.6022 Method:cmd.php Processes:8 Threads:N/A Hosts:408 HostsPerProcess:51 DataSources:32276 RRDsProcessed:16148
sire
Posts: 2
Joined: Fri Mar 30, 2007 12:55 pm

Template for 4 disks

Post by sire »

I've made a template for four disks. Please include it into the package.
Attachments
cacti_graph_template_linux_hddtemp_disk_temperature_4x.xml
(10.52 KiB) Downloaded 1773 times
cyril
Posts: 5
Joined: Sat Aug 26, 2006 11:32 am
Location: France
Contact:

Re: Template for 4 disks

Post by cyril »

sire wrote:I've made a template for four disks. Please include it into the package.
I've released the version 1.0, the 4x template is included.
http://www.pawelko.net/Cacti/3-Hddtemp- ... -For-Cacti
[url=http://www.pawelko.net/]http://www.pawelko.net/[/url]
rs232
Posts: 14
Joined: Tue Dec 19, 2006 8:15 am

Post by rs232 »

I've followed the instructions.
When I go adding the graph to the host (Create Graph from 'Linux - hddtemp - Disk temperature') I get the following form:

Index Type :
Index Value :
Output Type ID:


What shall I put in there?

Regards
rs232
E:S
Posts: 4
Joined: Sat Mar 15, 2008 10:09 pm

Post by E:S »

Cacti[30855]: CMDPHP: ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select data_input_fields.type_code, data_input_data.value from (data_input_fields,data_input_data) where data_input_fields.id=data_input_data.data_input_field_id and data_input_data.data_template_data_id= and (data_input_fields.type_code='index_type' or data_input_fields.type_code='index_value' or data_input_fields.type_code='output_type')"

I am using 0.8.7b ! The graph is being plotted, but still I dont like the message !

Regards,
E:S
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest