support for watermark

Anything that you think should be in Cacti.

Moderators: Moderators, Developers

Post Reply
Author
Message
User avatar
psyber
Cacti User
Posts: 83
Joined: Tue Aug 02, 2005 7:18 pm

support for watermark

#1 Post by psyber » Fri Apr 17, 2009 11:37 am

Could you add support for watermark in the graph templates page? (maybe a global setting as well)

I've been getting around the issue by just putting
bytes" --watermark "Your Company Logo Here
in the vertical label field

Domo

User avatar
BSOD2600
Cacti Moderator
Posts: 12160
Joined: Sat May 08, 2004 12:44 pm
Location: USA

#2 Post by BSOD2600 » Fri Apr 17, 2009 1:57 pm

Duplicate request from http://forums.cacti.net/about2840.html

Please create a feature request: http://www.cacti.net/bugs.php so it'll actually get some attention.

User avatar
psyber
Cacti User
Posts: 83
Joined: Tue Aug 02, 2005 7:18 pm

#3 Post by psyber » Fri Apr 17, 2009 2:14 pm

Actually after thinking about this for a short while you could potentially kill many birds with the same stone with the addition of an extra settings field. You would have to provide the directive and argument but it would allow for using many of the unimplemented rrdtool settings without hacking up the code or injecting code in innocent text fields.


I think a textarea would work well.
directives could be entered and validated one per line:
--directive argument /^(--[\w-]+)\s(.*?)$/
--directive /^(--[\w-]+)$/

You could even go one further and check that the directive is a valid rrdtool graph directive

--no-gridfit
--watermark "Operations"
--color CANVAS#000000
--color FONT#FFFFFF
--color BACK#000000
--color ARROW#00FF00


edit-- request submitted
http://bugs.cacti.net/view.php?id=1457

cigamit
Developer
Posts: 2784
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

#4 Post by cigamit » Fri Apr 17, 2009 10:44 pm

It would take only a matter of minutes to throw together a plugin that could accomplish most of this. We already have hooks that allow adding to the end of the RRDTool command. Thold uses it to add VRules.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: support for watermark

#5 Post by Howie » Sat Apr 18, 2009 3:40 am

psyber wrote:Could you add support for watermark in the graph templates page? (maybe a global setting as well)

I've been getting around the issue by just putting
bytes" --watermark "Your Company Logo Here
in the vertical label field

Domo
Heh. So there's a bug there too. Users with access to change graphs can probably run arbitrary commands, if that works...
Weathermap 0.98 is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)

cigamit
Developer
Posts: 2784
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

#6 Post by cigamit » Tue Apr 21, 2009 1:45 pm

Here is a quick plugin which will allow you to add a water mark to the bottom of your graphs.

Install it the PA v2.0 way (upload the directory, then install via the Plugin Management interface).

Then goto Settings >> Visual and at the bottom you will see a text field titles "Watermark". Just change that to what you want and save. It removes a few characters ( " | \ ) to try and stop simple exploits, but we should probably secure it even more.
Attachments
watermark.zip
Watermark Plugin
(7.65 KiB) Downloaded 1762 times

User avatar
psyber
Cacti User
Posts: 83
Joined: Tue Aug 02, 2005 7:18 pm

#7 Post by psyber » Tue Apr 21, 2009 8:19 pm

cigamit wrote:It would take only a matter of minutes to throw together a plugin that could accomplish most of this. We already have hooks that allow adding to the end of the RRDTool command. Thold uses it to add VRules.
See that's what I love about these forums, that just never occurred to me. I keep forgetting about all the hooks you have in there.

User avatar
belianisto
Posts: 20
Joined: Tue Feb 15, 2011 12:53 pm

Re: support for watermark

#8 Post by belianisto » Sun May 08, 2011 12:16 pm

hi
hey I've tried to install watermark plugin but it doesn't work. The php files lack of "?>" but with it, it doesn't work either
bye

cigamit
Developer
Posts: 2784
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: support for watermark

#9 Post by cigamit » Mon May 09, 2011 10:08 am

belianisto wrote:hi
hey I've tried to install watermark plugin but it doesn't work. The php files lack of "?>" but with it, it doesn't work either
bye
Not enough info is given to help you troubleshoot. How did you install it? Do you see it in Plugin Management? Did you check the file permissions? After installation do you see the option in Settings? What version of RRDTools are you using?

Also, php files do not require a "?>" at the end, putting it there can lead to other problems if your not careful. Such as white space afterwards can cause header output issues. And technically it slows down the processing as putting the ?> tells php to switch back to html parsing mode. That would be unnecessary if its the end of a standalone file. If its a included file you would be switching to HTML mode just to then have it switch back to PHP processing when it jumps back to the file that included it.

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: support for watermark

#10 Post by gandalf » Sun May 15, 2011 12:56 pm

This feature is already implemented in 088 code. Personally, I have no plans for backporting that.
R.

Post Reply