Syntax help with position radius

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Syntax help with position radius

Post by malgoe »

Hi,

I'm trying to do something like this:

Code: Select all

NODE parent
        LABEL parent
        SET spacer 36
        SET radius 200
        POSITION sw5 350 0

NODE child1
        LABEL child1
        POSITION parent {node:parent:spacer}*0r{node:parent:radius}

NODE child2
        LABEL child2
        POSITION parent {node:parent:spacer}*1r{node:parent:radius}

NODE child3
        LABEL child3
        POSITION parent {node:parent:spacer}*2r{node:parent:radius}

Why? To make it easier to add more child nodes without having to edit every other child nodes position values.

However, I can't get this to work. That's probably because of one of the following:
a) It's late, I'm tired and I made a boo boo in my syntax
b) What I'm trying to do is not possible (yet)

Which one is it? :lol:
I also tried this on the child nodes without success:

Code: Select all

        SET child_angle {node:parent:spacer}*3
        POSITION parent {node:this:child_angle}r{node:sw6:radius}
I'm on Weathermap 0.98.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Syntax help with position radius

Post by Howie »

You can't do maths in there. In any of those places. {} is basically a text substitution. You can do numeric formatting (with %f, %d and %k) but that's it.

On my wishlist is a proper maths expression parser for targets etc, but it doesn't exist right now. It also raises questions, because in some places (like this) you want to do a calculation to get a config value, and in others, you want to do a calculation on the result of a target, and it has to be able to deal with both in the same line - e.g. you want to use a formula to figure out the target string, and then double the result of fetching that target.

Anyway, you should be getting errors in the logs for this:

POSITION parent 10*3r33

(making up some values) because it's not a valid config line.

And, as I mentioned elsewhere earlier today: Rule #1 of weathermap (and any other) troubleshooting: What do the logs say?
Weathermap 0.98a 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!)
malgoe
Posts: 49
Joined: Tue Nov 08, 2011 11:35 am

Re: Syntax help with position radius

Post by malgoe »

I did check the logs before making the post and they do complain about unknown syntax. However, I wasn't sure whether it was just bad syntax from me or if it wasn't supported at all. But now i know! Thanks! :)

Also, you promised to add something about using r in POSITION in the documentation a while ago but I still can't find it in there ;)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Syntax help with position radius

Post by Howie »

:-) Point taken. Writing it now.
Weathermap 0.98a 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!)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests