Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Deprecated-warning IcingaDbGrapher.php #42

Open
1 task done
tectumopticum opened this issue Jan 8, 2025 · 3 comments
Open
1 task done

[Bug]: Deprecated-warning IcingaDbGrapher.php #42

tectumopticum opened this issue Jan 8, 2025 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tectumopticum
Copy link

Please try to fill out as much of the information below as you can. Thank you!

  • Yes, I've searched similar issues on GitHub and didn't find any.

Which version contains the bug?

3.0.0

Describe the bug

If a panel doesn't contain data, a "deprecated"-warning is shown:

Deprecated
: substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated in
/usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
on line
381

How to recreate the bug?

In icingaweb2 choose a service where no data is delivered, e.g. a IfW-check like "Invoke-IcingaCheckUsedPartitionSpace" for a partition the monitoring-user doesn't have access.
A resulting URL could be
https://:3000/d/lwrZmQF4k/disk?var-hostname=&var-service=disk%20D%3A%2F&var-command=Invoke-IcingaCheckUsedPartitionSpace&from=now-6h&to=now&orgId=1&viewPanel=1,0

@tectumopticum tectumopticum added the bug Something isn't working label Jan 8, 2025
@RincewindsHat
Copy link
Member

Just had a short look at the code at this point and it looks like there is a check missing whether there are actually any perfdata available [0].
This could probably be introduced earlier, since we can exit early if there is no data at all.

[0]

intval(substr_count($object->state->performance_data, '=') / $this->numberMetrics);

@martialblog
Copy link
Member

Hi, yes probably due to the value being null. I'll provide a fix

@martialblog
Copy link
Member

@tectumopticum This should fix the issue #44 - can you confirm that?

@martialblog martialblog self-assigned this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants