Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Fri Apr 28, 2017 10:55 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Syntax help with position radius
PostPosted: Mon Mar 20, 2017 3:46 pm 
Offline

Joined: Tue Nov 08, 2011 11:35 am
Posts: 49
Hi,

I'm trying to do something like this:
Code:
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:
        SET child_angle {node:parent:spacer}*3
        POSITION parent {node:this:child_angle}r{node:sw6:radius}


I'm on Weathermap 0.98.


Top
 Profile  
 
 Post subject: Re: Syntax help with position radius
PostPosted: Mon Mar 20, 2017 5:03 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5091
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Syntax help with position radius
PostPosted: Tue Mar 21, 2017 6:00 am 
Offline

Joined: Tue Nov 08, 2011 11:35 am
Posts: 49
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 ;)


Top
 Profile  
 
 Post subject: Re: Syntax help with position radius
PostPosted: Sat Apr 01, 2017 5:02 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5091
Location: United Kingdom
:-) Point taken. Writing it now.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group