Tuesday, July 15, 2014

Using PHP Weathermap with Observium

The PHP Weathermap plugin is a very popular tool for mapping the link load of a network environment. It is usually used as a plugin to Cacti or MRTG but as Observium is gaining popularity I decided to make a quick guide for how you get the weathermap nicely integrated with Observium in a way that does not break when updating to newer versions of Observium.

This guide assumes that you have a working installation of Observium already, preferably a installation that was done using the Debian/Ubuntu-guide.

1. Download the modified version of PHP Weathermap from github github: https://github.com/ZerxXxes/weathermap-for-observium and put it in your observium/html-directory.
The easiest way to do this is using git:
cd /opt/observium/html/
git clone https://github.com/ZerxXxes/weathermap-for-observium.git weathermap
2. If you have used different paths for observium or the weathermap-plugin you will need to edit the variables in data-pick.php and map-poller.php, if you are following the installation guide then the default variables will work.

3. open the file editor.php and change the value in the beginning to:
 $ENABLED=true
As long as this value is true everyone who knows the right URL will be able to access the weathermap editor, its therefore recommended to change this value back to false as soon as you are done editing.

4. Make sure the directory configs/ is writable by your webserver, one way is to change to owner of the directory to the webserver-user: (in Ubuntu the webserver user is usually called www-data)
cd weathermap/
chown www-data:www-data configs/
5. Create a new directory called maps/ and make the webserver-user the owner
mkdir maps/
chown www-data:www-data maps/
6. Now use your webbrowser and access the editor in weathermap/editor.php (i.e. surf to observium.myurl.com/weathermap/editor.php)

7. Create a new map by writing a name and click create map. Note that the map name *must* end with .conf (i.e. networkmap.conf)
Edit your map, create nodes and draw links and then pick graphs from Observium to use with the links.
*NOTE* Under Map Properties, make sure to define Output HTML Filename to maps/<mapname>.html and Output Image Filename to <mapname>.png




8. Make the file map-poller.php executable for your system by doing:
chmod +x map-poller.php
9. Add a new line in the cronjob at /etc/cron.d/observium after the Observium polling and discovery:
*/5 * * * * root /opt/observium/html/weathermap/map-poller.php >> /dev/null 2>&1
10. Move the file navbar-custom.inc.php in the observium/html/includes/-directory. This file does not exist by default in Observium but Observium looks for this file and include the code from it if it exists, this makes it possible to add custom menus that does not break when you upgrade you Observium installation.
mv navbar-custom.inc.php /opt/observium/html/includes/navbar-custom.inc.php
*NOTE*
 If you are using the current community edition (based on revision 5229) or any revision older than 5670 you should instead use the file navbar-custom-old.inc.php and rename it.


Now that's it!
All .html-files in the maps/-directory will be linked in a sub menu in the Observium GUI like this:


Clicking on one of them will take you to the rendered weathermap where you will get a nice overview of your networks load.
Hovering the mouse over a link will show the Observium graph for that link like this:


And clicking on a link will take you to the Observium-page for that link.

Hope this guide has been helpful for you and thank you for reading!

86 comments:

  1. Thanks for this, great addition to Observium!

    ReplyDelete
    Replies
    1. IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in Chennai For CSE provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


      This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

      Delete
    2. Thanks mate, worked as described in your blog!

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Thanks for the tutorial, I really like this! How did you add the Traffic Load legend? Also, are you actively working on this?

    ReplyDelete
    Replies
    1. I'm not working on the PHP Weathermap or editor itself, its a whole different project which I have no part in found here: http://www.network-weathermap.com/
      I only did some coding for having the gui in observium work with the weathermap.

      Delete
  4. Disregard my "Traffic Load legend" question, turns out it was simple enough :P

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. map-poller.php is not generating any html file. When I run it from CLI; go the following output:

    PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Console/Getopt.php on line 109
    PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Console/Getopt.php on line 154
    PHP Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Console/Getopt.php on line 154
    PHP Strict Standards: Non-static method PEAR::isError() should not be called statically in /opt/observium/html/weathermap/weathermap on line 60
    WARNING: configs//networkmap.conf: OVERLIBGRAPH is used, but HTMLSTYLE is static. This is probably wrong. [WMWARN41]

    Any clue?

    ReplyDelete
    Replies
    1. Hi,

      Did you ever figure out what the issue is by any chance. I am getting almost the exact error when I run it from cli and it doesn't generate any maps.

      Thank you in advance.

      Delete
    2. you need to add a @ in the php files before the PEAR - meaning @PEAR::isError instead of PEAR::isError

      Delete
  7. Getting "This editor is not finished!" and won't create a new map, any ideas where to start here? Cheers

    ReplyDelete
  8. Everything's working for me except I don't get graphs when I hover over links. What might I be missing from the configuration, please? I can _click_ on a link and it takes me to that link's graph, but there's nothing on mouseover...

    ReplyDelete
    Replies
    1. OK, I figured this one out. I needed to manually edit each of the .conf files to include the line "HTMLSTYLE overlib" somewhere near the top.

      Delete
  9. Hey, I re-installed with git and grabbed the latest files and now my map-poller.php doesn't generate any maps! Also, when I run it I don't get any sort of output what so ever. Even when running with the "-d" option. Anybody seen this before? Any help would be greatly appreciated. Thanks

    ReplyDelete
  10. FYI I'm at the new CE Rev 6000 for Observium. I tried reverting to older code for weathermap but no dice. The map-poller.php just doesn't do anything :(. Heads up if anyone is upgrading to rev 6000.

    ReplyDelete
  11. Was anyone able to figure out the issue with graphs not being created? I am not getting any errors, see below.

    [root@observe weathermap]# /opt/observium/html/weathermap/map-poller.php -d
    DEBUG!
    Conf dir: configs/
    Opened directory configs/
    File to be run is lab.conf
    Running php ./weathermap --config configs//lab.conf --base-href /weathermap/

    ReplyDelete
  12. Dear All,

    I configured weathermap using the link

    http://blog.best-practice.se/2014/07/using-php-weathermap-with-observium.html?m=1

    But when I get to the observium GUI, I get the weathermap link under the
    Overview but I don't get to see any graphs.

    ReplyDelete
    Replies
    1. Hello,
      did you create new maps from scratch or did you copy existing ones?
      If you copied them from cacti make sure to modify them according to step 7.

      Delete
    2. I'm having the same issue, and I created a new map.

      Delete
  13. In latest observium community edition (11.6000) html creation is not working..
    You have to comment out:

    include("../../includes/functions.php"); in map-poller.php

    replace PEAR::isError with @PEAR::isError in /usr/share/php/Console/Getopt.php

    then the html files is generated..

    Turn on debugging :
    $weathermap_debugging=TRUE;
    in /opt/observium/html/weathermap/weathermap
    and run
    php ./weathermap --config configs/networkmap.conf --base-href /weathermap/

    //Magnus

    ReplyDelete
    Replies
    1. I'm still getting errors with this. I have Weathermap in the Observium dropdown, however there are no maps to click on. When I run the last command you mention I get the following errors:

      root@server:/opt/observium/html/weathermap# php ./weathermap --config configs/networkmap.conf --base-href /weathermap/

      PHP Warning: fopen(configs/networkmap.conf): failed to open stream: No such file or directory in /opt/observium/html/weathermap/lib/Weathermap.class.php on line 1789

      PHP Warning: file_get_contents(configs/networkmap.conf): failed to open stream: No such file or directory in /opt/observium/html/weathermap/lib/Weathermap.class.php on line 3080

      Delete
  14. Hi Best Practice

    I know nothing about PHP development management so i was wondering if you tell me how to display my maps in observium home page where the google maps appear with out going to a new page.

    its bit tedious having to go back the whole time to view a new map?

    i hope the above makes sense.

    ReplyDelete
  15. navbar-custom-old.inc.php

    Someone can share the link of this file?

    ReplyDelete
    Replies
    1. http://best-practice.se/dump/navbar-custom-old.inc.php.txt

      Delete
    2. Thanks best-practice for that file. I have created the file navbar-custom.php in the directory /opt/observium/html/includes/ and the sub-menu Weathermap appears now on observium web page

      Delete
  16. This comment has been removed by the author.

    ReplyDelete
  17. I was attempting to follow along when I noticed that the repository was no longer being hosted by Neil. I searched through his similar repositories and it only applies to his new project.

    Does anyone have the original repository cloned/forked so that I can grab a copy of it?

    ReplyDelete
    Replies
    1. Found this dump that someone did and don't see any issues: (Does this have changes listed above?)
      https://github.com/nicolasvion/weathermap-for-observium/

      Delete
    2. This version is working (and safe) as of commit "49bd19a".

      I am however having the issue with graphs not appearing on hovering over links. I've set "HTMLSTYLE overlib" in the config but it doesn't seem to be resolving the issue. Any thoughts?

      Delete
    3. This comment has been removed by the author.

      Delete
    4. I needed to move overlib.js down a directory into /opt/observium/html/

      After, I needed to fix the map-poller.php line about rrdcached as Magnus had above.

      Delete
  18. This comment has been removed by a blog administrator.

    ReplyDelete
  19. Hello,

    Very good article. Thanks a lot.

    I was able to fully integrate weathermap with observium into a raspberry pi3
    But i am wondering if it is possible to integrate the network weathermap plugin in observium in a way that is showed in the frontpage instead of the geomap

    Thank you !

    ReplyDelete
  20. Hello,

    Very good article. Thanks a lot.

    I was able to fully integrate weathermap with observium into a raspberry pi3
    But i am wondering if it is possible to integrate the network weathermap plugin in observium in a way that is showed in the frontpage instead of the geomap

    Thank you !

    ReplyDelete
    Replies
    1. Hi, I'd like to have the Weathermap on the frontpage instead too. I think this should be possible as you can configure the frontpage elements etc, but not sure if it works with a plugin.

      Delete
  21. not working on Observium CE 0.16.1.7533

    ReplyDelete
  22. Still working on 0.16.5.7863 (rolling). I installed it way back when I had the CE from the beginning of 2015.

    ReplyDelete
    Replies
    1. maybe it works if you upgraded from earlier versions, but try to edit maps. On CE i'm trying a fresh install.

      Delete
  23. Is your project still available on GitHub? I'm getting an error when trying to pull it into the HTML directory.

    ReplyDelete
  24. /opt/observium/html/weathermap# ./map-poller.php
    PHP Fatal error: require_once(): Failed opening required '/includes/db.inc.php' (include_path='.:/usr/share/php') in /opt/observium/includes/definitions.inc.php on line 438

    ReplyDelete
  25. I found a few alternatives to the non-working GIT respository in the doc: https://github.com/search?utf8=%E2%9C%93&q=observium+weathermap&type=Repositories&ref=searchresults
    please let the community know your successes & failures...

    ReplyDelete
  26. /opt/observium/html/weathermap# ./map-poller.php
    PHP Fatal error: require_once(): Failed opening required '/includes/db.inc.php' (include_path='.:/usr/share/php') in /opt/observium/includes/definitions.inc.php

    ReplyDelete
  27. can you help with this issue please ?

    ReplyDelete
  28. Did someone know how to put the Maximum Bandwidth legend on the map?

    ReplyDelete
  29. I have the weathermap installed and see it listed under the dropdown menu but when i create a new map with the editor and save it to maps/network.html there is nothing in the maps directory or nothing to view under weathermaps. If i manually create a .html file in the maps directory i see it listed when i select weather maps menu. Any ideas?

    ReplyDelete
  30. Hi!
    Late in the Game, but i wonder if you got some tip why nothing responds (error 500) when klicking the link object (the one that let you choose interface data-pck thingy) I got the Observium in the default setup but maybe i need to change a path somewhere or a userright on some folder!

    ReplyDelete
    Replies
    1. Hi, its because php weathermap does not support PHP7 so if you run that you need to edit a file. There is a diff found here: http://pastebin.com/tT0KzMdt on what you need to edit. However its reversed so you need to add everything that begins with -.
      Basically you need to replace all mysql_ functions with mysqli_

      Delete
  31. Dude, this is great which you have developed. But i am not able to find the repository in github...could you please help me here.

    ReplyDelete
    Replies
    1. This worked for me, GIT repository changed since document was posted:

      git clone https://github.com/tobzsc/weathermap-for-observium.git weathermap

      Delete
  32. I could see the weathermaps and weather editor on the page, after I created the test.conf, it doesn't create the output files even I tried output file name "test.jpg" and output HTML filename "maps/test.html" with www-data write permission on "maps" folder. Any ideas?

    ReplyDelete
  33. hi, i installed everything correctly (i think), but i get an error while using map-poller.php

    PHP Fatal error: require_once(): Failed opening required '/includes/db.inc.php' (include_path='.:/usr/share/php') in /opt/observium/includes/definitions.inc.php on line 475

    is there someting i need to change?

    ReplyDelete
  34. After installing weathermap, i then tried to create a node and pick from observium. However, nothing is listed which obviously there should be something in the list but it says No results. Is it something that is missing from my config? Any help is highly appreciated.
    Thank you.

    ReplyDelete
  35. not working in turnkey linux ver 8128 the editor can be opened but weathermap bar not showing the maps and config

    ReplyDelete
  36. Since updating to r9294 my maps are no longer updating....

    ReplyDelete
  37. How to upgrade observium weathermap from 9.7 to 9.8?

    ReplyDelete
  38. However, they also understand the fact that a function can be manipulated quickly by passing references instead of values. They can further avoid adding extra overheads by passing references to the function instead of values.plakatų spausdinimas

    ReplyDelete
  39. Sports big news provide is a all type sports contents. In This portal is a sports all type content, For ex. Cricket, cwc19, UEFA, football, Copa America 2019 etc.

    Cricket
    Cricket World Cup 2019
    Live Streaming
    World Cup 2019 Final
    IPL 2020 Live Streaming
    Copa America 2019 Venues
    Tennis
    Copa America 2019
    Cricket World Cup Live
    Football

    ReplyDelete
  40. It very well may be said PHP is a fine blend of certain highlights of C and Perl in a straightforward configuration. Top Expert Cakephp Developers

    ReplyDelete
  41. By and by days PHP composing PC projects is used as a piece of various online interfaces. Starting from privately owned business destinations to gigantic legitimate web Applications, edifying talks, visiting stages, CRM game plans, online business shopping crates, bunch locales, e-business and database driven Apps can be easily made using PHP.Why use Laravel

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. Just followed the steps but when create nodes or links option pick from observium is not a clickable link. Is there any way to fix it?

    ReplyDelete
  44. Looks easier than finding a good vmware backup software .

    ReplyDelete
  45. Hello,
    It doesn't open the maps page when i click on it.. it just reload the observium page.
    Any help ?

    ReplyDelete
  46. Copyright insurance reaches out to all unique scholarly works (among them, PC programs), sensational, melodic and imaginative works, including films. Under copyright, assurance is offered uniquely to the specific articulation of a thought that was embraced and not simply the thought. itools virtual location crack

    ReplyDelete
  47. Is this guide still valid with Observium CE 19.8.10000 ?

    ReplyDelete
  48. Map prints I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.

    ReplyDelete
  49. Hi, When I add a new node and click on it nothing happens. I should see a list with all our devices and select the correct one. Any idea please

    ReplyDelete
  50. Wow . It is a very helpful and informative article. Thank you so much . Do You know about the Turkey transit visa ? A Turkey Transit Visa is a permit to travel through Turkey to reach another country .Here, All the important information available about Turkey transit visa . And within 5 minutes I had cleared all doubts related to the Turkey visa. Thankyou Team Turkish for the visa.

    ReplyDelete
  51. Hello friends, Many people ask, How much processing time e visa apply online? The time it takes to get a visa after a successful application depends on the country you have applied for. While in some cases, you can get a visa in as little as 30 minutes time, others may require a few days. In some countries, we also offer a fast-track visa option in case you need one urgently. You can read more info about visas via our Visacent website onlin

    ReplyDelete
  52. It was a pleasure reading your article. I hope you will write more articles like this in the future. An electronic visa Turkey is an easy process. It's saved your time and money as well.

    ReplyDelete
  53. That doesn’t mean that JackpotCity Ontario is a flawed platform, however the system is absolutely automated, and errors can still happen, not simply right here but wherever on the web. The on line casino is licensed by in Malta by the Malta Gaming Authority and has the authority to accept accept|to simply accept} gamers from all around the} world. 온라인카지노 Jackpot City Casino has been around for over 20 years now, so its management definitely knows of} means to|tips on how to} run an online on line casino and to do it well sufficient to outlive for many years. And as you degree up, you'll acquire extra entry to beneficial loyalty rewards, like every day specials, exclusive entry to new video games, invitations to in-person VIP events, and extra.

    ReplyDelete
  54. Good morning everyone, Embrace the Enchantment of Winter Amongst Cappadocia's Enigmatic Fairy Chimneys. Amidst the snow-kissed landscape, these unique formations create a magical setting that beckons the adventurous spirit to explore and marvel.

    ReplyDelete
  55. Hlo sir, Azerbaijan Visa for Indian Passport Holders: Navigating the process of obtaining a visa to visit Azerbaijan can be both exciting and challenging. In this guide, we'll walk you through the essential steps and requirements for Indian passport holders.

    ReplyDelete
  56. Hello! I wanted to express my gratitude for the valuable information shared on your blog. Your dedication to providing in-depth insights is truly commendable. Saudi Arabia Visa for Romania Citizens Romanian passport holders can now explore Saudi Arabia with ease. Learn about the visa requirements, application process, and essential travel tips for a seamless experience.

    ReplyDelete
  57. "Your posts are a lifesaver! Keep up the fantastic work." Sri Lankan citizens can apply for an Indian visa for purposes like tourism, business, or medical visits. India Visa for Sri Lanka Citizens. The application process can be completed online or at designated centers. Ensure all necessary documents are prepared, fees are paid, and follow the processing guidelines, which may vary. Check eligibility before applying and enjoy your visit to India!

    ReplyDelete
  58. Obtaining a Turkey visa from the Solomon Islands is a crucial step for Solomon Islander travelers seeking to explore the rich cultural heritage, stunning landscapes, and historical treasures of Turkey. This process ensures that Solomon Islands passport holders can embark on their Turkish adventures with ease. Travelers from the Solomon Islands can apply for their visas through the Turkish consulate or embassy in the region, adhering to the required documentation and procedures. Alternatively, the convenient e-Visa system offers a streamlined and user-friendly application process, simplifying travel planning to Turkey. With the appropriate visa, Solomon Islander adventurers can immerse themselves in the enchanting experiences that Turkey has to offer, creating lasting memories.

    ReplyDelete
  59. This comment has been removed by the author.

    ReplyDelete
  60. Hi there! Great post, very informative. I enjoyed reading it and learned something new. Thanks!Azerbaijan warmly welcomes Pakistani travelers. Explore the application process and requirements for an Azerbaijan visa for Pakistani citizens, ensuring a smooth journey to this stunning Eurasian destination.

    ReplyDelete
  61. Hello everyone, "Do I need a visa for India?" is a common query for travelers eager to explore this diverse nation. Understanding India's visa requirements is essential to ensure a smooth and enjoyable journey.

    ReplyDelete