Skip to content

When using Realtime, if no graph contents are present an error is generated #3532

@simonpunk

Description

@simonpunk

Cacti version:
Version 1.2.12 (download from https://www.cacti.net/downloads/cacti-latest.tar.gz)

Bug:
After a fresh installation of cacti, it creates a device of my local machine automatically with some graph templates, all the graph templates can be displayed, and rrdtool debug says 'OK', but it still shows no data after half an hour, and I notice it keeps logging the same error message to cacti.log in every 11 seconds.

05/04/2020 10:11:14 - ERROR PHP NOTICE: Undefined variable: graph_contents in file: /opt/cacti/graph_realtime.php on line: 218
05/04/2020 10:11:14 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph_realtime.php[218]:CactiErrorHandler())

I took a look at the latest commit of graph_realtime.php, seems it still didn't handle the $graph_contents properly as it can be null if it doesn't match one of the if cause.
I don't know what $graph_contents should be first defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions