howardjones / network-weathermap Goto Github PK
View Code? Open in Web Editor NEWNetwork Weathermap draws diagrams from data
Home Page: http://www.network-weathermap.com/
License: MIT License
Network Weathermap draws diagrams from data
Home Page: http://www.network-weathermap.com/
License: MIT License
The picker in the editor should allow backend plugins to supply lists of possible targets. This will allow picking for other data source plugins without editing the actual editor code.
Replace the existing prefix-based multipliers and implicit add, with a full mathematical expression parser. This would allow you to do things like MAX(target1,target2) and (target1/target2) (i.e. dynamic percentages).
Hi,
When I add a directive in lower case from the web editor It doesn't take it but it works on Upper case.
I noticed it only on this branch.
I've been doing some fairly extensive testing with the new cacti v 1.0 (now available on github... yay!) and was wondering about the current compatibility of the network-weathermap plugin.
Is there a particular branch that is more likely to work than another?
I'd be happy to test things out if it would be helpful.
Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /var/www/net.musurit.monitoring/plugins/weathermap/weathermap-cacti-plugin-mgmt.php:837 Stack trace: #0 /var/www/net.musurit.monitoring/plugins/weathermap/weathermap-cacti-plugin-mgmt.php(274): add_config('simple.conf') #1 {main} thrown in /var/www/net.musurit.monitoring/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 837
I use Nginx + php-fpm (php70)
That's it - no more arrays passed around.
Link bwlabels are clickable, but the arrow itself isn't?
That's it. Move this stuff out of WeatherMap.
This projects heavily relies upon mysql_* functionality from PHP and no other MySQL interface can be chosen, since it is hardcoded. Therefore it does not work with PHP7. The underlying database shouldn't be too much of a deal and should be configurable. At the very least mysqli should be used to stay compatible with PHP7.
There's no particular reason why targets are limited to 2 channels (in and out). Multi-channel targets could allow for error counters, for example. This would need some clean up of the config language so it refers to something like channel 0 instead of 'in', at least as an alias.
PEAR is complicated on non-Linux systems, and is becoming less supported for modern PHP. Find or write a replacement command-line parser for the command-line weathermap tool.
In random-bits/cacti-integrate.php the logic for generating the target should be reversed:
current code reads:
if ($use_dsstats) {
....
} else {
$tgt = "8*dsstats:$local_data_id" . $ds_names;
....
}
when $use_dsstats is true is should use the contents of the second clause, not the first.
Centos 6.8 with PHP 5.3.3 and network-weathermap 0.89 pulled from github today. MRTG only, no Cacti
MRTG and Apache up and polling properly. Working through the install instructions here I try and run weathermap and get the following error:
PHP Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/html/weathermap/weathermap on line 60
Line 60 is
if ((new PEAR)->isError($ret)) { die ("Error in command line: " . $ret->getMessage() . "\n (try --help)\n"); }
I can launch the editor and work with conf files but when I try to generate the html page I get the same error. Both check.php and check-gdbug.php come back perfect.
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/net.musurit.monitoring/plugins/weathermap/cacti-pick.php:69 Stack trace: #0 {main} thrown in /var/www/net.musurit.monitoring/plugins/weathermap/cacti-pick.php on line 69
I use Nginx + php-fpm ( PHP70 )
Sometimes when I edit hosts from the web editor and have a look at the conf file from the linux shell I see that the host I've just edited got all this ^M characters. The directive I've added to the original conf on this case was the "LABELFONT 99".
I waited for a polling interval to see if weathermap fixes it after updating the map but It doesn't.
BTW I noticed this on 0.98 as well as the database-refactor branch.
NODE timelabel_London^M
TEMPLATE tz^M
LABEL {node:this:time_time24}^M
TARGET time:Europe/London^M
LABELFONT 99^M
POSITION 270 118^M
^M
I saw in the weathermap propaganda content to see a server rack map, this is how to draw it? Request for comment
Needs testing and fixing (or removing).
I love weathermap but the visual appearance is kind of dated.
Compare this drawing (prob. Visio)
http://news.reannz.co.nz/wordpress/wp-content/uploads/2012/07/REANNZ_MAP_July12.jpg
To the real weathermap:
http://weathermap.reannz.co.nz/
If it could look more like the drawing that would be awesome. Smooth curved lines, modern fonts etc.
More refactoring to simplify drawing code
I have a rather large map with several nodes and links on the right side of the map. when i mouse-over the link, tha bandwith graphs are "hidden" outside of the browser window. If I resize the browser window i see the whole graph.
Is there a config option to display the overlib graph on the left side of the mouse?
I'm using the phpweathermap V0.97c on a FreeBSD System
All DS plugins have a list of their targets in advance now, so could prefetch all the data with a single external process.
The editor things $map->fonts should be a list of font_ids, not a WMFontTable object.
Hello!
I'm using weathermap for few maps that are over 5k x 5k pixels in size and in my opinion it's time to rewrite code to use another rendering engine to make it look more fresh. I wonna replace all function calls with something like RE[::|->]filledarc(...) (RE for Render Engine).
Is now good time to fork project and replace that code or it's better for me to write those render engine class and write script to rewrite [by regex] all calls to graphics functions (to make it possible replacing calls in future versions of map)?
Save some more preg_match calls.
Based on database-refactor branch web editor.
When you want to pick a DS for a link that option is no longer there.
Hello,
Yesterday, after network-weathermap upgrade (0.97c->0.98), my maps are freezed at 08:05AM.
Even so the files in output directory are updated:
24 -rw-r--r-- 1 cactiuser cactiuser 24373 Jun 3 11:15 040ae8b1624617bd7da3.html
28 -rw-r--r-- 1 cactiuser cactiuser 25469 Jun 3 11:15 040ae8b1624617bd7da3.png
4 -rw-r--r-- 1 cactiuser cactiuser 1032 Jun 3 11:15 040ae8b1624617bd7da3.results.txt
12 -rw-r--r-- 1 cactiuser cactiuser 10294 Jun 3 11:15 040ae8b1624617bd7da3.thumb.png
32 -rw-r--r-- 1 cactiuser cactiuser 31371 Jun 3 11:15 0e08b428f2362608fb02.html
28 -rw-r--r-- 1 cactiuser cactiuser 28551 Jun 3 11:15 0e08b428f2362608fb02.png
4 -rw-r--r-- 1 cactiuser cactiuser 1323 Jun 3 11:15 0e08b428f2362608fb02.results.txt
Those file are perfectly viewed from explorer.
In cacti.log file:
06/03/2016 11:20:21 AM - WEATHERMAP: Poller[0] [Map 141] map.conf: Map: /var/www/localhost/htdocs/cacti-0.8.8h/plugins/weathermap/configs/map.conf -> /var/www/localhost/htdocs/cacti-0.8.8h/plugins/weathermap/output/1fc33f91f3df819f1f5f.html & /var/www/localhost/htdocs/cacti-0.8.8h/plugins/weathermap/output/1fc33f91f3df819f1f5f.png
06/03/2016 11:20:22 AM - WEATHERMAP: Poller[0] [Map 141] map.conf: About to write image file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]
06/03/2016 11:20:22 AM - WEATHERMAP: Poller[0] [Map 141] map.conf: Wrote map to /var/www/localhost/htdocs/cacti-0.8.8h/plugins/weathermap/output/1fc33f91f3df819f1f5f.png and /var/www/localhost/htdocs/cacti-0.8.8h/plugins/weathermap/output/1fc33f91f3df819f1f5f.thumb.png
06/03/2016 11:20:22 AM - WEATHERMAP: Poller[0] STATS: Weathermap 0.98 run complete - Fri, 03 Jun 16 11:20:22 +0300: 20 maps were run in 13 seconds with 5 warnings.
In cacti, weathermap tab i have a strange thing:
Powered by PHP Weathermap version 0.97c --- Weathermap Management | Local Documentation | Editor
and all maps freezed at date: Jun 2 2016 08:05 AM, the date&time before upgrade.
What can i do? It's from cacti or from plugin?
Thank you & sorry for my unexercised english.
I'm currently using refactor branch.
A couple a days ago every time I cloned a host it never showed up because it was only clonning the host by adding the _copy and no directive at all. So the cloned host was on the .conf file but without any other directive than POSISTION.
Today I updated to latest github commits and now it looks like totally broken. Every time I clone a host it does nothing, nor even creating the new host with _copy on it.
The map list in Cacti should be a cleaner, simpler list:
Most likely because we've moved to WMScale, not a lot of action for scales in the editor.
Hi Howie etc,
Can you extend parsing so that {node:...} and {link:...} can be used in more places, particularly variable assignments? I want to have this construct:
LINK CurSX_McC1-10G
NODES mccance1 cursx
SET src mccance1
SET ip {node:mccance1:ip}
SET group {node:mccance1:group}
but SET ip {node...} doesn't get replaced.
I've already defined variable 'ip' on the node so it can be used in the node OVERLIBGRAPH (inherited from NODE DEFAULT, for CPU), so I just want to be able to call that value back so it will get used for the link OVERLIBGRAPH too (inherited from LINK DEFAULT).
At the moment, I have to explicitly SET ip with the actual IP address on the link as well in order for OVERLIBGRAPH to work, but since I've already had to do that on the node, that's just repeating information. And I like to avoid that at all costs!
Thanks for considering. Love weathermap.
I'm looking to use NWM as a replacement for a commercial application called InterMapper. One of the handy features of InterMapper is that the server keeps track of 'packet loss' for a node. If the server detects a certain level and interval of packet loss, it changes the colour of the node itself to depict that the node is in trouble and to what degree of trouble it's in.
I'm wondering if NWM has the capability to dynamically change a node's (or perhaps a node's label) colour similar to how a change in link bandwidth causes the link colour to change.
It looks like the wmrrd_read_from_real_rrdtool_aggregate function drops first line of RRDTool output, but using RRDtool 1.5.5, there is no leading blank line in the output of the rrdtool command. So I lose the first ("IN:") line. If I comment out lib/datasources/WeatherMapDataSource_rrd.php line 276, it works as expected.
Means testable code for UI, plus a separate API if someone wanted to write another editor.
Bandwidth links can already be re-positioned from the default (75% 25% for IN OUT) so they aren't sitting on top of each other. However on crowded maps doing this manually can be very tedious. Maps can be made bigger as well but re-spacing all the nodes out is only slightly less tedious. Also using template to move all links doesn't usually solve the issue it just changes the position where all the overlaps occur slightly.
It would be nice if there was an algorithm to detect if links are/will display on top of each other and if possible try to slightly maneuver themselves in whatever direction along the graph as little as possible to not be on top of each other. This way users won't have to use the BWLABELPOS a custom amount repeated a bazillion times for every different link.
Algo might be something like:
A) detect label overlap and attempt move up/down along link in direction that would make less overlap
B) attempt also to not overlap node icons but this is preferable to overlap of labels if unavoidable
C) detect if truetype font in use and rotate label/text as necessary to create more room (last priority)
Just some ideas.
Hi Howard -
I just wanted to post the fix i found for the following error:
PHP Warning: preg_match(): Unknown modifier '1' in /var/www/html/weathermap/lib/datasources/WeatherMapDataSource_tabfile.php on line 41 WARNING: /var/www/html/weathermap/configs//SW_CTX-WTK_CAREN.conf: ReadData: LINK 1/1/1.AUSUTXZM71W-4/1/1.AUSBTX5203W, target: data/SW_CTX-WTK_CAREN.txt on config line 333 of /var/www/html/weathermap/configs//SW_CTX-WTK_CAREN.conf had no valid data, according to WeatherMapDataSource_tabfile
basically if $itemname has a forward slash, it will kick back this error. Quickest fix was to the following function:
`
function ReadData($targetstring, &$map, &$item)
{
$data[IN] = NULL;
$data[OUT] = NULL;
$data_time=0;
// OLD Line
// $itemname = $item->name;
// NEW Line
$itemname = preg_quote($item->name,'/');
$matches=0;
$fd=fopen($targetstring, "r");
`
If you have any questions, please reachout [email protected]
Thanks,
Bryan
Weathermap uses a static value of 300s not the configurable page_refresh intervall
http://forums.cacti.net/viewtopic.php?f=16&t=54222
Mysql doesn't like them, which kills the install/upgrade process.
Need rewrite before 0.98a
Create an Ubuntu 16 install with PHP 5.6 like this:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
sudo apt-get install php5.6-common php5.6-cli php5.6-xml php5.6-snmp php5.6-gd
sudo apt install unzip
sudo a2dismod php7.0
sudo a2enmod php5.6
sudo rm /etc/alternatives/php
sudo ln -s /usr/bin/php5.6 /etc/alternatives/php
sudo apt-get install cacti cacti-spine
sudo service apache2 restart
Install weathermap 0.98 and add a map.
[Mon Sep 05 19:28:27.803109 2016] [:error] [pid 4638] [client 10.0.2.2:61766] PHP Warning: mysql_insert_id(): A link to the server could not be established in /usr/share/cacti/site/plugins/weathermap/weathermap-cacti-plugin-mgmt.php on line 843, referer: http://127.0.0.1:8080/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
[Mon Sep 05 19:28:27.803115 2016] [:error] [pid 4638] [client 10.0.2.2:61766] PHP Stack trace:, referer: http://127.0.0.1:8080/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
[Mon Sep 05 19:28:27.803120 2016] [:error] [pid 4638] [client 10.0.2.2:61766] PHP 1. {main}() /usr/share/cacti/site/plugins/weathermap/weathermap-cacti-plugin-mgmt.php:0, referer: http://127.0.0.1:8080/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
[Mon Sep 05 19:28:27.803126 2016] [:error] [pid 4638] [client 10.0.2.2:61766] PHP 2. add_config() /usr/share/cacti/site/plugins/weathermap/weathermap-cacti-plugin-mgmt.php:274, referer: http://127.0.0.1:8080/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
[Mon Sep 05 19:28:27.803132 2016] [:error] [pid 4638] [client 10.0.2.2:61766] PHP 3. mysql_insert_id() /usr/share/cacti/site/plugins/weathermap/weathermap-cacti-plugin-mgmt.php:843, referer: http://127.0.0.1:8080/cacti/plugins/weathermap/weathermap-cacti-plugin-mgmt.php?action=addmap_picker
Entry does appear in the weathermap_maps table, but following updates fail (because of no useful value from mysql_insert_id()
)
Hi
i have a error when i start weathermap :
[systemadmin@weathermap html]# ./weathermap
PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 109
anyone know this error ?
CentOS Linux release 7.3.1611
Package Version State
Archive_Tar 1.3.11 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
PHP 5.4.16
regards
olivier
FONTDEFINE 100 /var/www/html/plugins/weathermap/msyh.ttf 10
WIDTH 1024
HEIGHT 768
HTMLSTYLE overlib
KEYFONT 100
TITLE test
TIMEPOS 746 17 Created: %b %d %Y %H:%M:%S
KEYPOS DEFAULT 823 491 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
NODE DEFAULT
LABELFONT 100
MAXVALUE 100
LINK DEFAULT
WIDTH 2
BWFONT 100
COMMENTFONT 100
BWLABEL bits
BANDWIDTH 100M
NODE 互联网交换机01
LABEL 互联网交换机01
INFOURL /graph.php?rra_id=all&local_graph_id=11
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=11
POSITION 802 370
NODE 互联网交换机02
LABEL 互联网交换机02
INFOURL /graph.php?rra_id=all&local_graph_id=17
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=17
POSITION 953 370
NODE node08151
LABEL Node
INFOURL /graph.php?rra_id=all&local_graph_id=39
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=39
POSITION 800 174
NODE 电信网
LABEL 电信网
ICON images/Cloud-Filled.png
POSITION 802 66
NODE node05202
LABEL Node
POSITION 955 177
NODE 联通网
LABEL 联通网
ICON images/Cloud-Filled.png
POSITION 953 66
NODE 内层防火墙01
LABEL 内层防火墙01
POSITION 470 210
NODE 内层防火墙02
LABEL 内层防火墙02
POSITION 621 210
NODE 核心路由器02
LABEL 核心路由器02
POSITION 621 54
NODE 核心路由器01
LABEL 核心路由器01
POSITION 470 54
NODE 核心交换机01
LABEL 核心交换机01
POSITION 470 370
NODE 核心交换机02
LABEL 核心交换机02
POSITION 621 370
NODE 数据库服务器A
LABEL 数据库服务器A
INFOURL /graph.php?rra_id=all&local_graph_id=124
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=124
POSITION 427 442
NODE 数据库服务器B
LABEL 数据库服务器B
INFOURL /graph.php?rra_id=all&local_graph_id=151
OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=151
POSITION 621 444
NODE 内网汇聚01
LABEL 内网汇聚01
POSITION 108 370
NODE 内网汇聚02
LABEL 内网汇聚02
POSITION 297 370
LINK node1-node2
INFOURL /graph.php?rra_id=all&local_graph_id=16
OVERLIBGRAPH /graph_image.php?local_graph_id=16&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/sw01_traffic_in_19.rrd
NODES 互联网交换机02 互联网交换机01
LINK node08151-互联网交换机01
INFOURL /graph.php?rra_id=all&local_graph_id=39
OVERLIBGRAPH /graph_image.php?local_graph_id=39&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/f5-01_traffic_in_42.rrd
NODES node08151 互联网交换机01
LINK 电信网-node08151
NODES 电信网 node08151
LINK 联通网-node05202
NODES 联通网 node05202
LINK 联通网-node05202a
NODES 联通网 node05202
LINK 联通网-node05202aa
NODES 联通网 node05202
LINK node05202-互联网交换机02
NODES node05202 互联网交换机02
LINK node08585-node08590
NODES 内层防火墙02 核心交换机02
LINK node08585-node08580
NODES 内层防火墙02 内层防火墙01
LINK node08588-node08580
INFOURL /graph.php?rra_id=all&local_graph_id=83
OVERLIBGRAPH /graph_image.php?local_graph_id=83&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/01_traffic_in_86.rrd
NODES 核心交换机01 内层防火墙01
LINK node08588-node08590
NODES 核心交换机01 核心交换机02
LINK 核心路由器01-内层防火墙01
INFOURL /graph.php?rra_id=all&local_graph_id=46
OVERLIBGRAPH /graph_image.php?local_graph_id=46&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/01_traffic_in_49.rrd
NODES 核心路由器01 内层防火墙01
LINK 内层防火墙02-核心路由器02
INFOURL /graph.php?rra_id=all&local_graph_id=57
OVERLIBGRAPH /graph_image.php?local_graph_id=57&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/02_traffic_in_60.rrd
NODES 内层防火墙02 核心路由器02
LINK 互联网交换机01-内层防火墙01
INFOURL /graph.php?rra_id=all&local_graph_id=16
OVERLIBGRAPH /graph_image.php?local_graph_id=16&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/sw01_traffic_in_19.rrd
NODES 互联网交换机01 内层防火墙01
LINK 内层防火墙02-互联网交换机02
INFOURL /graph.php?rra_id=all&local_graph_id=20
OVERLIBGRAPH /graph_image.php?local_graph_id=20&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/sw02_traffic_in_23.rrd
NODES 内层防火墙02 互联网交换机02
LINK 核心路由器01-核心路由器02
INFOURL /graph.php?rra_id=all&local_graph_id=53
OVERLIBGRAPH /graph_image.php?local_graph_id=53&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300
TARGET /var/www/html/rra/01_traffic_in_56.rrd
NODES 核心路由器01 核心路由器02
LINK 内层防火墙01-内网汇聚01
NODES 内层防火墙01 内网汇聚01
LINK 内层防火墙02-内网汇聚02
NODES 内层防火墙02 内网汇聚02
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.