Cacti / plugin_weathermap

Weathermap for Cacti 1.x
MIT License
77 stars 26 forks source link

WeatherMap OverLib - cacti_graph_id [UNKNOWN] #142

Open HerrDrSt opened 3 months ago

HerrDrSt commented 3 months ago

Having problems with this Weathermap for Cacti 1.x

It's not resolving {link:this:cacti_graph_id} - instead I get [UNKNOWN] - for the graph-ids. ================================================================ Graph OverLib Mouse Hover shows: Link ------ https://IP-ADDRESS/cacti/graph.php?local_graph_id=[UNKNOWN] Images --------- https:///IP-ADDRESS/cacti/graph_image.php?local_graph_id=[UNKNOWN]&rra_id=0&graph_height=125&graph_width=400&random=35352 https://IP-ADDRESS/cacti/graph_image.php?local_graph_id=[UNKNOWN]&rra_id=0&graph_height=125&graph_width=400&random=17813 ===WeatherMap Global link configuration==================================== SET rrd_use_poller_output 1 # TEMPLATE-only LINKs: LINK DEFAULT INFOURL {map:cacti_url}/graph.php?local_graph_id={link:this:cacti_graph_id} OVERLIBGRAPH {map:cacti_url}/graph_image.php?local_graph_id={link:this:cacti_graph_id}&rra_id=0 BWLABEL bits WIDTH 4 BWFONT 3 SET cacti_use_ifspeed 1 ========================================== Using the following versions: [viewed from changelogs] Cacti - 1.2.22 cacti-spine-1.2.24 Weathermap - 1.1 ==images======================================= ![overlib-fail-new-weathermap-unknown](https://github.com/Cacti/plugin_weathermap/assets/163538161/c9486d3f-b41f-4d80-b00a-78358637299b) ![graphs-on-old-weathermap-ok](https://github.com/Cacti/plugin_weathermap/assets/163538161/91b42e3f-d320-48c5-8a8a-dade99e203f1)
TheWitness commented 3 months ago

Was this working before? I'm guessing that this was true. I have to do a code review to figure this one out. Can you Email me your map configuration? Mail to thewitness at cacti dot net.

TheWitness commented 3 months ago

@HerrDrSt, would you be up for a Zoom call to trace this? What Timezone are you in?

HerrDrSt commented 3 months ago

Hallo @TheWitness

Yes, I would be willing to do a Zoom Call, my Timezone is +3 GMT.

Mayhaps when you see this message - we can agree on the appropriate time and you can send a link.

Regarding your first question: ✓ No, it was *not working before - from setup ✓ The screenshot I have shared of the working version is our older cacti with older weathermap 0.98

✓ I will mail you the map config soonest at that address you shared

PS: I am also getting lots of those implicit conversion, float to int errors when I build the weathermap

TheWitness commented 3 months ago

Are you using the latest develop? GMT+3 is going to be hard for me tomorrow as I have some early morning meeting. Thursday morning my time EST (GMT+5) will work out. I'll look for your Email.

HerrDrSt commented 3 months ago

I am using the following versions . Are they compatible? Where can I get the latest develop? At one point, I resorted to downloading individual php pages from this fork to update the ones in my server with latest files, but the error persisted.

+5GMT is difference of only 2 hours, that is workable, share zoom link day before when you are ready.

[viewed from changelogs]

Cacti - 1.2.22 cacti-spine-1.2.24 Weathermap - 1.1

TheWitness commented 3 months ago

Sorry I tied to type -5 and somehow my fingers let me down. We are 8 hours apart. How about Saturday in my morning (EST)?

TheWitness commented 3 months ago

I have mainly usage questions so that I can verify the current logic to ensure the process is working. Make sure you are on the latest develop too.

TheWitness commented 3 months ago

So, mainly, what config name in the config file represents the SNMP index?

TheWitness commented 3 months ago

@HerrDrSt, I'm here in my office now if you read this and have a few minutes. We can get this issue resolved.

HerrDrSt commented 3 months ago

Hallo @@. @.>

Sorry, I had a rushed weekend.

When you wrote your email below - it was 20:30h here - which was 12:30pm on your side.

Maybe we need to coordinate a specific time so that I can set an alarm to come online.

BR/ HerrDrSt

On Sat, Mar 23, 2024, 20:33 TheWitness @.***> wrote:

@HerrDrSt https://github.com/HerrDrSt, I'm here in my office now if you read this and have a few minutes. We can get this issue resolved.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2016555616, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4OEMJB2YHGKVLJYEPLYZW4FHAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGU2TKNRRGY . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

Back at the office now. I know it's 8:00pm your time, but are you still around?

HerrDrSt commented 3 months ago

Yes, I'm here. Pls ping me on my WhatsApp when you need me to reply quickly - +254736427777

On Sat, Mar 30, 2024 at 7:21 PM TheWitness @.***> wrote:

Back at the office now. I know it's 8:00pm your time, but are you still around?

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2028213943, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4IBNGAWS2MHTXTHDJTY23RBNAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGIYTGOJUGM . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

How about 9:00 am EDT tomorrow? It's too late now for you.

HerrDrSt commented 3 months ago

Hallo @@. @.>

Let's meet at that time - it will be 1600h here. How do I prompt you to join the call?

BR/ HerrDrSt.

On Sat, Mar 30, 2024 at 10:37 PM TheWitness @.***> wrote:

How about 9:00 am EDT tomorrow? It's too late now for you.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2028450989, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4PIVFMJBOMSLDLDOM3Y24H6BAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGQ2TAOJYHE . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

I use Zoom if thats okay.

HerrDrSt commented 3 months ago

Zoom is okay. Please send the link for me to click and join. I think there is 2 hours left, now.

On Sun, Mar 31, 2024 at 1:35 PM TheWitness @.***> wrote:

I use Zoom if that okay.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2028632456, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4KZLPOB5IR5JRN63YLY27RGFAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGYZTENBVGY . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

Okay, two files to update. Please provide feedback. This was a shotgun approach.

HerrDrSt commented 3 months ago

Hallo @@. @.>

Once you are done with the update please inform.

Secondly - will I just need to replace the two files or will I need to reinstall the entire weathermap plugin? 🧐

BR/ HerrDrSt

On Sun, Mar 31, 2024, 16:28 TheWitness @.***> wrote:

Okay, two files to update. Please provide feedback. This was a shotgun approach.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2028737322, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4PKCM24WKRMPGMOQZDY3AFQDAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYG4ZTOMZSGI . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

If you were running the latest develop, just replace the two files. If not, just replace them all.

HerrDrSt commented 3 months ago

Hallo @@. @.>

I have just replaced the two files - and tested by rebuilding the weathermap.

Still showing "UNKNOWN - graph-id" with a broken-image.

Please find attached screenshot of the error.

BR/ HerrDrSt

On Tue, Apr 2, 2024 at 5:30 AM TheWitness @.***> wrote:

If you were running the latest develop, just replace the two files. If not, just replace them all.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2030963510, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4J3P64CY4TEFL5ZWWTY3IJ3BAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZQHE3DGNJRGA . You are receiving this because you were mentioned.Message ID: @.***>

HerrDrSt commented 3 months ago

Hallo @TheWitness

I have just replaced the two files - and tested by rebuilding the weathermap.

Still showing "UNKNOWN - graph-id" with a broken-image.

Please find attached screenshot of the error.

feedback_02042024_unknown

BR/ HerrDrSt

TheWitness commented 3 months ago

Okay. I'll setup a local map. Busy week though.

HerrDrSt commented 3 months ago

Hallo @@. @.>

This is okay. Will continue to wait.

On another note, the same happened on a previous version, and Howie gave some pointers on the post below - I dont know if it will help:

https://forums.cacti.net/viewtopic.php?t=34678

Quote: The reason that fails is that you haven't got a SET to define cacti_graph_id for the link. It's not set by the rrd datasource plugin (or any other plugin). The DSStats plugin (in 0.97) and rrdtool plugin (in poller_output mode ONLY) should both set it. If you run with DEBUG logging for one poller cycle, you should see what is being set or not (look for lines about 'add_note').

I see some of files referenced are:

lib/ds-common.php if(isset($r4['local_graph_id'])) $item->add_note("cacti_graph_id",intval($r4['local_graph_id']));

CHANGELOG.md:* FIXED - cacti_graph_id set to 0 instead of ID, by rrd/poller_output and dsstats plugins (thanks sh0x)

BR/ HerrDrSt

On Wed, Apr 3, 2024 at 9:25 AM TheWitness @.***> wrote:

Okay. I'll setup a local map. Busy week though.

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2033654992, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4LZGOGBTKQUZSWCMYDY3OOEXAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTGY2TIOJZGI . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 3 months ago

Anything in the Cacti log to speak of?

HerrDrSt commented 3 months ago

Hallo @TheWitness

These are the errors from the cacti-log,,

  1. Mostly errors from " Implicit conversion from float to int loses precision in file" - which I saw is being handled in another topic on this forum. => Was this resolved?

  2. The other has to do with poller and image color.

==================================================================================================================================== 2024-04-07 13:26:24 - CMDPHP PHP ERROR Backtrace: (/poller.php[827]:api_plugin_hook(), /lib/plugins.php[83]:api_plugin_run_plugin_hook(), /lib/plugins.php[221]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[1142]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3604]:WeatherMap->DrawLegend_Classic(), /plugins/weathermap/lib/WeatherMap.class.php[1792]:Colour->gdallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[1813]:myimagecolorallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[363]:imagecolorexact(), CactiErrorHandler())

2024-04-07 13:26:24 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 9.375 to int loses precision in file: /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.functions.php on line: 363

2024-04-07 13:26:24 - CMDPHP PHP ERROR Backtrace: (/poller.php[827]:api_plugin_hook(), /lib/plugins.php[83]:api_plugin_run_plugin_hook(), /lib/plugins.php[221]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[1142]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3604]:WeatherMap->DrawLegend_Classic(), /plugins/weathermap/lib/WeatherMap.class.php[1792]:Colour->gdallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[1813]:myimagecolorallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[363]:imagecolorexact(), CactiErrorHandler())

2024-04-07 13:26:24 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 4.6875 to int loses precision in file: /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.functions.php on line: 363

2024-04-07 13:26:24 - CMDPHP PHP ERROR Backtrace: (/poller.php[827]:api_plugin_hook(), /lib/plugins.php[83]:api_plugin_run_plugin_hook(), /lib/plugins.php[221]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[1142]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3604]:WeatherMap->DrawLegend_Classic(), /plugins/weathermap/lib/WeatherMap.class.php[1792]:Colour->gdallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[1813]:myimagecolorallocate(), /plugins/weathermap/lib/WeatherMap.functions.php[363]:imagecolorexact(), CactiErrorHandler())

2024-04-07 13:26:24 - SYSTEM STATS: WEATHERMAP Time:1.99 Maps:1 Warnings:8 Notes:None

2024-04-07 13:28:31 - AUTH LOGIN: User 'admin' Authenticated via Authentication Cookie ^C @.***:/var/www/html/cacti/log#

On Sat, Apr 6, 2024 at 2:28 PM TheWitness @.***> wrote:

Anything in the Cacti log to speak of?

— Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_weathermap/issues/142#issuecomment-2041053923, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7WJ4PF4GLDGJ6ULZFIDJTY37L5RAVCNFSM6AAAAABEYPHKBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGA2TGOJSGM . You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 2 months ago

It looks like you are not running the latest develop. A few of your files are out of date.

HerrDrSt commented 2 months ago

Hallo, You mean Cacti itself or Weathermap?

TheWitness commented 2 months ago

WeatherMap. You should not be getting those deprecation warnings any longer. I've confirmed in the code.

TheWitness commented 2 months ago

@HerrDrSt , weird that I closed this. Can you update to the latest develop and see if it's fixed. If not, can you do a Zoom on Saturday?

HerrDrSt commented 2 months ago

Hallo @thewitnessPlease confirm- which develop? For Cacti or Weathermap ?Have you uploaded the latest one for Weathermap ?On 26 Apr 2024, at 23:55, TheWitness @.***> wrote: @HerrDrSt , weird that I closed this. Can you update to the latest develop and see if it's fixed. If not, can you do a Zoom on Saturday?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

TheWitness commented 2 months ago

https://github.com/Cacti/plugin_weathermap.git