Validation error in graph management

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
sonic7
Posts: 17
Joined: Thu Jun 11, 2015 5:49 am

Validation error in graph management

Post by sonic7 »

In graph management, when I select a graph & choose action "Place on a Tree" or "Create Aggregate graph" I received Validation error.
I tried to find solution on internet but can't fix it. May be there is some issue in my graphs.php file.
Can I replace graphs.php file or any other solution ?
gspoosi
Posts: 3
Joined: Wed Feb 24, 2016 4:20 pm

Re: Validation error in graph management

Post by gspoosi »

I did fix this with a small hack a long time ago. It's ugly but worked for me...

modify html_validate.php and change the fuction slightly:

function input_validate_input_number($value) {
$regex = "/tr_\d+/";
if ((!is_numeric($value) xor ($value=="plugin_autom8_device") xor ($value=="plugin_aggregate") xor preg_match($regex, $value)) && ($value != "")) {
echo "<h2>input_validate_input_number</h2>";
echo "Value: $value";
die_html_input_error();
}
}

Hope this helped you.
Greets
sonic7
Posts: 17
Joined: Thu Jun 11, 2015 5:49 am

Re: Validation error in graph management

Post by sonic7 »

gspoosi wrote:I did fix this with a small hack a long time ago. It's ugly but worked for me...

modify html_validate.php and change the fuction slightly:

function input_validate_input_number($value) {
$regex = "/tr_\d+/";
if ((!is_numeric($value) xor ($value=="plugin_autom8_device") xor ($value=="plugin_aggregate") xor preg_match($regex, $value)) && ($value != "")) {
echo "<h2>input_validate_input_number</h2>";
echo "Value: $value";
die_html_input_error();
}
}

Hope this helped you.
Greets
There is no file of html_validate.php in both /etc/cacti & /usr/share/cacti.
Do i need to create that file & modify it ?
gspoosi
Posts: 3
Joined: Wed Feb 24, 2016 4:20 pm

Re: Validation error in graph management

Post by gspoosi »

I have it under:
/usr/share/cacti/lib/html_validate.php


This is the reason nobody wants to help anymore...
ffs just grep for it..
grep -rnw */*.php -e "function input_validate_input_number"
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests