Varying the AREA colour ?

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

Moderators: Moderators, Developers

Post Reply
Author
Message
UTVi Carl
Posts: 3
Joined: Fri Mar 13, 2009 2:52 pm

Varying the AREA colour ?

#1 Post by UTVi Carl » Fri Mar 13, 2009 4:08 pm

Finally got cacti working (Win2008 x64) and have started to play with templates.

This is a graph I've generated for the NPE outlet temp on one of our Cisco 7200's:
Image

In a clunky way, this shows the current temp, and the chassis thresholds (WARNING, CRITICAL and SHUTDOWN). Those are just hardcoded HRULE's right now. I've been trying to pretty it up, and so far have only managed to break the graphs with various complaints from RRD.

This is what I'd like to get to:
Image
Some of you will have noticed how much this is based on one of the nifty RRD gallery images. :)


Not seen any examples of varying AREA colour depending on value yet, and I've had no luck trying to use the various Graph Items myself, but I have become adept at completely trashing templates and graphs!

Any help or pointers appreciated.

UTVi Carl
Posts: 3
Joined: Fri Mar 13, 2009 2:52 pm

Getting closer ...

#2 Post by UTVi Carl » Sun Mar 15, 2009 7:23 am

Playing with this a little more, I've almost got there:
Image
NB data src here is a PHP script - luckily the real temp values are pretty static!

A few cosmetic bugs I'm still stuck on:
• The white space plotted on category transitions
• The background colours for NaN data [UPDATE - now fixed! :D]

I'm at a loss on the white lines, but still tinkering with the background STACK CDEF's to fix the NAN values. :-? Suggestions welcome!



This particular chassis (Cisco 7200) happens to be an ISP transit router on our network edge. Be keen to get suggestions for a new host template. So far I've got:

CPU usage (5m, 1m, 5s)
Memory usage
NPE temp INLET
NPE temp OUTLET
Interfaces (IN, OUT)
BGP peer updates (IN, OUT)

... and would like to add COPP/ACL stats and NetFlow summary.

User avatar
Vins
Cacti User
Posts: 116
Joined: Tue Sep 12, 2006 3:06 am

#3 Post by Vins » Sun Mar 15, 2009 3:50 pm

Whoa... how did you change the color background?! :o

:o :o :o

UTVi Carl
Posts: 3
Joined: Fri Mar 13, 2009 2:52 pm

#4 Post by UTVi Carl » Mon Mar 16, 2009 2:53 am

The backgrounds are built using almost transparent STACK items using CDEF's to determine if their height is 0, threshold value, or (threshold - data).

Code: Select all

CDEF:cdefa=a,44,LT,a,0,IF \
CDEF:cdefb=a,UN,0,a,IF,44,LT,44,a,UN,0,a,IF,-,0,IF \
CDEF:cdefd=a,44,58,LIMIT \
CDEF:cdefh=a,59,LT,a,44,LT,15,59,a,-,IF,0,IF \
CDEF:cdefi=a,59,GE,a,0,IF \
CDEF:cdefj=a,59,LT,21,80,a,-,IF \
To handle NAN data was a challenge - RPN is really simple and yet totally brain-bending at the same time. :-?

Here's what the graph template spits out to RRD:

Code: Select all

AREA:cdefa#35962BFF:"OK"  \
AREA:cdefb#00FF0019:"":STACK \
COMMENT:"        \n"  \
AREA:cdefd#FF7D00FF:"WARNING":STACK \
GPRINT:a:LAST:"         Current\:%8.0lf °C"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf °C"  \
GPRINT:a:MAX:"Maximum\:%8.0lf °C\n"  \
AREA:cdefh#FF7D0033:"":STACK \
AREA:cdefi#FF0000FF:"CRITICAL\n":STACK \
AREA:cdefj#FF000019:"":STACK \
LINE1:a#000000FF:"" 


I like the idea of graphs that quickly highlight thresholds (say interfaces hitting 75% usage, etc). The coloured backgrounds just give an indication of where the thresholds lie.


Still looking some pointers on getting rid of those vertical white lines - not sure where to even start on that. :-?

User avatar
Vins
Cacti User
Posts: 116
Joined: Tue Sep 12, 2006 3:06 am

#5 Post by Vins » Wed Mar 18, 2009 12:05 pm

Thanks UTVi Carl,
will experiment ASAP

8)

disH
Posts: 33
Joined: Thu May 22, 2008 2:09 am

#6 Post by disH » Sun Sep 06, 2009 9:30 pm

I think the problem with the gap can be resolved by narrowing the difference between the 2 temperatures.

Intead of your
0 - 44, 45 - 59 , 60 - *

Use:
0 - 44.99 , 45 - 59.99 , 60 - *

You get the idea.. :) share ur nice graphs please
[url=http://forums.cacti.net/viewtopic.php?t=4356]Template: Cisco CatOS[/url]
[url=http://forums.cacti.net/viewtopic.php?t=21785]Mactrack: Netscreen Fw[/url]
[b]_______________[/b]
[b]Cacti Version[/b] - 0.8.7e, [b]Plugin Architecture[/b] - 2.5, [b]Poller Type[/b] - Cact-Spine 0.8.7e
[b]Server Info[/b] - Ubuntu Server 8.10 (2.6.27-7-server), [b]Web Server[/b] - Apache/2.2.9 PHP/5.2.6-2ubuntu4.3 with Suhosin-Patch
[b]PHP[/b] - 5.2.6-2ubuntu4.3, [b]MySQL[/b] - 5.0.67-0ubuntu6-log, [b]RRDTool[/b] - 1.3.1, [b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Thresholds v0.4.1, Login Mod v1.0, Host Info v0.2

ildrad
Posts: 4
Joined: Fri Jan 18, 2013 9:06 am

Re: Varying the AREA colour ?

#7 Post by ildrad » Fri Jan 18, 2013 9:29 am

Hello, as a 100% beginner and noob with cacti, i want to copy the design of this graph but, i'm not able to do it and i don't know why. The graphic will be an analyse of a CPU usage with 2 "floors" (one at 55%, one at 80%)

i'm quite sure i copied well le CDEF :

i record the 6 ones like this (exemple of the second) :

Image

i copy in the UI, the closest i can, the lines :

Image
Image

And Finally, nothing appears when i saw the graph... & i really don't know why...

Can someone be able to help me with this ? or maybe just have an idea about this ;)

Sincerely,

Dan5ielle
Posts: 8
Joined: Sat Jan 19, 2013 2:22 am

Re: Varying the AREA colour ?

#8 Post by Dan5ielle » Sat Jan 19, 2013 2:37 am

I'm at a loss on the white lines, but still tinkering with the background STACK CDEF's to fix the NAN values.
Image
Image
Image
Image
Image

ildrad
Posts: 4
Joined: Fri Jan 18, 2013 9:06 am

Re: Varying the AREA colour ?

#9 Post by ildrad » Sun Jan 20, 2013 11:48 am

Hello,

I am sorry but my limited skills in english and my limited (close to null) knowledges with cacti do not allow me to understand your sentence... is it possible to reformulate ?

What is a NAN values ? "Not a number" ?

What is the meaning of "I'm at a loss on the white lines" ?

And i can't see the images you post ...

Sincerly,

ildrad
Posts: 4
Joined: Fri Jan 18, 2013 9:06 am

Re: Varying the AREA colour ?

#10 Post by ildrad » Thu Jan 24, 2013 8:45 am

Problem close to be solve

User avatar
datatechuk
Posts: 14
Joined: Wed Oct 10, 2007 4:16 am

Re: Varying the AREA colour ?

#11 Post by datatechuk » Wed Aug 26, 2015 2:12 pm

I know this is an old post, but did anyone ever get this working?
I have just tried it and can't get any graphs to appear when trying to apply the CDEF's against the colours.

It looks so cool and we would like to use it for our support staff to identify issues easier and at a glance of the projectors in our NOC.
Many Thanks
Marc
Datatech

Post Reply