Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


hddtemp template (update)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
cyril



Joined: 26 Aug 2006
Posts: 5
Location: France

PostPosted: Sun Aug 27, 2006 9:16 am    Post subject: hddtemp template (update) Reply with quote

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



graph_image.php.png
 Description:
Example with 9x template
 Filesize:  39.52 KB
 Viewed:  26077 Time(s)

graph_image.php.png



cacti-linux-hddtemp-0.8.1.tar.gz
 Description:

Download
 Filename:  cacti-linux-hddtemp-0.8.1.tar.gz
 Filesize:  6.04 KB
 Downloaded:  2403 Time(s)

Back to top
cyril



Joined: 26 Aug 2006
Posts: 5
Location: France

PostPosted: Sat Sep 16, 2006 11:02 am    Post subject: hddtemp template v0.8.2 Reply with quote

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.



graph_image.php.png
 Description:
9x template, monhtly view
 Filesize:  43.63 KB
 Viewed:  25843 Time(s)

graph_image.php.png



cacti-linux-hddtemp-0.8.2.tar.gz
 Description:

Download
 Filename:  cacti-linux-hddtemp-0.8.2.tar.gz
 Filesize:  6.27 KB
 Downloaded:  1795 Time(s)

Back to top
CJNE



Joined: 22 Sep 2006
Posts: 1

PostPosted: Fri Sep 22, 2006 5:34 pm    Post subject: Reply with quote

Thanks for the template, it was very easy to install given the excellent description
It was just what i was after!
Back to top
dafresh



Joined: 24 Sep 2006
Posts: 0

PostPosted: Sun Sep 24, 2006 2:59 pm    Post subject: Hllo Reply with quote

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
Back to top
dafresh



Joined: 24 Sep 2006
Posts: 0

PostPosted: Sun Sep 24, 2006 3:00 pm    Post subject: Hllo Reply with quote

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
Back to top
dafresh



Joined: 24 Sep 2006
Posts: 0

PostPosted: Sun Sep 24, 2006 3:00 pm    Post subject: Hllo Reply with quote

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
Back to top
dafresh



Joined: 24 Sep 2006
Posts: 0

PostPosted: Sun Sep 24, 2006 3:01 pm    Post subject: Hllo Reply with quote

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
Back to top
cyril



Joined: 26 Aug 2006
Posts: 5
Location: France

PostPosted: Sat Sep 30, 2006 4:16 pm    Post subject: Reply with quote

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.
Back to top
cyril



Joined: 26 Aug 2006
Posts: 5
Location: France

PostPosted: Sat Jan 20, 2007 6:50 pm    Post subject: Reply with quote

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

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

Cyril.
Back to top
ravton



Joined: 19 Jan 2004
Posts: 3

PostPosted: Tue Feb 20, 2007 3:19 pm    Post subject: Reply with quote

cyril wrote:
This template can now be downloaded from http://www.pawelko.net/Cacti/3-Hddtemp-Template-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!
Back to top
ruud
Cacti User


Joined: 22 Aug 2006
Posts: 64
Location: Rotterdam, The Netherlands

PostPosted: Tue Feb 27, 2007 2:44 pm    Post subject: Trouble creating a 6 disk setup Reply with quote

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 ??
Quote:
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')"
Back to top
sire



Joined: 30 Mar 2007
Posts: 2

PostPosted: Wed Jun 20, 2007 8:42 am    Post subject: Template for 4 disks Reply with quote

I've made a template for four disks. Please include it into the package.


cacti_graph_template_linux_hddtemp_disk_temperature_4x.xml
 Description:

Download
 Filename:  cacti_graph_template_linux_hddtemp_disk_temperature_4x.xml
 Filesize:  10.52 KB
 Downloaded:  690 Time(s)

Back to top
cyril



Joined: 26 Aug 2006
Posts: 5
Location: France

PostPosted: Thu Jun 28, 2007 3:21 pm    Post subject: Re: Template for 4 disks Reply with quote

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-Template-For-Cacti
Back to top
rs232



Joined: 19 Dec 2006
Posts: 11

PostPosted: Wed Mar 12, 2008 5:39 am    Post subject: Reply with quote

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
Back to top
E:S



Joined: 15 Mar 2008
Posts: 4

PostPosted: Sun Mar 16, 2008 6:07 pm    Post subject: Reply with quote

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group