Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Aug 21, 2018 6:41 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 2:52 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Howie wrote:
Hehe. External Links used to be another plugin of mine :-)

I thought I remembered that someone had a tool for flushing certain rrd files when running Boost, but I can't think what it was, or where.

I would say without writing any new code, I'd suggest you look at the database stuff from yesterday. That will (should) generate maps for you with Boost support, and you can use your external links solution to display them.


Thanks, I will look into that!

Can I ask if the current Cacti 1.x plugin generates maps? I installed and created successfully a config file but I expected it to be generated but it didn't.

I am not sure if it's the UI that doesn't work yet and I should make it manually somehow and if the plugin works with BOOST at this stage.

Sorry, lots of question, just trying to get it to work somehow to make it usable also to feed you some info along with creating maps.


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 3:10 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
Not if you didn't add the database entry, no.

With the database row added for the config file you put in the configs/ directory, the poller should generate maps in the output/ directory. Make sure output/ is owned by the cacti user (which runs your poller).

It's UI that's unfinished. The poller stuff should be working now.

I haven't actually tested with 1.x.x and Boost yet, but it *should* work. (and that part I will help with debugging - because that would be legit bugs)

You will need to let it run for a few polls before the map data looks right (just because of the way poller_ourput works)

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 3:26 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Thanks,

I just implemented what you suggested and generated a map in the output folder, just I can see 2 things that forbids me from using it:

1) (minor really) is that the name of the files is taken from the hash rather than the name in the config or in the imagefile and htmlfile fields in the weathermap_name table

2) the html file looks to be working but the image file referred is a certain :

Code:
<div class="weathermapimage" style="margin-left: auto; margin-right: auto; width: 800px;" ><img id="wmapimage" src="weathermap-cacti10-plugin.php?action=viewimage&id=c062a15641bfa990d124&time=1525119963" width="800" height="600" border="0" usemap="#weathermap_c062a15641bfa990d124_imap" /></div>


And I see no reference for this anywhere, I think it should be the local png file instead.

Anyway, I can see it generated a meaningful png (opened directly that without html) without BOOST and I am trying now with BOOST enabled.

Will let you know...meanwhile you know that somehow these 2 minor bugs (are they?) could be fixed (no rush, you know, just to start using and testing it)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 3:32 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
Yes - the whole point is to stop people guessing the filenames for other customers.

Actually, in 1.x, it should make a copy with the filenames you specify in the config file. I'll check that.

For #2, yes, I didn't think about that. You would need to make a copy of that html file and edit it. The HTML only changes when the map layout changes, and you only really need to care if you are using infourl or overlibgraph.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 3:41 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Thanks for #1

For #2:
I am not sure about how it will work, I don't dare to be in your thoughts as you know where this is going and sure thing I will follow, simply it was so sweet that local png reference :)
Anyway I think I can live with editing the html when it comes and adding the ref of the image, considering as you said that the html changes meaningfully only when the map layout changes, the rest is only the png.

About debugging:

I activated BOOST, waited some polling cycles, got 0 on each link on the png, then I thought I needed to add SET rrd_use_poller_output 1 and I did.

Result is that weathermap pluging crashed and cacti disabled it, this is the output I got from CACTI LOGs

Quote:
2018/04/30 20:33:03 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap'
2018/04/30 20:33:03 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler)(/lib/functions.php: 4628 cacti_debug_backtrace)
#4 /var/www/html in file: /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Plugins/Datasources/RRDTool.php on line: 149
#3 /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Core/MapDataItem.php(232): Weathermap\Core\MapDataItem->collectDataFromTargets(Array)
#2 /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Core/MapDataItem.php(264): Weathermap\Core\Target->readData(Object(Weathermap\Core\Map), Object(Weathermap\Core\MapLink))
#1 /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Core/Target.php(125): Weathermap\Plugins\Datasources\RRDTool->readData('/var/www/html/c...', Object(Weathermap\Core\Map), Object(Weathermap\Core\MapLink))
#0 /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Plugins/Datasources/RRDTool.php(473): Weathermap\Plugins\Datasources\RRDTool->readFromPollerOutput('/var/www/html/c...', 'AVERAGE', 'now-800', 'now', Array, Object(Weathermap\Core\Map), Object(Weathermap\Core\MapLink))
Stack trace:
2018/04/30 20:33:03 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Call to undefined function Weathermap\Plugins\Datasources\updateCactiData() in /var/www/html/cacti/plugins/weathermap/lib/Weathermap/Plugins/Datasources/RRDTool.php:149
2018/04/30 20:33:03 - WEATHERMAP Map: /var/www/html/cacti/plugins/weathermap/configs/cacti1.conf -> /var/www/html/cacti/plugins/weathermap/output/c062a15641bfa990d124.html & /var/www/html/cacti/plugins/weathermap/output/c062a15641bfa990d124.png


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 3:55 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
OK. Next time I am in front of it, I'll take a look at that one.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Apr 30, 2018 4:55 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Thanks for that,

I just made some tests with the following setup (within brackets what is the aim)

  • Installed WM 0.98 from 2016 (This is to generate and modify base html file from the editor, WM 1.0 dev editor mixes up links)
  • Modified WM 0.98 cacti_base to integrate with CACTI
  • installed Plugin WM 1.0 dev in CACTI 1.x ( This will be used to generate .png with BOOST active when fixed, works already without BOOST)
  • copied 0.98 .conf file into configs folder of WM 1.0 dev CACTI plugin
  • Added entry into table weathermap_maps as you suggested, configfile is the mentioned .conf
  • added cron job to move the generated WM 1.0 dev from CACTI plugin output folder to the destination folder for publishing

will wait for the BOOST fix, that will make it usable to me WM, thanks for your time and for your tips.

Please, if you do start a crowfunding to sustain your expenses for WM, let me know.


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Tue May 01, 2018 3:19 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
jhonnyx wrote:
Thanks for that,

I just made some tests with the following setup (within brackets what is the aim)

  • Installed WM 0.98 from 2016 (This is to generate and modify base html file from the editor, WM 1.0 dev editor mixes up links)


Can you explain this a bit more? Mixes up links?

Quote:
[list[
[*] Modified WM 0.98 cacti_base to integrate with CACTI
[*] installed Plugin WM 1.0 dev in CACTI 1.x ( This will be used to generate .png with BOOST active when fixed, works already without BOOST)
[*] copied 0.98 .conf file into configs folder of WM 1.0 dev CACTI plugin
[*] Added entry into table weathermap_maps as you suggested, configfile is the mentioned .conf
[*] added cron job to move the generated WM 1.0 dev from CACTI plugin output folder to the destination folder for publishing [/list]

will wait for the BOOST fix, that will make it usable to me WM, thanks for your time and for your tips.


Most recent github push should work better for poller_output. Firstly it doesn't have the crash you mentioned. I also found another one (if it's enabled and you use the CLI version, it cleanly ignores you now), and also another unrelated rendering bug.

Also, I checked into the extra output files thing:

If you specify HTMLOUTPUTFILE, IMAGEOUTPUTFILE and IMAGEURI, then after the poller has created the usual files, it will copy to those files too, and use the IMAGEURI in the <img> tag for the second copy. The paths must be writable by the poller. If you don't specify a full path, it will try to write to the plugins/weathermap directory. This is in at least 1.x github and 0.98a (so probably also 0.98 - I didn't check).

That should save you some HTML file editing, and the cron job.

Quote:
Please, if you do start a crowfunding to sustain your expenses for WM, let me know.


Well, there are some options here if you really want to: https://network-weathermap.com/support/

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Tue May 01, 2018 5:25 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Quote:
Installed WM 0.98 from 2016 (This is to generate and modify base html file from the editor, WM 1.0 dev editor mixes up links)


On this probably I am wrong, but instead of the editor, seems that is the map generator that has some imperfections:

  • I can confirm that an additional html and png files are generated in the WM directory with the weathermap_maps filenames chosen, along with the /output/ hash file name html and png files
  • the html file generated in in the WM directory have a wrong reference for the background image and the mouseover picture is not working
  • consider I use the same file created from 0.98 WM and generating a map from 1.00 dev I see the following (below)

This is from the html file generated in the WM directory and with the chosen filename: it has no filename
<img id="wmapimage" src="" width="800" height="600" border="0" usemap="#weathermap_c062a15641bfa990d124_imap" />

This is from the html file in the output directory, it has an img reference to the base cacti url but must be something you didn't implement yet:
<img id="wmapimage" src="weathermap-cacti10-plugin.php?action=viewimage&id=c062a15641bfa990d124&time=1525212243" width="800" height="600" border="0" usemap="#weathermap_c062a15641bfa990d124_imap" />


Quote:

Also, I checked into the extra output files thing:

If you specify HTMLOUTPUTFILE, IMAGEOUTPUTFILE and IMAGEURI, then after the poller has created the usual files, it will copy to those files too, and use the IMAGEURI in the <img> tag for the second copy. The paths must be writable by the poller. If you don't specify a full path, it will try to write to the plugins/weathermap directory. This is in at least 1.x github and 0.98a (so probably also 0.98 - I didn't check).

That should save you some HTML file editing, and the cron job.


HTMLOUTPUTFILE and IMAGEOUTPUTFILE are defined in my test map, not IMAGEURI...I am unsure how this one works considering the earlier entry of this post (img src="") would IMAGEURI help in that case? I read the manual entry for this and I have some doubts how to use it, I am deeply sorry to ask maybe for an example?


Quote:
Most recent github push should work better for poller_output. Firstly it doesn't have the crash you mentioned. I also found another one (if it's enabled and you use the CLI version, it cleanly ignores you now), and also another unrelated rendering bug.


Good news ! I can confirm it works.

This means that I can plan to move some map generation in production, and eventually give you in time some more info in case something pops up.
(keeping my fingers crossed, but I honestly believe that the way you proceed with your project is to have a careful approach, so I am not expecting any disaster).

Quote:
Well, there are some options here if you really want to: https://network-weathermap.com/support/


done


PS : I forgot to ask if there is any way that the page refresh setting can be modified in the editor and if there is a chance to customize the style and page of the generated map...suggest by editing the html file manually?

PS2: The logging settings of WM in Cacti 1.x could be set to show the STATS and not the WARNING ? currently looks to be ALL or nothing if I set the Quiet Logging to Quiet

Thanks again


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Wed May 02, 2018 4:18 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
It's bad enough trying to get people to look at the logs as it is. I'm not adding a setting to turn off all warnings :-)

For IMAGEURI - this is what will end up in the <img src> tag so if you are putting both the html and image files in the same directory, just put the image filename.

The file in the output directory is designed to be included in part of the cacti UI - that's why it has that image URL.

Refresh time - the file produced from the 'copy' process isn't actually a complete HTML file - no HEAD or BODY tags - so no refresh at all. What you can do is make a PHP file that adds any branding you want, and whatever refresh you want though.

Code:
<html>
    ...etc...
<body>
<?php include("weathermap.html") ?>

</body
</html>


That is not a great assumption for github. There is often half-complete code - I push at the end of the day, just to have an off-site backup.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Wed May 02, 2018 4:18 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
jhonnyx wrote:
done




Thanks! :-)

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Wed May 02, 2018 2:48 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5249
Location: United Kingdom
It's been a while since I looked at the logs - now I see what you mean about WARNING :D

Those memory checks will not be warnings in the release version - that's just extra debug information during development.

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Wed May 02, 2018 5:00 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Ok, I will live with that for now :)


Top
 Profile  
 
 Post subject: Re: Cacti 1.1.36 and Wheatermap dev (no plugin install)
PostPosted: Mon Aug 06, 2018 5:18 pm 
Offline
Cacti User

Joined: Sun Feb 26, 2017 10:33 am
Posts: 70
Hi again,

I hope everything is OK with you, I read that you had plans to find some time this month to make WM working in CACTI 1.x.

Do you think that's going to be for real ? or any other time this year?

Just asking because I would like to integrate your maps in a project where I have CACTI 1.x before I hand it over


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group