node color change (up/down) wathermap on libreNMS

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

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

node color change (up/down) wathermap on libreNMS

Post by AMIRarama »

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

Post by AMIRarama »

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: 3441
Joined: Sun Aug 27, 2017 12:05 am

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

Post by netniV »

If you are after weathermaps support on other platforms, you will be better off using the weathermaps forums.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

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

Post by Howie »

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.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!)
AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

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

Post by AMIRarama »

Which command exactly should i run with --debug ?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

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

Post by Howie »

Weathermap.

./weathermap —debug —config mymap.conf
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!)
AMIRarama
Posts: 5
Joined: Sat Aug 17, 2019 5:36 am

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

Post by AMIRarama »

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: [ReadData@Weathermap.class.php:913] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData for NODE mekfwapn-m1:
DEBUG: [ReadData@Weathermap.class.php:922] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData: New Target: fping:mekfwapn-m1
DEBUG: [ReadData@WeatherMapDataSource_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: [ReadData@WeatherMapDataSource_fping.php:76] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Output: mekfwapn-m1 : - - - - -
DEBUG: [ReadData@WeatherMapDataSource_fping.php:80] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Found output line for mekfwapn-m1
DEBUG: [ReadData@WeatherMapDataSource_fping.php:102] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Result: 0 999999 -> 0 0 100
DEBUG: [ReadData@WeatherMapDataSource_fping.php:76] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Output: DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note fping_min='999999' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note fping_max='0' to mekfwapn-m1
DEBUG: [ReadData@WeatherMapDataSource_fping.php:132] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: FPing ReadData: Returning (0,100,0)
DEBUG: [ReadData@Weathermap.class.php:971] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Aggregate so far: 0 100
DEBUG: [ReadData@Weathermap.class.php:985] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData complete for NODE mekfwapn-m1: 0 100
DEBUG: [NewColourFromPercent@Weathermap.class.php:1277] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: NCFPC mekfwapn-m1 updown 0 '' 0_0 0 255 0
DEBUG: [NewColourFromPercent@Weathermap.class.php:1277] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: NCFPC mekfwapn-m1 updown 100 '' 30_100 255 0 0
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscalekey='0_0' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscalekey='30_100' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscaletag='' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscaletag='' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note inscalecolor='#00ff00' to mekfwapn-m1
DEBUG: [add_note@Weathermap.class.php:118] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: Adding note outscalecolor='#ff0000' to mekfwapn-m1
DEBUG: [ReadData@Weathermap.class.php:1052] /opt/librenms/html/plugins/Weathermap/configs/Mate6.conf: ReadData: Setting 0,100
DEBUG: [ReadData@Weathermap.class.php: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

Post by AMIRarama »

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: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

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

Post by Howie »

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.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 5 guests