Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Label color change depending on node UP/DOWN status #63

Open
rickard-tpo opened this issue Nov 17, 2019 · 9 comments
Open

Comments

@rickard-tpo
Copy link

Hello!
I don't know if anyone is actively maintaining this plugin, but I have (what I believe is) a small feature request.

It would be cool having the labels changing color depending on the node being up or down on in LibreNMS, similar to how it looks in Mikrotik The Dude.

I believe it is the LABELBGCOLOR option mentioned in the Weathermap's documentation (https://network-weathermap.com/manual/0.97b/pages/config-reference.html#NODE_COLORS) which needs to be intergrated with the LibreNMS macros.device_up/down macro.

@andrewdkennedy1
Copy link

@anishresthanish
Copy link

I've achieved this with the following

https://github.com/andrewdkennedy1/Weathermap/blob/master/lib/datasources/WeatherMapDataSource_libreAPI.php

Hi, could you help tell me how to add this to librenms.

@wayneleetw
Copy link

wayneleetw commented Jan 31, 2023

I put under the node with
TARGET libreAPI:hostname
USESCALE updown out
my label only show red color.. and if i turn the node server down the color still red...

@andrewdkennedy1
Copy link

andrewdkennedy1 commented Jan 31, 2023

Here's a full example of a node in my conf

NODE cs-bmp-boff1-se.network
        LABEL cs-bmp-boff1-se
        INFOURL /device/device=354/
        NOTES {node:this:libreAPI_sysDescr}<br>{node:this:libreAPI_version}<br>{node:this:libreAPI_IP}<br>{node:this:libreAPI_MAC}<br>{node:this:libreAPI_serial}<br>{node:this:libreAPI_uptime}
        OVERLIBGRAPH /graph.php?height=100&width=512&device=354&type=device_bits&legend=no
        ICON 80 80 images/WorkgroupSwitch.png
        TARGET libreAPI:{node:this:name}
        USESCALE updown out percent
        LABELOFFSET 0 10
        POSITION 700 1050

I think you're missing percent at the end of your USESCALE line.

Also dont remember if hostname works the way you're using it. I target them with {node:this:name}

@wayneleetw
Copy link

wayneleetw commented Feb 1, 2023

Hi Andrew,

Thanks for the reply, I put the percent in the conf. but still have the same.
I am thinking will it be the TARGET libreAPI:hostname issue?
I also try to put my node IP as my hostname but it is not working.
This is my config for node, could you take a look? many thanks!!!

NODE 21
LABEL 172.18.1.5
INFOURL http://librenms.mydomain.local/device/device=21/
OVERLIBGRAPH http://librenms.mydomain.local/graph.php?height=100&width=512&device=21&type=device_bits&legend=no
ICON images/Host.png
TARGET libreAPI:172.18.1.5
USESCALE updown out percent
POSITION 771 94

@andrewdkennedy1
Copy link

Did you make an api key and update the plug-in file with it?

function ReadData($targetstring, &$map, &$item)
    {
        //created and set via http://librenms/api-access
        $weatherapikey = "d8f3e7b79d20e6f41c715e7abcfffaa5";
        $librenmsurl = "http://librenms";
        //set the above to match your env

@wayneleetw
Copy link

Did you make an api key and update the plug-in file with it?

function ReadData($targetstring, &$map, &$item)
    {
        //created and set via http://librenms/api-access
        $weatherapikey = "d8f3e7b79d20e6f41c715e7abcfffaa5";
        $librenmsurl = "http://librenms";
        //set the above to match your env

you are right, I missed the part... thank you, my label is working fine now!!

@geethreeforce
Copy link

geethreeforce commented Nov 1, 2023

I have the same issue. Generated the api-key configured the datasource: WeatherMapDataSource_libreAPI.php

Modified my configs/weathermap.conf file

SCALE updown 0 0 255 0 0
SCALE updown 0.5 1 255 255 255

And added:
USESCALE updown out percent
TARGET libreAPI:{node:this:name}

Yet all my nodes are now coloring red.
There's one thing.
Access to my librenms environment is https enforced.
Could the issue be caused because of this?

@G2Net
Copy link

G2Net commented Apr 23, 2024

It's all red for me too. I'm looking for a solution for weeks, but the documentation is barely existent for this plugin...
ApiKey created, WeatherMapDataSource_libreAPI.php configured, and netmap.conf have:
`
SCALE updown 0 0 255 80 80
SCALE updown 0.5 1 90 255 100

NODE node02823
LABEL SW01_PAE_6730
ICON images/Router.png
TARGET libreAPI:{node:this:name}
USESCALE updown out percent
POSITION 960 1600
`

Any help please? I'm kinda stuck at this point...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants