plugin_weathermap icon indicating copy to clipboard operation
plugin_weathermap copied to clipboard

ERROR PHP WARNING

Open fredouil66 opened this issue 3 years ago • 4 comments

Hi, I can't manage to fix this error. I'm on V1.2.14 All seems to work well, just this error I cant get my head arround...

image

05/07/2021 11:05:12 - ERROR PHP WARNING in Plugin 'weathermap': A non-numeric value encountered in file: /opt/cacti/plugins/weathermap/lib/Weathermap.class.php on line: 975

05/07/2021 11:05:12 - CMDPHP PHP ERROR WARNING Backtrace: (/poller.php[823]:api_plugin_hook(), /lib/plugins.php[74]:api_plugin_run_plugin_hook(), /lib/plugins.php[177]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[787]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[195]:WeatherMap->ReadData(), /plugins/weathermap/lib/Weathermap.class.php[974]:CactiErrorHandler()) 05/07/2021 11:05:12 - ERROR PHP WARNING in Plugin 'weathermap': A non-numeric value encountered in file: /opt/cacti/plugins/weathermap/lib/Weathermap.class.php on line: 974 05/07/2021 11:05:12 - CMDPHP PHP ERROR WARNING Backtrace: (/poller.php[823]:api_plugin_hook(), /lib/plugins.php[74]:api_plugin_run_plugin_hook(), /lib/plugins.php[177]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[787]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[195]:WeatherMap->ReadData(), /plugins/weathermap/lib/Weathermap.class.php[975]:CactiErrorHandler()) 05/07/2021 11:05:12 - ERROR PHP WARNING in Plugin 'weathermap': A non-numeric value encountered in file: /opt/cacti/plugins/weathermap/lib/Weathermap.class.php on line: 975 05/07/2021 11:05:12 - CMDPHP PHP ERROR WARNING Backtrace: (/poller.php[823]:api_plugin_hook(), /lib/plugins.php[74]:api_plugin_run_plugin_hook(), /lib/plugins.php[177]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[787]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[195]:WeatherMap->ReadData(), /plugins/weathermap/lib/Weathermap.class.php[974]:CactiErrorHandler()) 05/07/2021 11:05:12 - ERROR PHP WARNING in Plugin 'weathermap': A non-numeric value encountered in file: /opt/cacti/plugins/weathermap/lib/Weathermap.class.php on line: 974

fredouil66 avatar Jul 05 '21 09:07 fredouil66

What do your TARGETs look like for this map? (Specifically any that have a multiplication in them)

howardjones avatar Jul 05 '21 10:07 howardjones

I got read of all multiplications and only put values in bits since a few months because i had problems with PHP. here is what I did: Capture weathermap-cacti-plugin weathermap-cacti-plugin1 Serveur_F.cont.txt

fredouil66 avatar Jul 05 '21 12:07 fredouil66

Capture1 Capture2

fredouil66 avatar Jul 05 '21 12:07 fredouil66

So the part that is failing is only run if it thinks multiply is necessary.

		if($multiply != 1) {  
			wm_debug("Pre-multiply: $in $out\n"); 
								
			$in = $multiply*$in;  # <-- this is line 974
			$out = $multiply*$out;
								
			wm_debug("Post-multiply: $in $out\n"); 
		}

If you run with DEBUG logging, what do the logs say before the error?

howardjones avatar Jul 07 '21 07:07 howardjones

This should be addressed. Keeping this open for the moment though.

You should re-evaluate in a non production settings once this pull request is merged: https://github.com/Cacti/plugin_weathermap/pull/39

TheWitness avatar Jan 02 '23 13:01 TheWitness

ok I'm on the 1.2.22 version of cacti is it good to be able to test the plugin? when I have tested it I will return to you with pleasure

fredouil66 avatar Jan 02 '23 14:01 fredouil66

Yea, it should work find on 1.2.22. @bmfmancini, who I have asked to coordinate a beta release and I are doing some system and unit testing on the plugin right now. It's in my personal repo for the moment. If you want to dig in, grab it. But be careful is it's production. Have a good testing location to work with it in.

TheWitness avatar Jan 02 '23 14:01 TheWitness

Going to close this one. Goto the Beta Test and use it on Cacti 1.2.23 and provide feedback. It's a pretty heavy rewrite.

TheWitness avatar Jan 19 '23 01:01 TheWitness