Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Mon Jul 28, 2014 9:22 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Colors: opacity using optional alpha in rrdtool
PostPosted: Thu Oct 18, 2007 10:16 am 
Offline

Joined: Fri Aug 13, 2004 11:35 am
Posts: 47
Location: Paris, France
hi!

I have search in the forum, if there is a project for using the alpha optional component of the color attribut. But i found nothing usable...
And i didn't read anything on this subject in the roadmap

So, here is my work on the subject.

I have appended a field name 'alpha' in the 'graph_templates_item ' table :

mysql command to append the field:
#alter table graph_templates_item add alpha varchar(2) default "FF";

the code is in the patch file attached.

to use with rrdtool 1.2.x

EDIT 24/oct/2007 : added patch for cacti 0.8.7 with plugin arch


Attachments:
File comment: Version 1.0 opacity option for cacti 0.8.7 + plugin arch
oct 24 2007

alpha-colors.patch [4.57 KiB]
Downloaded 649 times
File comment: Example
alpha.jpg
alpha.jpg [ 466.6 KiB | Viewed 20240 times ]
File comment: Version 1.0 opacity option for cacti 0.8.6j
oct 18 2007

alpha-colors.patch [4.58 KiB]
Downloaded 488 times
File comment: item option
alpha_option.jpg
alpha_option.jpg [ 61.15 KiB | Viewed 20240 times ]


Last edited by Mikf on Wed Oct 24, 2007 1:59 pm, edited 1 time in total.
Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 4:37 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
Very nice, thanks !

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 5:04 pm 
Offline
Developer

Joined: Thu Apr 07, 2005 3:29 pm
Posts: 1686
Location: B/CS Texas
Nice patch, testing it on my production box now.

_________________
CactiEZ CD


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 24, 2007 2:00 pm 
Offline

Joined: Fri Aug 13, 2004 11:35 am
Posts: 47
Location: Paris, France
added patch for cacti 0.8.7 with plugin arch


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 7:11 am 
Offline
Cacti User

Joined: Wed Aug 31, 2005 8:55 am
Posts: 388
Location: Bristol, England
Hi

I have applied the patch but I'm unable to get this working as my graphs disappear.

I downloaded the win32 GNU version of Patch and did the following:-

C:\Apache2\htdocs\cacti>patch -p1 -N < alpha_colors_201.patch
patching file graphs_items.php
patching file graph_templates_items.php
patching file include/config_arrays.php
patching file include/config_form.php
patching file lib/rrd.php
Hunk #1 succeeded at 557 (offset 2 lines).
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 1103 with fuzz 1 (offset 8 lines).


I then downloaded the patch again and turned off word wrap within notepad in case that was causing and problem and re-applied.

C:\Apache2\htdocs\cacti>
C:\Apache2\htdocs\cacti>patch -p1 -N < alpha_colors.patch
The system cannot find the file specified.

C:\Apache2\htdocs\cacti>patch -p1 -N < alpha-colors.patch
patching file graphs_items.php
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file graphs_items.php.rej
patching file graph_templates_items.php
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file graph_templates_items.php.rej
patching file include/config_arrays.php
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file include/config_arrays.php.rej
patching file include/config_form.php
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file include/config_form.php.rej
patching file lib/rrd.php
Reversed (or previously applied) patch detected! Skipping patch.
patch unexpectedly ends in middle of line
2 out of 2 hunks ignored -- saving rejects to file lib/rrd.php.rej


When I went to check my graphs they had weren't there :o( I had a look through the logs and saw the following:-

10/30/2007 11:38:07 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select graph_templates_item.id as graph_templates_item_id, graph_templates_item.cdef_id, graph_templates_item.text_format, graph_templates_item.value, graph_templates_item.hard_return, graph_templates_item.consolidation_function_id, graph_templates_item.graph_type_id, graph_templates_gprint.gprint_text, colors.hex, graph_templates_item.alpha, data_template_rrd.id as data_template_rrd_id, data_template_rrd.local_data_id, data_template_rrd.rrd_minimum, data_template_rrd.rrd_maximum, data_template_rrd.data_source_name, data_template_rrd.local_data_template_rrd_id from graph_templates_item left join data_template_rrd on (graph_templates_item.task_item_id=data_template_rrd.id) left join colors on (graph_templates_item.color_id=colors.id) left join graph_templates_gprint on (graph_templates_item.gprint_id=graph_templates_gprint.id) where graph_templates_item.local_graph_id=371 order by graph_templates_item.sequence"


Also when I looked at a graph template and looked at one of the items I saw the following:-

Notice: Undefined index: alpha in C:\Apache2\htdocs\cacti\graph_templates_items.php on line 335


I don't use the plugin arch. The only modification I have done to Cacti is to the colours.

http://forums.cacti.net/viewtopic.php?t ... ght=colors

Any ideas???

Jay

_________________
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 7:35 am 
Offline
Cacti Pro User
User avatar

Joined: Mon Mar 27, 2006 10:35 am
Posts: 711
Location: Psychic Amish Network Administrator
Very cool addon. Worked perfectly!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 7:42 am 
Offline

Joined: Fri Aug 13, 2004 11:35 am
Posts: 47
Location: Paris, France
Jay : do you have done this :
alter table graph_templates_item add alpha varchar(2) default "FF";
on your cacti database ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 7:43 am 
Offline
Cacti User

Joined: Wed Aug 31, 2005 8:55 am
Posts: 388
Location: Bristol, England
aaaaah..that might be the problem as I didn't run this command within the database. I will try this now and get back to you.

Thanks for the quick response.

Jay

_________________
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 8:55 am 
Offline
Cacti User

Joined: Wed Aug 31, 2005 8:55 am
Posts: 388
Location: Bristol, England
Hi

That's works like a charm now :o) . Thanks for your assistance.

How do you get your graphs to look like the one you have shown?? I like the way you have drawn a line over the coloured area to define the graphs better. I have tried this and I can get the line drawn over the area but it shows both of the colours under the graphs as shown in my screenshots. I would like it so that it just shows one of the colours within the legend as yours does.

Jay


Attachments:
TrafficStats_graph_template.jpg
TrafficStats_graph_template.jpg [ 21.12 KiB | Viewed 19782 times ]
TrafficStats.jpg
TrafficStats.jpg [ 32.81 KiB | Viewed 19782 times ]

_________________
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
Top
 Profile  
 
 Post subject: This is really nice.
PostPosted: Tue Oct 30, 2007 9:14 am 
Offline
Cacti User
User avatar

Joined: Tue May 22, 2007 7:56 am
Posts: 277
Location: Padacuh, Ky-Alpena, MI-Gulf Shores,AL
I hope the devolipers add this to the base code it is a great and simple option.

I don't want to loose it when I upgrade to 0.8.8/0.9.0.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 6:22 pm 
Offline

Joined: Fri Aug 13, 2004 11:35 am
Posts: 47
Location: Paris, France
Jay: the screen of the items i used


Attachments:
items.jpg
items.jpg [ 497.96 KiB | Viewed 19738 times ]
Top
 Profile  
 
 Post subject: Re: This is really nice.
PostPosted: Thu Nov 08, 2007 5:36 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
chrisgapske wrote:
I hope the devolipers add this to the base code it is a great and simple option.

I don't want to loose it when I upgrade to 0.8.8/0.9.0.
It's on my todo list. We won't loose it
Reinhard
(a devoliper :lol: I love this typo :o )

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 08, 2007 8:59 am 
Offline
Cacti User
User avatar

Joined: Tue May 22, 2007 7:56 am
Posts: 277
Location: Padacuh, Ky-Alpena, MI-Gulf Shores,AL
That is great to hear.

Thanks as always.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 9:51 am 
Offline
Cacti Guru User
User avatar

Joined: Fri Sep 19, 2003 8:36 am
Posts: 2326
Location: Sophia-Antipolis, France
For those who haven't upgraded to Cacti 0.8.7a, this nice patch has been added to the Cacti core :)

_________________

HOWTOs :
Templates :


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 13, 2008 9:57 am 
Offline
Cacti Pro User
User avatar

Joined: Wed Apr 09, 2003 2:17 am
Posts: 710
Location: Izmir/Turkey
Mikf wrote:
Jay: the screen of the items i used


There are 4 legent exists. How to hide 2 of them. One of outbound other one is inbound?

_________________
Quote:
Cacti Version - 0.8.7e
Plugin Architecture - 2.5
Poller Type - CMD.php
Server Info - Linux 2.6.28-11-server
Web Server - Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.5 with Suhosin-Patch
PHP - 5.2.6-3ubuntu4.5
PHP Extensions - zip, xmlwriter, libxml, xml, wddx, tokenizer, sysvshm, sysvsem, sysvmsg, session, SimpleXML, sockets, soap, SPL, shmop, standard, Reflection, posix, mime_magic, mbstring, json, iconv, hash, gettext, ftp, filter, exif, dom, dba, date, ctype, calendar, bz2, bcmath, zlib, pcre, openssl, xmlreader, apache2handler, gd, mysql, mysqli, PDO, pdo_mysql, rrdtool, snmp
MySQL - 5.0.75-0ubuntu10.2
RRDTool - 1.3.1
SNMP - 5.4.1
Plugins
    PHP Network Weathermap (weathermap - v0.97a)
    SuperLinks (superlinks - v0.8)
    Real-time statistics (zond - v0.34c)
    Host Info (hostinfo - v0.2)
    Report Creator (reports - v0.3)
    Global Plugin Settings (settings - v0.5)
    Network Discovery (discovery - v0.9)
    System Title Changer (titlechanger - v0.1)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group