Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 404 forks source link

Time presets #3797

Closed ISekan closed 4 years ago

ISekan commented 4 years ago

Cacti 1.2.8 Centos7 PHP 7.3.22 MariaDB 10.2.33

Time presets doesn't work for (last 2 hour, last hour, last half hour), 4 hour and more works fine

image

TheWitness commented 4 years ago

Anything in the log?

ISekan commented 4 years ago

nothing

TheWitness commented 4 years ago

So, bring up the browsers debug window, and goto the network tab, then, change the timespan selector and graph the 'graph_json.php' request variables and pass them along. I would like to see what was passed to 'graph_view.php' too. Screen shot's will help, I would like to see what was passed to the backend.

ISekan commented 4 years ago

image image

TheWitness commented 4 years ago

You need to goto the "headers" and then post the values for the Request Variables.

budiroots commented 4 years ago

Same problem here...

Untitled

ISekan commented 4 years ago

image image

toobadsosad commented 4 years ago

same here cannot use preset lower than LAST DAY... weirdly this also happen to my other cacti installation suddenly 0.8.8b, 0.8.8h, 1.1.16, and 1.2.6...

is there any external resource that may impact this?? as it affecting 4 seperate cacti installation altogether...

ISekan commented 4 years ago

Guys, I solved the problem to install new cacti & spine 1.2.14

toobadsosad commented 4 years ago

Hmm.. quick fix for older cacti at lease working in my 1.2.6.. (but i do not know what this "dirty fix" will create regression bug) will still looking forward for official suggestion.

in graph_image.php and graph_json.php change the 1600000000 to 2600000000


/* override: graph start time (unix time) */
if (!isempty_request_var('graph_start') && get_request_var('graph_start') < 2600000000) {
        $graph_data_array['graph_start'] = get_request_var('graph_start');
}

/* override: graph end time (unix time) */
if (!isempty_request_var('graph_end') && get_request_var('graph_end') < 2600000000) {
        $graph_data_array['graph_end'] = get_request_var('graph_end');
}
toobadsosad commented 4 years ago

Hmm.. quick fix for older cacti at lease working in my 1.2.6.. (but i do not know what this "dirty fix" will create regression bug) will still looking forward for official suggestion.

in graph_image.php and graph_json.php change the 1600000000 to 2600000000


/* override: graph start time (unix time) */
if (!isempty_request_var('graph_start') && get_request_var('graph_start') < 2600000000) {
        $graph_data_array['graph_start'] = get_request_var('graph_start');
}

/* override: graph end time (unix time) */
if (!isempty_request_var('graph_end') && get_request_var('graph_end') < 2600000000) {
        $graph_data_array['graph_end'] = get_request_var('graph_end');
}

in latest cacti version, those 1600000000 value already replaced with FILTER_VALIDATE_MAX_DATE_AS_INT

hero1c commented 4 years ago

@toobadsosad fix worked for me. I don't know why but it did. I backed up the old json file in case things got messy.

Awaiting official fix.

toobadsosad commented 4 years ago

@toobadsosad fix worked for me. I don't know why but it did. I backed up the old json file in case things got messy.

Awaiting officail fix.

same here.. i backed up the original file.. and wait for official.. or at least confirmation that this fix is ok

younity-ENG commented 4 years ago

@toobadsosad Thanks,

fix work for me as well!!

TheWitness commented 4 years ago

Glad you all found it. Thought we had fixed that some time ago, but I guess not.

TheWitness commented 4 years ago

Official fix is to upgrade to 1.2.10+, preferably 1.2.14.

twkfaisal commented 4 years ago

great... I've changed this value from 1600000000 to 2600000000 and it works.

Talria commented 4 years ago

Hmm. I've changed both php files from 1600000000 to 2600000000 and restarted the server, and still doesn't allow me to zoom into the graph, or see any graph in the past 4 hours. :( Anything else I can try??

image image

netniV commented 4 years ago

You will probably be better asking for assistance on the forums for outdated versions of Cacti as other community users may have a solution for you when they experienced the issue.

We no longer support 0.8.8 or below and haven't for some time.