CDEF problem

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
STnT
Posts: 9
Joined: Tue May 04, 2010 3:51 am

CDEF problem

Post by STnT »

I'm trying to get the used HD-space in percentage to show in the legend of the graph

got as far as showing an extra line in the legend (see graph.jpeg)

what did I do :
- made a CDEF named HD percentage(see CDEF.jpeg)
- added a new graph template item (see graph_template.jpeg)

As you can see it displays 0.00
Attachments
graph_template.jpg
graph_template.jpg (78.24 KiB) Viewed 1544 times
CDEF.jpg
CDEF.jpg (50.15 KiB) Viewed 1544 times
graph.jpg
graph.jpg (40.21 KiB) Viewed 1544 times
French_Poul
Cacti User
Posts: 105
Joined: Thu Apr 08, 2010 4:17 am
Location: France

Post by French_Poul »

I don't think it will resolve your problem, but it isn't it :
CURRENT_DATA_SOURCE CURRENT_DS_MAXIMUM_VALUE / 100 *
instead of
CURRENT_DS_MAXIMUM_VALUE CURRENT_DATA_SOURCE / 100 *
?

And if you want to have a percentage "font", you can add a Gprint (console > graph management > --- Gprint presets) ; you name it "percent_gprint" for example, and you put this : %7.4lf%%. And in the graph template item, you will choose this Gprint. And you will have a number like 0.012%. But this doesn't answer to your post...
"Sorry for my english... I'm french!"
Cacti version : 0.8.7e
Plugin Architecture : 2.6
Plugins : Settings 0.5, Monitor 0.8.2, Thresholds 0.4.1, Nectar 0.26, Discovery 0.9, Realtime 0.32, Update 0.4, Weathermap 0.97a, Hostinfo 0.2
STnT
Posts: 9
Joined: Tue May 04, 2010 3:51 am

Post by STnT »

when I switch them I get a nan
so if I'm correct the CURREN_DS_MAXIMUM_VALUE returns 0
(devided by zero)
a sniffed around some more and discovered that the used and total values are stored 2 different rrdfiles
so I need to get 2 values out 2 different rrdfiles.
any suggestions?

the present_gprint is a nice thingy. thx
French_Poul
Cacti User
Posts: 105
Joined: Thu Apr 08, 2010 4:17 am
Location: France

Post by French_Poul »

so if I'm correct the CURREN_DS_MAXIMUM_VALUE returns 0
Yes, I think too...

We must to do : current_data/total_space*100 to obtain the percentage.
So we must have : current_data total_space / 100 * in the CDEF.
We know that : current_data = CURRENT_DATA_SOURCE ; but I think that the mistake is for the total_space, it can not be CURRENT_DS_MAXIMUM_VALUE because it returns 0...

Do you understand what I say ? (because I talk a very bad english...)

How do you obtain your total in your graph ?
"Sorry for my english... I'm french!"
Cacti version : 0.8.7e
Plugin Architecture : 2.6
Plugins : Settings 0.5, Monitor 0.8.2, Thresholds 0.4.1, Nectar 0.26, Discovery 0.9, Realtime 0.32, Update 0.4, Weathermap 0.97a, Hostinfo 0.2
STnT
Posts: 9
Joined: Tue May 04, 2010 3:51 am

Post by STnT »

I get it.
If you'd like you can included your French answer. I'm from Belgium so I know a bit of French.

I've to alter my previous post
the 2 values are located in the same rrd file

I'm using HOST MiB - Available Disk Space
turned on graph debug mode

Code: Select all

DEF:a="/var/www/cacti/rra/XX_hdd_used_9.rrd":hdd_total:AVERAGE \
DEF:b="/var/www/cacti/rra/XX_hdd_used_9.rrd":hdd_used:AVERAGE \
so the 2 values are in the same file. But how to I get de hdd_total value in the CDEF??
cacti 0.8.7e
PA 2.6

settings 0.6
thold 0.4.1
manage 0.6.1
weathermap 0.97a
French_Poul
Cacti User
Posts: 105
Joined: Thu Apr 08, 2010 4:17 am
Location: France

Post by French_Poul »

Honestly, I have never used a CDEF which use 2 values in the same file... So, I can't help you on that...

But if I obtain some information on that, I will tell you! Because, it's sure, this problem will appear for me!
"Sorry for my english... I'm french!"
Cacti version : 0.8.7e
Plugin Architecture : 2.6
Plugins : Settings 0.5, Monitor 0.8.2, Thresholds 0.4.1, Nectar 0.26, Discovery 0.9, Realtime 0.32, Update 0.4, Weathermap 0.97a, Hostinfo 0.2
STnT
Posts: 9
Joined: Tue May 04, 2010 3:51 am

Post by STnT »

fixed it!
again it s easy.

explination :
for Windows
Management --> Graph Management --> CDEFs --> add
1st:
Name : total HD space Windows
Item 1: Special Data Source --> All Data Sources (Don’t include duplicates)
Item 2: Special Data Source --> Current Graph Item Data Source
Item 3: Operator --> -
2nd:
Name : HD percentage Windows
Item 1: Special Data Source --> Current Graph Item Data Source
Item 2: Another CDEF --> total HD space Windows
Item 3: Operator --> /
Item 4: Custom String --> 100
Item 5: Operator --> *
Management --> GPRINT Presets --> add
Name : percent_gprint
GPRINT Text : %7.2lf%%
Templates --> Graph Templates --> Host MIB – Available Disk Space --> Graph Template Items --> add
Data Source : none
Color : none
Opacity : disabled
Graph Item Type : GPRINT
Consolidation Function : AVERAGE
CDEF Function : HD percentage Windows
Value : /
GPRINT Type : percent_gprint
Text Format : used in percentage :
Insert Hard Return : aanvinken
for Linux:
Management --> Graph Management --> CDEFs --> add
Name : HD percentage Linux
Item 1: Special Data Source -->Current Graph Item Data Source
Item 2: Special Data Source --> All Data Sources (don’t include duplicates)
Item 3: Operator --> /
Item 4: Custom String --> 100
Item 5: Operator --> *
Templates --> Graph Templates --> Unix – Available Disk Space --> Graph Template Items --> add
Data Source : none
Color : none
Opacity : disabled
Graph Item Type : GPRINT
Consolidation Function : AVERAGE
CDEF Function : HD percentage Linux
Value : /
GPRINT Type : percent_gprint
Text Format : used in percentage :
Insert Hard Return : aanvinken
cacti 0.8.7e
PA 2.6

settings 0.6
thold 0.4.1
manage 0.6.1
weathermap 0.97a
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests