pblasquez / weathermapper

Automatically generate weathermaps from a LibreNMS installation
GNU General Public License v3.0
53 stars 17 forks source link

Undefined index: radius #10

Closed krakazyabra closed 4 years ago

krakazyabra commented 5 years ago

hi! i installed the plugin, using your instruction, created the group.
trying to add new map, setting Weathermap Name Group2, map design radial, Device Selection Method Group, group ID - 2, layer 10
then i'm running php weathermapper.php and getting such errors:

Generating weathermap configuration to /opt/librenms/html/plugins/Weathermap/configs/Group2.conf
PHP Notice:  Undefined index: radius in /opt/weathermapper/includes/weathermapper.inc.php on line 227
PHP Notice:  Undefined index: radius in /opt/weathermapper/includes/weathermapper.inc.php on line 227
PHP Notice:  Undefined index: radius in /opt/weathermapper/includes/weathermapper.inc.php on line 183
PHP Notice:  Undefined index: radius in /opt/weathermapper/includes/weathermapper.inc.php on line 205
No links found for myuniquelabel, please ensure LibreNMS auto-discovery is enabled and working.
Generating weathermap configuration to /opt/librenms/html/plugins/Weathermap/configs/home-network-example.conf

What am I doing wrong?

pblasquez commented 5 years ago

Hi,

Apologies for the delay, are you still experiencing this?

krakazyabra commented 5 years ago

Hi, Yes, the problem is still exists.

pblasquez commented 5 years ago

If you choose 'top' or 'left' as your layout, what happens?

pblasquez commented 5 years ago

Also, do you use the plugin or cli? If cli, can you confirm that this line exists and is not commented out (it's ok if you changed the default value of 300 to some other integer):

// RADIAL OPTIONS
$weathermapper[$label]['grid_opts']['radius'] = 300; // pixels between radial sets
4uba commented 5 years ago

Hi, I have experienced this issue... I'm using LibreNMS plugin, but still on 0.97. So after creation of radial map, plugin generate wrong code:

<?php
$label = "05-FRONT";
$weathermapper[$label] = [];
$weathermapper[$label]['title'] = "Network Map (".$label.")";
$weathermapper[$label]['grid_opts'] = [];
$weathermapper[$label]['search_opts'] = [];
$weathermapper[$label]['search_opts']['types'] = [];
$weathermapper[$label]['grid_opts']['layout'] = 'radial';
$weathermapper[$label]['grid_opts']['colsize'] = 200;
$weathermapper[$label]['grid_opts']['colmargin'] = 100;
$weathermapper[$label]['grid_opts']['rowsize'] = 100;
$weathermapper[$label]['grid_opts']['rowmargin'] = 250;
$weathermapper[$label]['search_opts']['types'][] = 'group';
$weathermapper[$label]['search_opts']['groups'] = [];
$weathermapper[$label]['search_opts']['groups'][] = [
    'group' => '2',
    'row' => 10
];

And if I add manually

$weathermapper[$label]['grid_opts']['radius'] = 300;

it works.

pblasquez commented 4 years ago

This should be fixed by PR #17 - thank you.