|
|
| Author |
Message |
maowietts
Joined: 10 Oct 2006 Posts: 8
|
Posted: Fri Jun 01, 2007 6:41 am Post subject: Icon background color |
|
|
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: 2135 Location: United Kingdom
|
Posted: Fri Jun 01, 2007 6:53 am Post subject: Re: Icon background color |
|
|
| 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
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
Posted: Sat Jun 02, 2007 4:57 am Post subject: |
|
|
| 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
|
Posted: Mon Jun 04, 2007 2:16 am Post subject: |
|
|
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
++
| Description: |
|
 Download |
| Filename: |
router40.zip |
| Filesize: |
2.43 KB |
| Downloaded: |
119 Time(s) |
|
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2135 Location: United Kingdom
|
|
| Back to top |
|
 |
maowietts
Joined: 10 Oct 2006 Posts: 8
|
Posted: Tue Jun 05, 2007 3:53 am Post subject: |
|
|
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: 2135 Location: United Kingdom
|
Posted: Tue Jun 05, 2007 4:04 am Post subject: |
|
|
| 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
|
Posted: Tue Jun 05, 2007 4:30 am Post subject: |
|
|
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: 2135 Location: United Kingdom
|
Posted: Tue Jun 05, 2007 4:56 am Post subject: |
|
|
| 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 |
|
 |
|