I've created a Data Query for disk with the following fields :
- id => Disk serial number as it's an invariant : WD-WX21D947N976
disk => Device path /dev/sda /dev/sdb
model => The disk model : WDC WD50EZRX-00MVLB1
status => active ,idle, standby, sleeping
on_off => number between 0 and 1
power => Power consuption in W
temp => Disk Temperature from Smart attributes
up_time => Hours Disk is UP from Smart attributes
start_count => Number of disk start from Smart attributes
Code: Select all
<interface>
<name>Get Linux Disks</name>
<description>Queries a list of disks on a unix-based host with /sys/block/.</description>
<script_path>perl |path_cacti|/scripts/query_unix_disks.pl</script_path>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<arg_num_indexes>num_indexes</arg_num_indexes>
<output_delimeter>:</output_delimeter>
<index_order>dskSerial</index_order>
<index_order_type>alphabetic</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<dskSerial>
<name>Disk ID (Serial)</name>
<direction>input</direction>
<query_name>id</query_name>
</dskSerial>
<dskDevice>
<name>Disk Path</name>
<direction>output</direction>
<query_name>disk</query_name>
</dskDevice>
<dskModel>
<name>Model</name>
<direction>output</direction>
<query_name>model</query_name>
</dskModel>
<dskStatus>
<name>Status du disque</name>
<direction>output</direction>
<query_name>status</query_name>
</dskStatus>
<dskOn_Off>
<name>Etat binaire du disque</name>
<direction>output</direction>
<query_name>on_off</query_name>
</dskOn_Off>
<dskPower>
<name>Consomation</name>
<direction>output</direction>
<query_name>power</query_name>
</dskPower>
<dskTemp>
<name>Temperature</name>
<direction>output</direction>
<query_name>temp</query_name>
</dskTemp>
<dskUP_Time>
<name>Power ON hours</name>
<direction>output</direction>
<query_name>up_time</query_name>
</dskUP_Time>
<dskStart_Count>
<name>Disk Start Count</name>
<direction>output</direction>
<query_name>start_count</query_name>
</dskStart_Count>
</fields>
</interface>
I use serial as ID (unique) as they do not change at all. Device path /dev/sdX could be impacted by any drive change like adding or removing an existing disk.
I would like to use the disk /dev/sdX attibute and display it as text in the graph. However rddtool reject it and mark as Unknow as it is not an number.
do you have any solution/suggestion ?