node color change (up/down) wathermap on libreNMS

Support questions about the Network Weather Map plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

node color change (up/down) wathermap on libreNMS

#1 Post by AMIRarama » Sat Aug 17, 2019 5:41 am

Hi Guys
i have weathermap plugin on librenms installed and working.
i want to be able to change the nodes/links color or icon based on the device status (up/down).
i understood that in librenms it's more complicated because there is no target or info on .rrd files?
i'm pretty new to this world.
Thanks in advanced,

AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

Re: node color change (up/down) wathermap on libreNMS

#2 Post by AMIRarama » Fri Aug 23, 2019 11:57 am

i tried to use fping datasource

so i did
# a scale for loss - 0=green, <30% yellow, >=30% red
SCALE updown 0 0 0 255 0
SCALE updown 0 30 255 255 0
SCALE updown 30 100 255 0 0
(took from howie another post)

under the node config i did:
TARGET fping:hostname
USESCALE updown out

i used out because i understood the fping out gives the packet loss percentage.
the thing is the node label colored green and stays green all the time, no matter if the node respond to ping or not.
i'm not sure where i'm wrong ?

netniV
Cacti Guru User
Posts: 2885
Joined: Sun Aug 27, 2017 12:05 am

Re: node color change (up/down) wathermap on libreNMS

#3 Post by netniV » Fri Aug 23, 2019 2:04 pm

If you are after weathermaps support on other platforms, you will be better off using the weathermaps forums.

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: node color change (up/down) wathermap on libreNMS

#4 Post by Howie » Sun Aug 25, 2019 11:18 am

Also, running from the command-line with --debug will give you a lot more log output, including what data the datasource plugin is getting.
Weathermap 0.98 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!)

AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

Re: node color change (up/down) wathermap on libreNMS

#5 Post by AMIRarama » Wed Aug 28, 2019 1:15 pm

Which command exactly should i run with --debug ?

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: node color change (up/down) wathermap on libreNMS

#6 Post by Howie » Wed Aug 28, 2019 3:56 pm

Weathermap.

./weathermap —debug —config mymap.conf
Weathermap 0.98 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!)

AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

Re: node color change (up/down) wathermap on libreNMS

#7 Post by AMIRarama » Thu Aug 29, 2019 6:01 am

Howie wrote:
Wed Aug 28, 2019 3:56 pm
Weathermap.

./weathermap —debug —config mymap.conf
Thank you Howie, what an amazing tool.
first it was wrong path of fping and i fixed it. but now, that .html link to the map isn't loading at all. looks like the browser can't display that, so i see it like a blank square with a small image icon at the up left. and that's it.

this is the relevant debug for the host i added the fping + scale.
can you tell me what is wrong?
DEBUG: [[email protected]:913] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData for NODE mekfwapn-m1:
DEBUG: [[email protected]:922] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData: New Target: fping:mekfwapn-m1
DEBUG: [[email protected]_fping.php:66] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Running /usr/sbin/fping -t100 -r1 -p20 -u -C 5 -i10 -q mekfwapn-m1 2>&1
DEBUG: [[email protected]_fping.php:76] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Output: mekfwapn-m1 : - - - - -
DEBUG: [[email protected]_fping.php:80] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Found output line for mekfwapn-m1
DEBUG: [[email protected]_fping.php:102] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Result: 0 999999 -> 0 0 100
DEBUG: [[email protected]_fping.php:76] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Output: DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note fping_min='999999' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note fping_max='0' to mekfwapn-m1
DEBUG: [[email protected]_fping.php:132] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: FPing ReadData: Returning (0,100,0)
DEBUG: [[email protected]:971] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Aggregate so far: 0 100
DEBUG: [[email protected]:985] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData complete for NODE mekfwapn-m1: 0 100
DEBUG: [NewC[email protected]:1277] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: NCFPC mekfwapn-m1 updown 0 '' 0_0 0 255 0
DEBUG: [[email protected]:1277] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: NCFPC mekfwapn-m1 updown 100 '' 30_100 255 0 0
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscalekey='0_0' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscalekey='30_100' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscaletag='' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscaletag='' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscalecolor='#00ff00' to mekfwapn-m1
DEBUG: [[email protected]:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscalecolor='#ff0000' to mekfwapn-m1
DEBUG: [[email protected]:1052] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData: Setting 0,100
DEBUG: [[email protected]:912] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf:

AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

Re: node color change (up/down) wathermap on libreNMS

#8 Post by AMIRarama » Thu Aug 29, 2019 6:31 am

if i just run fping -t100 -r1 -p20 -u -C 5 -i20 -q hostname 2>&1
i either get response time:
1.32 0.44 0.46 0.45 0.51

or either get this:
- - - - if there is no response

i don't get the values of packet loss in percentage as i wanted to

User avatar
Howie
Cacti Guru User
Posts: 5333
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: node color change (up/down) wathermap on libreNMS

#9 Post by Howie » Fri Aug 30, 2019 4:03 pm

Weathermap counts the '-' results, and uses that to calculate the packet loss.

Later on in that log, you can see it's returning 0,100 - i.e. 100% packet loss, because fping returned "- - - - -"

Right at the end, you can also see that it selected 'ff0000' - that is red - as the final colour for the out scale.
Weathermap 0.98 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