Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Icon background color

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
maowietts



Joined: 10 Oct 2006
Posts: 8

PostPosted: Fri Jun 01, 2007 6:41 am    Post subject: Icon background color Reply with quote

Hello cacti community,

I have a question concerning cacti & PHP Network Weathermap, When I use icons on a map, i have a red background behind the icons. I would like that the label color and the background color behind icons to change with the Nagios State (via Ndo Database).

PS : Howie, if you are interested, I can give you the datasource file that I've made in order to get nagios Status for the monitored objects.

Greetings.

Mao.

+++
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1969
Location: United Kingdom

PostPosted: Fri Jun 01, 2007 6:53 am    Post subject: Re: Icon background color Reply with quote

maowietts wrote:
Hello cacti community,

I have a question concerning cacti & PHP Network Weathermap, When I use icons on a map, i have a red background behind the icons. I would like that the label color and the background color behind icons to change with the Nagios State (via Ndo Database).


Well, I'm not sure why you would get the red background in the first place. That sounds like a bug, or that you have icons with some funny transparency. Are they PNG or GIF? Do they actually have an alpha channel? I found that either mono+alpha or grey+alpha didn't work very well (can't recall which).

The normal way to do this is to have three copies of each icon (red, green, yellow, or whatever you need) and then use {node:this:blah} type stuff in the icon name. Have a look for cactihost: in the forums here to see an example for that. It works best if you can get your Nagios datasource plugin to add the extra 'notes' like the cactihost one does, to be used in the filename.

maowietts wrote:

PS : Howie, if you are interested, I can give you the datasource file that I've made in order to get nagios Status for the monitored objects.


I'd be interested to see that
Back to top
maowietts



Joined: 10 Oct 2006
Posts: 8

PostPosted: Fri Jun 01, 2007 7:33 am    Post subject: Reply with quote

Ok Howie, thanks 4 your answer.
So i'm agree that it looks like a bug. The problem is ,as you can see on the screenshot below, I've the same comportment with your icons and with nagios icon's.

Nagios icon's are in PNG or GIF format (same result with this 2 extensions).
My GD version is : 2.0.1 (deb packages).

For the color change, effectively I could try with your solution, only if I have not yet the red background behind icons

For my source, I'll send you that on the next week, i have to add some debugging infos.

Thanks 4 your help.

Mao

The config of the example map :

# Automatically generated by php-weathermap v0.91

WIDTH 800
HEIGHT 600


KEYPOS DEFAULT -1 -1 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 55 0 240 0
SCALE DEFAULT 55 70 240 240 0
SCALE DEFAULT 70 85 255 192 0
SCALE DEFAULT 85 100 255 0 0


# End of global section

# DEFAULT definitions:
NODE DEFAULT
MAXVALUE 100

LINK DEFAULT
BANDWIDTH 100M


# End of DEFAULTS section

# Node definitions:
NODE node1180700013
LABEL FW
ICON images/Firewall.png
POSITION 262 207

NODE node1180700023
LABEL Router
ICON images/router40.png
POSITION 488 186


# End of NODE section

# Link definitions:
LINK node1180700013-node1180700023
INFOURL http://reseau-serveur/cacti/graph.php?rra_id=all&local_graph_id=6
OVERLIBGRAPH http://reseau-serveur/cacti/graph_image.php?local_graph_id=6&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/cacti/rra/atgwmaster_traffic_in_9.rrd
NODES node1180700013 node1180700023


# End of LINK section

# That's All Folks!



cacti_error.gif
 Description:
 Filesize:  2.3 KB
 Viewed:  2662 Time(s)

cacti_error.gif


Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1969
Location: United Kingdom

PostPosted: Sat Jun 02, 2007 4:57 am    Post subject: Reply with quote

maowietts wrote:
Ok Howie, thanks 4 your answer.
So i'm agree that it looks like a bug. The problem is ,as you can see on the screenshot below, I've the same comportment with your icons and with nagios icon's.

Nagios icon's are in PNG or GIF format (same result with this 2 extensions).
My GD version is : 2.0.1 (deb packages).


That's quite an old GD. I know that even 2.0.33 has problems with transparency/alpha. The left icon looks like the problem I remember - I think I had that with grey+alpha pngs.

Could you post the original image files for your icons please? I'll try them with my (known working) install, and that way we can figure out which of those problems is GD and which is the image format But I think at least part of the problem would be solved by moving to either the latest GD, or the one built into PHP (which does transparency using different code).
Back to top
maowietts



Joined: 10 Oct 2006
Posts: 8

PostPosted: Mon Jun 04, 2007 2:16 am    Post subject: Reply with quote

Ok Howie, I have shared one of my icon with red background. Tell me if it works well on your installation, in this case, i'll upgrade my GD version.

Thanks again.
Greetings.

Mao

++



router40.zip
 Description:
Icone Nagios

Download
 Filename:  router40.zip
 Filesize:  2.43 KB
 Downloaded:  98 Time(s)

Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1969
Location: United Kingdom

PostPosted: Mon Jun 04, 2007 2:49 am    Post subject: Reply with quote

maowietts wrote:
Ok Howie, I have shared one of my icon with red background. Tell me if it works well on your installation, in this case, i'll upgrade my GD version.


That renders fine for me. My PHP is using the bundled GD (not the system one).

If you are going to upgrade with the debian packages, you need to get at least 2.0.34, because 2.0.33 has another different alpha-channel bug



router40-test.png
 Description:
 Filesize:  2.38 KB
 Viewed:  2586 Time(s)

router40-test.png


Back to top
maowietts



Joined: 10 Oct 2006
Posts: 8

PostPosted: Tue Jun 05, 2007 3:53 am    Post subject: Reply with quote

Howie, finally I think I've updated to version 2.0.34
Deb packages :
- libgd2-xpm_2.0.34-1_i386.deb
- php5-gd_5.2.2-2_i386.deb

Phpinfo give always : "GD Version: 2.0 or higher" which isn't very helpful. Is there any Gd function which could return the precise version ?

Thanks.

Mao
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1969
Location: United Kingdom

PostPosted: Tue Jun 05, 2007 4:04 am    Post subject: Reply with quote

maowietts wrote:
Howie, finally I think I've updated to version 2.0.34
Deb packages :
- libgd2-xpm_2.0.34-1_i386.deb
- php5-gd_5.2.2-2_i386.deb

Phpinfo give always : "GD Version: 2.0 or higher" which isn't very helpful. Is there any Gd function which could return the precise version ?

Thanks.

Mao


No, I wish there was, because then check.php could use it

The 2.0.34 in the package name is the best way to tell.
Back to top
maowietts



Joined: 10 Oct 2006
Posts: 8

PostPosted: Tue Jun 05, 2007 4:30 am    Post subject: Reply with quote

Ok but my icon backgroung is always red sniff, have you got another idea. If not, i'll test on another debian installation in order to see...

Thanks 4 your help

mao
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1969
Location: United Kingdom

PostPosted: Tue Jun 05, 2007 4:56 am    Post subject: Reply with quote

maowietts wrote:
Ok but my icon backgroung is always red sniff, have you got another idea. If not, i'll test on another debian installation in order to see...


I suppose it's possible that it could be a libpng problem...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group