[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [php-weathermap] Variable link name



OK never mind. I'll try to make something cool using {} just in comments or icons.
Thanks a lot, Howie.

Le 22/06/2010 12:06, Howard Jones a écrit :
On 22/06/2010 10:45, Hervé Donati wrote:
Hello,

My purpose is to create a map for VMware virtualization.
As an example, let us say that we have 2 ESX called "esx1" and "esx2"
and one VM called "vm". These are nodes in my map.
This VM is sometimes moved from one ESX to the other.
One data source (no_vm) is able to give me the current esx's number, 1
or 2.
I would like to make the link change when current esx changes.
I tried something like :

LINK esx-vm
     WIDTH 2
     OUTCOMMENT esx{link:this:bandwidth_in}
     TARGET
gauge:/var/www/html/cacti08/rra/vcenter_no_vm_12281.rrd:no_vm:-
     NODES vm esx{link:this:bandwidth_in}

But get :

Unknown node 'esx{link:this:bandwidth_in}' on line 206 of config

I also tried variable width (in fact 0 or no_vm), same kind of error.
If I try NODES vm esx1 with the OUTCOMMENT like upwards, the
OUTCOMMENT is OK on the map (ie esx1 ou esx2)...
Is there a way to realize this ? I know it is not something very usual...

No - the {} tokens are resolved much later than when node names are
checked (which is while the config is initially parsed). {} tokens are
mainly available in places where a string is normally used (targets,
titles, captions, urls) and not where a number or a 'thing' (node/link) is.

I suppose it doesn't actually *have* to check the node names until it's
time to draw links... it would also allow some flexibility in link
templates that isn't there at the moment.

Howver, I think it would be better to make it more clear how this stuff
works, rather than complicate it some more :-) But on the other hand, it
would be neat to be able to do what you want.




--
Hervé Donati
Service informatique de l'académie de Caen
SIAC4 - Département des infrastructures
0231301740



Copyright 1994-2005, by Howard Jones. howie@thingy.com