Multicast map

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
MSBS
Posts: 6
Joined: Mon Jul 09, 2007 4:57 am

Multicast map

Post by MSBS »

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.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Multicast map

Post by Howie »

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.
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!)
MSBS
Posts: 6
Joined: Mon Jul 09, 2007 4:57 am

Post by MSBS »

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

Thanks Howie, your tool is awesome!
MSBS
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

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 :roll: ) 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.
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!)
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Re: Multicast map

Post by niobe »

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: Select all

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

Code: Select all

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

Code: Select all

                    if($style=='packets')
                    {
                        $format_in = FMT_PACKETS_IN;
                        $format_out = FMT_PACKETS_OUT;
                    }
Also edit WeatherMapLink.class.php. Below this:

Code: Select all

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

Add this:

Code: Select all

            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: Select all

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: Select all

        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
Attachments
decimals.ugh.png
decimals.ugh.png (349.58 KiB) Viewed 8843 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Multicast map

Post by Howie »

niobe wrote:

Code: Select all

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

Code: Select all

        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: Select all

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.
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!)
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

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/manua ... anced.html

http://www.network-weathermap.com/manua ... ODE_TARGET
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

niobe wrote:
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/manua ... anced.html

http://www.network-weathermap.com/manua ... ODE_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 :oops:
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!)
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Post by niobe »

No dramas :P

Honestly it's just great to have such a tool where most things have already been thought of
rujipars
Posts: 39
Joined: Fri Nov 02, 2007 11:25 am

Post by rujipars »

This topic saved my life :D

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))
Attachments
weathermap_7.png
weathermap_7.png (22.13 KiB) Viewed 8359 times
SergiusFacsimile
Posts: 1
Joined: Sat Feb 22, 2014 7:18 pm

Re: Multicast map

Post by SergiusFacsimile »

hi
edited files, but does not draw the map, changes are outdated? :oops:
iluv8250
Posts: 3
Joined: Fri Jan 24, 2014 2:29 am

Re: Multicast map

Post by iluv8250 »

hi niobe!
I also did steps as your guide, but weathermap can not display packets number as your picture (it always 0). I need more do some step?
pls respond asap. thank you very much!
P/S: i'm using weathermap 0.97a
iluv8250
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests