Switch Interface status weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

VictorJ
Posts: 13
Joined: Mon Apr 03, 2017 4:48 am

Re: Switch Interface status weathermap

Post by VictorJ »

Hi, thanks for replying.

The only error I found in logs is :

Code: Select all

[Fri Oct 27 12:04:54.686819 2017] [:error] [pid 77831] [client IP:55837] PHP Fatal error: 
Uncaught Error: Call to undefined method stdClass::asJS() in /opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php:3596\nStack 
trace:\n#0 /opt/librenms/html/plugins/Weathermap/editor.php(962): WeatherMap->asJS()\n#1 {main}\n 
thrown in /opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php on line 3596, 
referer: http://IP/plugins/Weathermap/editor.php
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Switch Interface status weathermap

Post by Howie »

Which versions of weathermap and cacti is this? I haven't seen that error before...

EDIT: Just noticed it's librenms. Why wouldn't you mention that??

Also just noticed that you don't have a TARGET for your node, so there is no value to look up in the scale. It will always be 0.
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!)
VAIBHAV
Posts: 4
Joined: Mon Sep 13, 2021 12:24 pm

Re: Switch Interface status weathermap

Post by VAIBHAV »

Hello @@@Howie

I want to config port up down status with change port BGCOLOR

please help .
my weathermap

# Automatically generated by php-weathermap v0.98a

FONTDEFINE 100 docs/example/Vera.ttf 10

WIDTH 1800
HEIGHT 1200
HTMLSTYLE overlib
KEYFONT 100
TITLE Simple Map
HTMLOUTPUTFILE simple.html
IMAGEOUTPUTFILE simple.png
TIMEPOS 746 17 Created: %b %d %Y %H:%M:%S

KEYPOS DEFAULT 45 56 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0 0 192 192 192
SCALE DEFAULT 0 1 255 255 255
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 55 0 240 0
SCALE DEFAULT 55 70 240 240 0
SCALE DEFAULT 70 85 255 192 0
SCALE DEFAULT 85 100 255 0 0

SET nowarn_clipping 1

# End of global section


# TEMPLATE-only NODEs:
NODE DEFAULT
LABELFONT 100
MAXVALUE 100


# TEMPLATE-only LINKs:
LINK DEFAULT
WIDTH 3
BWFONT 100
COMMENTFONT 100
BWLABEL bits
BANDWIDTH 1M


# regular NODEs:
NODE node03603
LABEL Core
POSITION 889 211

NODE node03605
LABEL Server
POSITION 895 517

NODE node03650
LABEL Port-46
POSITION 889 244


# regular LINKs:
LINK node03603-node03605
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=616
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=616&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /opt/cacti/rra/core_peering_traffic_in_520.rrd
NODES node03603 node03605
BANDWIDTH 10G



# That's All Folks!
***********************************
Port 46
NODE node03650
LABEL Port-46
POSITION 889 244

this node is using for port status

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

Re: Switch Interface status weathermap

Post by Howie »

OK. Did you read any of the three pages of the 10 year old thread you posted on the end of?

Does your Cacti already have interface status graphs?

What have you tried?

What did it do?
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!)
VAIBHAV
Posts: 4
Joined: Mon Sep 13, 2021 12:24 pm

Re: Switch Interface status weathermap

Post by VAIBHAV »

Yes have interface status graphs but i want to show it on weather map .

like port-46 status up port bgcolor green if down port bgcolor red

port optical power as well on beside of port.


.

Thanks.
Attachments
Untitled.png
Untitled.png (6.88 KiB) Viewed 4612 times
User avatar
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Re: Switch Interface status weathermap

Post by zoemu »

here is an example of mine, my Wetharmap is not fully integrated with cacti though...I runs with a separate poller.

Cacti version latest
modified version for 1.0 cacti an up

NODE ETH1_1_STATUS
USESCALE IFSTATUSODDF
OVERLIBCAPTION DWDM 10G SERVICE
OVERLIBGRAPH http://x.x.x.x/cacti/graph_image.php?lo ... height=120
POSITION 590 373
SET host_id 40
SET state_rrd_id 1500
SET graph_id 1718
ICON {node:this:inscaletag}
TARGET gauge:C:/inetpub/wwwroot/cacti/rra/01-dc-core-01_int_status_1500.rrd:int_status:-

SCALE IFSTATUSODDF 0.5 1.5 92 255 92 images/fibre2_1.png
SCALE IFSTATUSODDF 1.5 2.5 239 41 50 images/fibre2_2.png
SCALE IFSTATUSODDF 0 100 92 255 92 images/fibre2_0.png
VAIBHAV
Posts: 4
Joined: Mon Sep 13, 2021 12:24 pm

Re: Switch Interface status weathermap

Post by VAIBHAV »

Howie wrote: Mon Sep 13, 2021 12:47 pm OK. Did you read any of the three pages of the 10 year old thread you posted on the end of?

Does your Cacti already have interface status graphs?

What have you tried?

What did it do?


yes, i have interface status graphs.

when the port is down not changing the color
of this node

NODE node02382
LABEL XG-15
TARGET /opt/cacti/rra/core_int_status_169.rrd:int_status:-
USESCALE IFSTATUS in percent
POSITION 688 156


Here is my weather map config

# Automatically generated by php-weathermap v0.98a


WIDTH 4000
HEIGHT 3000
HTMLOUTPUTFILE test.html
IMAGEOUTPUTFILE test.png
TIMEPOS 67 48 Created: %b %d %Y %H:%M:%S

KEYPOS DEFAULT 1411 109 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0 0 192 192 192
SCALE DEFAULT 0 1 255 255 255
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 55 0 240 0
SCALE DEFAULT 55 70 240 240 0
SCALE DEFAULT 70 85 255 192 0
SCALE DEFAULT 85 100 255 0 0

SCALE RUNTIME 0 0.01 255 0 0 255 0 0
SCALE RUNTIME 0.01 10 255 0 0 255 150 0
SCALE RUNTIME 10 16 255 255 0 255 255 0
SCALE RUNTIME 16 20 100 255 0 150 255 0
SCALE RUNTIME 20 100 0 255 0 0 255 0
SCALE RUNTIME 100 300 0 255 0 0 255 0

SCALE cactiupdown 0 0.5 192 192 192
SCALE cactiupdown 0.5 1.5 255 0 0
SCALE cactiupdown 1.5 2.5 0 0 255
SCALE cactiupdown 2.5 3.5 0 255 0

SCALE IFSTATUS 0 1.5 0 255 0 Up
SCALE IFSTATUS 1.5 2.5 255 0 0 Down

SET key_hidezero_DEFAULT 1

# End of global section


# TEMPLATE-only NODEs:
NODE DEFAULT
LABELFONT 2
ICON images/ports_{node:this:int_status}.png
MAXVALUE 100


# TEMPLATE-only LINKs:
LINK DEFAULT
WIDTH 3
BANDWIDTH 1000M


# regular NODEs:
NODE node03791
LABEL Core
LABELOUTLINECOLOR none
LABELBGCOLOR none
ICON 300 30 box
TARGET cactihost:13
USESCALE cactiupdown in percent
POSITION 688 121

NODE node03798
LABEL M-3
ICON 150 20 box
POSITION 695 411

NODE node02382
LABEL XG-15
TARGET /opt/cacti/rra/core_int_status_169.rrd:int_status:-
USESCALE IFSTATUS in percent
POSITION 688 156


# regular LINKs:
LINK node03791-node03798
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=181
OVERLIBGRAPH /cacti/graph_image.php?local_graph_id=181&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /opt/cacti/rra/core_traffic_in_170.rrd
NODES node03791 node03798
VIA 691 253



# That's All Folks!

****************************************************

RRDtool Graph Syntax
RRDtool Command:



/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start='1633282980' \
--end='1633284780' \
--pango-markup \
--title='CORE - Status - XGigabitEthernet0/0/15 - **** Mikrotik 3 ****' \
--vertical-label='status' \
--slope-mode \
--base=1000 \
--height=50 \
--width=500 \
--tabwidth '30' \
--rigid \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 2021-10-03 23\:13\:00 To 2021-10-03 23\:43\:00\c" \
COMMENT:" \n" \
--color BACK#F3F3F3 \
--color CANVAS#FDFDFD \
--color SHADEA#CBCBCB \
--color SHADEB#999999 \
--color FONT#000000 \
--color AXIS#2C4D43 \
--color ARROW#2C4D43 \
--color FRAME#2C4D43 \
--border 1 --font TITLE:11:'Arial' \
--font AXIS:8:'Arial' \
--font LEGEND:8:'Courier' \
--font UNIT:8:'Arial' \
--font WATERMARK:6:'Arial' \
--slope-mode \
--watermark 'Generated by Cacti®' \
DEF:a='/opt/cacti/rra/core_int_status_169.rrd':'int_status':AVERAGE \
DEF:b='/opt/cacti/rra/core_int_status_169.rrd':'int_status':LAST \
AREA:a#FFC73BFF:'Current status\:' \
GPRINT:a:LAST:'%8.2lf%s\n' \
COMMENT:'(1 = Up | 2 = Down)\n'
RRDtool Command lengths = 998 charaters.
RRDtool Says:
OK
Attachments
interface status.png
interface status.png (39.19 KiB) Viewed 4417 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Switch Interface status weathermap

Post by Howie »

NODE node02382 looks like it should work OK. What do the logs say? You get warnings for most typical issues (missing icons, missing data, etc).

If that doesn't help, try with DEBUG logging enabled for one poll. You'll get a LOT more information about what Weathermap is doing, what data it fetched, which scale it looked at, what the result was, etc etc. Don't forget to turn it off again!

This bit in the default node will probably cause some errors:

ICON images/ports_{node:this:int_status}.png

Since nothing you have shown is setting the "int_status" value for a node. You'll probably get something complaining about no image file called "ports_{unknown}.png" or something like that. If you removed that line though, you should get the label of node node02382 changing colour, unless there is something less obvious wrong.
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!)
VAIBHAV
Posts: 4
Joined: Mon Sep 13, 2021 12:24 pm

Re: Switch Interface status weathermap

Post by VAIBHAV »

Howie wrote: Sun Oct 03, 2021 1:31 pm NODE node02382 looks like it should work OK. What do the logs say? You get warnings for most typical issues (missing icons, missing data, etc).

If that doesn't help, try with DEBUG logging enabled for one poll. You'll get a LOT more information about what Weathermap is doing, what data it fetched, which scale it looked at, what the result was, etc etc. Don't forget to turn it off again!

This bit in the default node will probably cause some errors:

ICON images/ports_{node:this:int_status}.png

Since nothing you have shown is setting the "int_status" value for a node. You'll probably get something complaining about no image file called "ports_{unknown}.png" or something like that. If you removed that line though, you should get the label of node node02382 changing colour, unless there is something less obvious wrong.


I have removed
ICON images/ports_{node:this:int_status}.png

Getting these error logs

2021-10-04 00:10:03 - WEATHERMAP WARNING: [Map 1] test.conf: ReadData: NODE node02382, target: /opt/cacti/rra/core_int_status_169.rrd:int_status:- on config line 77 of /opt/cacti/plugins/weathermap/configs/test.conf had no valid data, according to WeatherMapDataSource_rrd
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests