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    


Multicast map

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



Joined: 09 Jul 2007
Posts: 4

PostPosted: Tue Aug 07, 2007 1:00 am    Post subject: Multicast map Reply with quote

Hi Howie,

I'm working on a multicast map and I want to graph bandwith labels as packets/second instead of bits/s. I have a link like this:

LINK CORE-1-XBEAM
BWLABEL unformatted
TARGET gauge:/path/to/rra/core1_multicast_out_666.rrd:multicast_in:multicast_out
NODES CORE-1 XBEAM

The problem is that I am getting decimal numbers. Is there a way to define exact number in a bandiwth label like you can do in a LABEL or COMMENT sections with sentence like this: {link:this:bandwidth_out:%d}?

PS.:Maybe is not a bug, but using "SET link_bulge 1" only takes the percentage utilisation of traffic in and not traffic out to change the link width. IMHO will be great to take the greater percentage.

Thanks!
MSBS


Last edited by MSBS on Tue Aug 07, 2007 8:09 pm; edited 1 time in total
Back to top
Howie
Cacti Guru User


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

PostPosted: Tue Aug 07, 2007 7:35 am    Post subject: Re: Multicast map Reply with quote

MSBS wrote:

The problem is that I am getting decimal numbers. Is there a way to define extact number in a bandiwth label like you can do in a LABEL or COMMENT sections with sentence like this: {link:this:bandwidth_out:%d}?


It's not possible right now, but this is already in my todo list. I want to be able to have millisecond labels for latency and jitter maps. I think someone else wanted dB for S/N ratio.

MSBS wrote:

PS.:Maybe is not a bug, but using "SET link_bulge 1" only takes the percentage utilisation of traffic in and not traffic out to change the link width. IMHO will be great to take the greater percentage.

I'd forgotten about that. Someone pointed it out a while ago. I'll see if I can change it to make a little more sense. I think my plan was actually to bulge each half of the link individually, since they're drawn seperately anyway.
Back to top
MSBS



Joined: 09 Jul 2007
Posts: 4

PostPosted: Tue Aug 07, 2007 11:14 am    Post subject: Reply with quote

Ok, uhmm...so set BWLABEL as none and make a NODE instead will do the trick.

Thanks Howie, your tool is awesome!
MSBS
Back to top
Howie
Cacti Guru User


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

PostPosted: Tue Aug 07, 2007 11:20 am    Post subject: Reply with quote

MSBS wrote:
Ok, uhmm...so set BWLABEL as none and make a NODE instead will do the trick.

Thanks Howie, your tool is awesome!
MSBS


Yes, that would work. Or as you know, you can use the comments, which can take {link:this:...} stuff.

INBWLABELFORMAT (or whatever better name I come up with ) should be in either 0.93 or 0.94. I'm having fun with the new editor at the moment, so 0.93 is a little delayed.
Back to top
niobe
Cacti User


Joined: 10 Mar 2008
Posts: 125
Location: Australia

PostPosted: Fri Apr 11, 2008 2:36 am    Post subject: Re: Multicast map Reply with quote

MSBS wrote:

The problem is that I am getting decimal numbers. Is there a way to define extact number in a bandiwth label like you can do in a LABEL or COMMENT sections with sentence like this: {link:this:bandwidth_out:%d}?


I have solved this with a very simple patch to the weathermap classes..ok more of a hack than a solution, but here goes..

Edit "Weathermap.class.php". Near the top add:

Code:
define('FMT_PACKETS_IN',"{link:this:bandwidth_in:%d}");
define('FMT_PACKETS_OUT',"{link:this:bandwidth_out:%d}");


Underneath this:

Code:
                   if($style=='unformatted')
                    {
                        $format_in = FMT_UNFORM_IN;
                        $format_out = FMT_UNFORM_OUT;
                    }


Add this:

Code:
                    if($style=='packets')
                    {
                        $format_in = FMT_PACKETS_IN;
                        $format_out = FMT_PACKETS_OUT;
                    }


Also edit WeatherMapLink.class.php. Below this:

Code:
            if($this->labelstyle=='--' && $this->bwlabelformats[IN] == FMT_UNFORM_IN && $this->bwlabelformats[OUT] == FMT_UNFORM_OUT)
            {
                $this->labelstyle = 'unformatted';
            }



Add this:

Code:
            if($this->labelstyle=='--' && $this->bwlabelformats[IN] == FMT_PACKETS_IN && $this->bwlabelformats[OUT] == FMT_PACKETS_OUT)
            {
                $this->labelstyle = 'packets';
            }



Finally add this sort of thing to your weathermap config:

Code:
LINK DEFAULT
        BWLABEL packets


Now you get whole number values on the graph. In this example the data source is "packets per second". But if I try to print pps after the value with:

Code:
        INBWFORMAT {link:this:bandwidth_in} pps
        OUTBWFORMAT {link:this:bandwidth_out} pps


...then unfortunately this undoes the new formatting and bandwidth labels are back to decimal.

So..definitely a hack The screenshot shows both situations.

-----------------------------------

By the way, I am trying to achieve the same thing - a multicast weathermap, so I would definitely vote for this feature to be added to Weathermap. Among the many whole number values I want to put on weathermaps:

    unicast packets
    non-unicast packets
    active multicast groups
    connected wireless access points
    wireless users
    vpn users


Niobe



decimals.ugh.png
 Description:
 Filesize:  349.58 KB
 Viewed:  2013 Time(s)

decimals.ugh.png


Back to top
Howie
Cacti Guru User


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

PostPosted: Fri Apr 11, 2008 2:42 am    Post subject: Re: Multicast map Reply with quote

niobe wrote:

Code:
define('FMT_PACKETS_IN',"{link:this:bandwidth_in:%d}");
define('FMT_PACKETS_OUT',"{link:this:bandwidth_out:%d}");


Code:
        INBWFORMAT {link:this:bandwidth_in} pps
        OUTBWFORMAT {link:this:bandwidth_out} pps


...then unfortunately this undoes the new formatting and bandwidth labels are back to decimal.


Why wouldn't it? You changed the format to not include the %d, then you won't get integers. That's what the %d does.

You can do this without changing code just by adding this to either the DEFAULT LINK or any LINKs where you want it.
Code:

INBWFORMAT {link:this:bandwidth_in:%d} pps
        OUTBWFORMAT {link:this:bandwidth_out:%d} pps


There is no 'new feature', aside possibly from the ability to make new named formats. Next release has templates for nodes and links so even if you wanted only half of the links to have this, it's still only one line in each link, and a link template with the formatting in it (and any other formatting fonts etc too), so I don't think it's worthwhile.
Back to top
niobe
Cacti User


Joined: 10 Mar 2008
Posts: 125
Location: Australia

PostPosted: Fri Apr 11, 2008 3:06 am    Post subject: Reply with quote

Quote:
Why wouldn't it? You changed the format to not include the %d, then you won't get integers. That's what the %d does.


Sorry dude, I just couldn't find this documented anywhere. Ideally should be here:

http://www.network-weathermap.com/manual/latest/pages/advanced.html

http://www.network-weathermap.com/manual/latest/pages/config-reference.html#NODE_TARGET
Back to top
Howie
Cacti Guru User


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

PostPosted: Fri Apr 11, 2008 3:24 am    Post subject: Reply with quote

niobe wrote:
Quote:
Why wouldn't it? You changed the format to not include the %d, then you won't get integers. That's what the %d does.


Sorry dude, I just couldn't find this documented anywhere. Ideally should be here:

http://www.network-weathermap.com/manual/latest/pages/advanced.html

http://www.network-weathermap.com/manual/latest/pages/config-reference.html#NODE_TARGET


Wow, I thought it was. It should be in the advanced section under the special tokens stuff. Wierd.

My actual confusion was how you had it one place, but didn't in the other, but you're right - it's not documented
Back to top
niobe
Cacti User


Joined: 10 Mar 2008
Posts: 125
Location: Australia

PostPosted: Fri Apr 11, 2008 3:37 am    Post subject: Reply with quote

No dramas

Honestly it's just great to have such a tool where most things have already been thought of
Back to top
rujipars



Joined: 02 Nov 2007
Posts: 15

PostPosted: Thu May 08, 2008 8:28 am    Post subject: Reply with quote

This topic saved my life

Thanks Howie for making this great tool.

Share my usage of Weather Map with this picture.

The small pieces next to the node label (sub node) display temperature and CPU usage. (I use %d formatting to keep it tiny (7% instead of 6.802333333%(a very ugly one))



weathermap_7.png
 Description:
 Filesize:  22.13 KB
 Viewed:  1529 Time(s)

weathermap_7.png


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