All DiskSpaces in one graph

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

All DiskSpaces in one graph

Post by idg-PM »

Hi.

During customising cacti to our requirments for our TC I noted that the design of the disk spaces is not well arranged, because of the multiplicity of logical disks.

Does there exist a template which shows all diskspaces in one graph?

Thanks a lot.

idg-pm
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

No, not by default. But you may combine several "single" graphs into a "mulitple" one using my aggregate plugin
Reinhard
User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

multiple partition percents

Post by mokeybrains »

I'm having trouble getting a CDEF to act on different pairs of data... I am trying do this:
Image

I had to go into debug mode and edit the RRDTOOL command manually to this:

Code: Select all

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-8640000 \
--end=-300 \
--title="jamon - % Used Disk Space" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--upper-limit=100 \
--vertical-label="%" \
--slope-mode \
DEF:a="/usr/local/share/cacti/rra/jamon_hdd_total_102.rrd":hdd_total:AVERAGE \
DEF:b="/usr/local/share/cacti/rra/jamon_hdd_total_102.rrd":hdd_used:AVERAGE \
DEF:c="/usr/local/share/cacti/rra/jamon_hdd_total_104.rrd":hdd_total:AVERAGE \
DEF:d="/usr/local/share/cacti/rra/jamon_hdd_total_104.rrd":hdd_used:AVERAGE \
DEF:e="/usr/local/share/cacti/rra/jamon_hdd_total_106.rrd":hdd_total:AVERAGE \
DEF:f="/usr/local/share/cacti/rra/jamon_hdd_total_106.rrd":hdd_used:AVERAGE \
DEF:g="/usr/local/share/cacti/rra/jamon_hdd_total_107.rrd":hdd_total:AVERAGE \
DEF:h="/usr/local/share/cacti/rra/jamon_hdd_total_107.rrd":hdd_used:AVERAGE \
DEF:i="/usr/local/share/cacti/rra/jamon_hdd_total_319.rrd":hdd_total:AVERAGE \
DEF:j="/usr/local/share/cacti/rra/jamon_hdd_total_319.rrd":hdd_used:AVERAGE \
CDEF:cdefa=b,a,/,100,* \
CDEF:cdefe=d,c,/,100,* \
CDEF:cdefi=f,e,/,100,* \
CDEF:cdefbc=h,g,/,100,* \
CDEF:cdefbg=j,i,/,100,* \
AREA:cdefa#4900f4:"/"  \
GPRINT:a:LAST:" Size\:%8.2lf %s"  \
GPRINT:cdefa:LAST:" - %4.2lf %s %% used\n"  \
LINE2:cdefe#CA1165:"/data"  \
GPRINT:e:LAST:" Size\:%8.2lf %s"  \
GPRINT:cdefe:LAST:" - %4.2lf %s %% used\n"  \
LINE2:cdefi#3B5276:"/usr"  \
GPRINT:e:LAST:" Size\:%8.2lf %s"  \
GPRINT:cdefi:LAST:" - %4.2lf %s %% used\n"  \
LINE2:cdefbc#EC83f7:"/var"  \
GPRINT:g:LAST:" Size\:%8.2lf %s"  \
GPRINT:cdefbc:LAST:" - %4.2lf %s %% used\n"  \
LINE2:cdefbg#FDa418:"/data2"  \
GPRINT:i:LAST:" Size\:%8.2lf %s"  \
GPRINT:cdefbg:LAST:" - %4.2lf %s %% used\n" 
I tried to create a graph template, but it only plots one line
... also, all the CDEFs only use the 'a' and 'b' data source...

Code: Select all

CDEF:cdefa=b,a,/,100,* \
CDEF:cdefe=b,a,/,100,* \
CDEF:cdefi=b,a,/,100,* \
CDEF:cdefbc=b,a,/,100,* \
CDEF:cdefbg=b,a,/,100,* \
Do I need to use SIMILAR_DATA_SOURCES_NODUPS or something other than b,a?
Last edited by mokeybrains on Fri May 11, 2007 5:40 pm, edited 1 time in total.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Bad, bad. You will need a different CDEF for all those disks. They will have to refer to the letters of the DEF's of the corresponding rrd file. Cuurently, all of them refer to DEF's a and b, respectively
Reinhard
User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

What I am looking for

Post by mokeybrains »

Feature request:

When defining a CDEF {graph management -> CDEFs}, one of the options is Special Data Source. I'd like a Special Data Source that is all Graph Input Items associated with this Graph Item. ...

A 'Graph item' can be associated with multiple 'Graph item inputs'. The cacti layout doesn't make this easy. I'd like to make a graph item that sums up 3 out of 8 inputs, another that divides input item by another ... in a user defined mater and not an 'a' 'b' fashion. A big problem I have with cacti, is that how do you know which item will be a and which b? If you rename the input items, they are resorted alphabetically... how about a method of locking them into specific slots?

Am I approaching this wrong? Should I just make a whole bunch of CDEFs? What do other people do?

--------------------------------------------------------------------------------------------
Still learning the cacti lingo -- when I figure out how to ask a
questions about cacti, sometimes the answer become apparent.
User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

Got it working!

Post by mokeybrains »

What a hard process!

Anyhow, I learned a lot and wrote a helper script that will 'replicate' sections of the graph template making the addition of lines to an existing template easier.

Here is a question for gandalf: when looking at the RRDTool Command in debug mode, all the CDEFs are run twice. How would I modify the XML to prevent this. I found that if I mucked around with the hashes inside the <items> section of the <inputs> I could change the 'a' and 'b' order... seems like an ugly hack. Will RTFM help me understand this?
:wink:
Attachments
Sample output.
Sample output.
combined_disk_used.png (32.97 KiB) Viewed 19892 times
cacti_graph_template_combined_used_disk_space_test.xml
And the graph template to do it (includes the 5 CDEFs needed).
(12.53 KiB) Downloaded 1406 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: What I am looking for

Post by gandalf »

mokeybrains wrote:Feature request:

When defining a CDEF {graph management -> CDEFs}, one of the options is Special Data Source. I'd like a Special Data Source that is all Graph Input Items associated with this Graph Item. ...

A 'Graph item' can be associated with multiple 'Graph item inputs'. The cacti layout doesn't make this easy. I'd like to make a graph item that sums up 3 out of 8 inputs, another that divides input item by another ... in a user defined mater and not an 'a' 'b' fashion. A big problem I have with cacti, is that how do you know which item will be a and which b? If you rename the input items, they are resorted alphabetically... how about a method of locking them into specific slots?
Please post to the Feature Request Forum
Reinhard
User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

Re: Got it working!

Post by idg-PM »

[quote="mokeybrains"]What a hard process!

Anyhow, I learned a lot and wrote a helper script that will 'replicate' sections of the graph template making the addition of lines to an existing template easier.

[color=indigo]Here is a question for gandalf:[/color] when looking at the [b]RRDTool Command[/b] in debug mode, all the CDEFs are run [u]twice[/u]. How would I modify the XML to prevent this. I found that if I mucked around with the hashes inside the <items> section of the <inputs> I could change the 'a' and 'b' order... seems like an ugly hack. Will [b]RTFM[/b] help me understand this?
:wink:[/quote]

In which folder I have to copy the xml.script?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

What are you talking about: XML.script? The script or the XML referring to the script? You may find help at the first link of my signature (scroll down!)
Reinhard
User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

XML.script how to ;)

Post by mokeybrains »

Import the XML file (see image below).
Click on
*Console
*Graph Management
*Add (upper right of screen)
*Pick Combined - Used Disk Space - 5 partitions
*Pick a host
*Click Create
*fill out all the partitions
(cacti wizards: how can this be automated to pre-populate paritions 1-4 with / /var /tmp /usr?)
Attachments
How to import an XML file.
How to import an XML file.
HowToImportXML.png (92.09 KiB) Viewed 19727 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

No such thing as pre-polutaion comes to my mind. You have to do it the hard way
Reinhard
User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

Re: XML.script how to ;)

Post by idg-PM »

[quote="mokeybrains"]Import the XML file (see image below).
Click on
*Console
*Graph Management
*Add (upper right of screen)
*Pick [i]Combined - Used Disk Space - 5 partitions[/i]
*Pick a host
*Click Create
*fill out all the partitions
(cacti wizards: how can this be automated to pre-populate paritions 1-4 with / /var /tmp /usr?)[/quote]

It doesn't work!?!?!?!?

I imported the template as discribed, but no graph ist shown.

What's the reason?

Thanks
idg-pm

@Reinhard: Hallo Reinhard.

Kann ich das angebotene Script einfach so im Cacti importieren? Bei mir wird daraufhin leider kein Graph angezeigt...

Vielen Dank
Pat
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: XML.script how to ;)

Post by gandalf »

idg-PM wrote:@Reinhard: Hallo Reinhard.

Kann ich das angebotene Script einfach so im Cacti importieren? Bei mir wird daraufhin leider kein Graph angezeigt...

Vielen Dank
Pat
In general, you may simply import the Template and copy any script to the scripts folder. Please make a screenshot of RRA settings before importing. Especially if you're using non-standard RRA definitions, the will be overwritten by the template
Ja, man kann das Template einfach importieren. RRA Settings bitte vorher ausdrucken, die werden immer ueberschrieben (wenn es die standard Einstellungen sind ist das nicht weiter schlimm). Wenn ein Skript dabei ist, bitte nicht vergessen dieses in das ./scripts Verzeichnis zu kopieren
Reinhard
User avatar
mokeybrains
Posts: 42
Joined: Mon Aug 22, 2005 9:39 pm
Location: San Francisco, CA
Contact:

Re: XML.script how to ;)

Post by mokeybrains »

idg-PM wrote: It doesn't work!?!?!?!?

I imported the template as discribed, but no graph ist shown.
Du hast template gemacht Hast du jetzt die graph machen? Du must alles lesen, meine Freund!

------------
haha, haven't used German in a long time. Anyhow, follow ALL the steps. Import the graph is one step, making the graph is another.
User avatar
idg-PM
Posts: 13
Joined: Thu Apr 26, 2007 3:59 am
Location: Koeln, Germany

Re: XML.script how to ;)

Post by idg-PM »

[quote="mokeybrains"][quote="idg-PM"]
It doesn't work!?!?!?!?

I imported the template as discribed, but no graph ist shown.
[/quote]

Du hast template gemacht Hast du jetzt die graph machen? Du must alles lesen, meine Freund!

------------
haha, haven't used German in a long time. Anyhow, follow ALL the steps. Import the graph is one step, making the graph is another.[/quote]

I read everything :D , and created the graph after the import. I observed the graph during a day working but no lines are schown.

Don't know the reason. I try to import it again and copy the same script to the scipt folder as Reinhard added.

I'll tell, if it works....

Pat
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests