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

Undefined variable when removing spikes in some cases #2875

Closed
yingbaiibm opened this issue Aug 5, 2019 · 2 comments
Closed

Undefined variable when removing spikes in some cases #2875

yingbaiibm opened this issue Aug 5, 2019 · 2 comments
Labels
bug Undesired behaviour resolved A fixed issue spikekill Issue related to removing spikes from graphs
Milestone

Comments

@yingbaiibm
Copy link

  1. Choose a graph, and do kill spike, error exist

2019/08/05 13:40:11 - CMDPHP PHP ERROR NOTICE Backtrace: (/spikekill.php[91]:spikekill->remove_spikes(), /lib/spikekill.php[630]:CactiErrorHandler())

2019/08/05 13:40:11 - ERROR PHP NOTICE: Undefined variable: new_output in file: /var/www/html/cacti_ml/lib/spikekill.php on line: 630

Screen Shot 2019-08-05 at 1 42 47 PM

@netniV
Copy link
Member

netniV commented Aug 6, 2019

Having a brief look at the code, it would seem that you've managed to get to a point where there's been a kill of a spike but yet not output was generated which seems wrong.

A quick fix would be to put and if(!empty($new_output)) { just before the writing out of the xml file but that may be just masking an issue. I'd need to thoroughly review that functions code before making a judgement on that later this week.

@cigamit cigamit changed the title Undefined variable: new_output in file: /var/www/html/cacti_ml/lib/spikekill.php on line: 630 Undefined variable when removing spikes in some cases Aug 11, 2019
cigamit added a commit that referenced this issue Aug 11, 2019
Undefined variable when removing spikes in some cases
@cigamit cigamit added bug Undesired behaviour resolved A fixed issue labels Aug 11, 2019
@cigamit cigamit added this to the v1.2.6 milestone Aug 11, 2019
@cigamit
Copy link
Member

cigamit commented Aug 11, 2019

Okay, this one was pretty strait forward in the end. Thanks for reporting. Just some poor logic.

@cigamit cigamit closed this as completed Aug 11, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
@TheWitness TheWitness added the spikekill Issue related to removing spikes from graphs label Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue spikekill Issue related to removing spikes from graphs
Projects
None yet
Development

No branches or pull requests

4 participants