howardjones / network-weathermap

Network Weathermap draws diagrams from data
http://www.network-weathermap.com/
MIT License
425 stars 94 forks source link

Non existing SCALE will stop NWM processing any other maps #60

Closed jpobeda closed 7 years ago

jpobeda commented 7 years ago

Hi Howie,

This may be an easy one. It was easy to fix it from my side but you may want to handle the exception.

I've created a SCALE which I included in 2 nodes and then forgot to remove it from the NODES and got rid of the SCALE (manually editing the .conf file). Every nodes config was created from web editor. I'm running NWM from git prior to all these Cacti 1.0.0 commits.

Next time NWM ran, it stopped processing any other maps.

This what I've got

> PHP Fatal error:  Uncaught exception 'WeathermapInternalFail' with message 'NoSuchScale' in /usr/share/cacti/plugins/weathermap/lib/Weathermap.class.php:272
> Stack trace:
> #0 /usr/share/cacti/plugins/weathermap/lib/WeatherMapDataItem.class.php(295): WeatherMap->getScale('FAILOVER')
> #1 /usr/share/cacti/plugins/weathermap/lib/Weathermap.class.php(1614): WeatherMapDataItem->calculateScaleColours()
> #2 /usr/share/cacti/plugins/weathermap/lib/Weathermap.class.php(1785): WeatherMap->readDataFromTargets(Array)
> #3 /usr/share/cacti/plugins/weathermap/weathermap(254): WeatherMap->readData()
> #4 {main}
>   thrown in /usr/share/cacti/plugins/weathermap/lib/Weathermap.class.php on line 272

My current setup:

Cacti 0.8.8h PHP 5.4 MariaDB 5.5 Apache 2.4 OS CentOS 6

If you need any further details, please let me know.

howardjones commented 7 years ago

D'oh. Sorry. I was experimenting with using exceptions to make the automated testing easier (it didn't). I didn't realise I had left any in. I'll remove it.