Autom8 Validation error

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
usefree
Posts: 12
Joined: Mon Oct 28, 2013 4:52 am

Autom8 Validation error

Post by usefree »

Hi,
I´m testing Cacti in a clean envirement for Debian (Wheezy and Jessie) and have some troubles using Autom8.
After creating a clean VMware installation I installed Autom8 and activated it at the plugin management.
When I go to the Devices and select Apply Autom8 Rules to devices I receive following Web Error "Validation error." That´s all.
For testing I have NOT created new rules and none of the default rules are enabled.
Enabling Debugging of Autom8 even didn´t generate any output.
Cheers

General Information
Date Mon, 14 Jul 2014 09:50:34 +0200
Cacti Version 0.8.8a
Cacti OS unix
SNMP Version NET-SNMP version: 5.4.3
RRDTool Version RRDTool 1.4.x
Hosts 9
Graphs 402
Last Run Statistics Time:3.1040 Method:cmd.php Processes:1 Threads:N/A Hosts:10 HostsPerProcess:10 DataSources:789 RRDsProcessed:409
PHP Information
PHP Version 5.4.4-14+deb7u12
PHP OS Linux
PHP uname Linux xxxxxxxxxxx 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u1 x86_64
PHP SNMP Installed
max_execution_time 30
memory_limit 128M
usefree
Posts: 12
Joined: Mon Oct 28, 2013 4:52 am

Re: Autom8 Validation error

Post by usefree »

Some Update on this topic:
I tried to import various versions of the database via mysql -u root cacti < cacti.sql (0.8.7i, 0.8.8, 0.8.8a, 0.8.8b) and it did not solve the problem.
The next step was to replace cacti itself with the following commands:

wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar -xvf cacti-0.8.8a.tar.gz
cd cacti-0.8.8a
cp -R * /usr/share/cacti/site/. (this is the default location of the Debian distribution)
and after replacing Username/Passwort at /etc/cacti/debian.php Cacti was up and running again.

I then tried to apply Autom8 Rules and it worked!
For me it seems that the Debian-Distribution version must have difference and I will try to find them.

I´m wondering that Debian Jessie has the same problem.
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Autom8 Validation error

Post by paulgevers »

Unfortunately I have no idea yet about the plugins of cacti mysel yet, but yes, the Debian package is different. For one thing, the Debian package follows the FHS (File Hierarchy standard). But nevertheless, have you read the README.Plugins provided in the package. Does it help in any way?

In my signature there is a link to some differences between the Debian package and the tar provided by this web-site.

Did you look in the log files? Was there anything useful? /var/log/cacti/ cacti.log and poller-error.log.

By the way, interesting that copying the files over actually worked, I would not have expected that as we patch some of the files to use the Debian layout. So I recommend to either install the Debian way, or the cacti way, but don't mix these things. You may hit strange and unsupportable behavior.

Paul
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
usefree
Posts: 12
Joined: Mon Oct 28, 2013 4:52 am

Re: Autom8 Validation error

Post by usefree »

Hi Paul,
paulgevers wrote: By the way, interesting that copying the files over actually worked, I would not have expected that as we patch some of the files to use the Debian layout. So I recommend to either install the Debian way, or the cacti way, but don't mix these things. You may hit strange and unsupportable behavior.
Paul
yes, thats´s what I have seen afterwards. You are right I hit strange behavior.

After executing Autom8 I checked the logs cacti.log, poller-error.log, access.log and error.log again and there are no entries regarding any error

For me the problem is reproducible with the installation steps as described in install.txt on a clean based installation of Wheezy and Jessie.
After doing this Copy & Paste installation I install and enable the plugin inside Cacti, go to Devices and Apply Autom8 Rules to Localhost, the result is the attached Screenshot1.jpg.
Screenshot1.jpg
Screenshot1.jpg (14.18 KiB) Viewed 4161 times
The only enrty I find at the log files is the entry in the Apache access.log file:
0.0.0.0 - - [16/Jul/2014:06:51:30 +0200] "POST /cacti/host.php HTTP/1.1" 200 600 "http://xxx.corp.lan/cacti/host.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"

My opinion is, that something changed during the last security fix and now Autom8 is not working any more. Maybe it makes sense gandalf is taking a look on it as Author of Autom8.

What I did for the moment, after doing some search, is to use the old version 0.8.8a+dfsg-5+deb7u2, than everything works for me.

Everybody who is interested in what I did, leave a message. I going to prepare a howto and will publish that till the 4th quarter of 2014.

Cheers
Harald
Attachments
install.txt
(730 Bytes) Downloaded 204 times
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Autom8 Validation error

Post by paulgevers »

usefree wrote:What I did for the moment, after doing some search, is to use the old version 0.8.8a+dfsg-5+deb7u2, than everything works for me.
Oh, PLEASE file a bug in Debian. Other people deserve to know, and it also helps to get a possible fix later into wheezy and to fix jessie.

As Gandalf is not using Debian, I am unsure if he can help, as the security update does contain changes that didn't come from the cacti site.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
paulgevers
Cacti Pro User
Posts: 613
Joined: Tue Aug 29, 2006 4:09 pm
Location: NL

Re: Autom8 Validation error

Post by paulgevers »

Bug confirmed. And the bug is actually related to commit 7452. The id of drp_action provided by the Autom8 plugin is not a number as required by host.php since that commit (actually, also cacti proper has a non-number id for "Place on a tree").. I don't know how to fix this properly as it depends on design choices. Therefore I will create a bug in the cacti bug tracker shortly.
Maintainer of cacti in Debian (and Ubuntu).
Cacti 1.* is now officially supported on Debian Stretch via Debian backports
FAQ Ubuntu and Debian differences
Generic cacti debugging
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Autom8 Validation error

Post by cigamit »

We can change the validation to

Code: Select all

input_validate_input_regex(get_request_var_post('drp_action'), "^([a-zA-Z0-9_]+)$");
and it should work, and still alleviate the security issues.
voyager
Posts: 21
Joined: Sat Jun 14, 2014 11:01 am

Re: Autom8 Validation error

Post by voyager »

Hi,
I am facing validation error when tried to apply autom8 rules to devices under Management section.

The general information is appended:
Cacti Version 0.8.8b
Cacti OS unix
SNMP Version NET-SNMP version: 5.5
RRDtool 1.3.8
Hosts 3
Graphs 169
10/19/2014 03:45:04 PM - SYSTEM THOLD STATS: Time:0.2135 Tholds:2 TotalHosts:3 DownHosts:0 NewDownHosts:0RRDsProcessed:409
PHP Information
PHP Version PHP 5.3.3
PHP OS Linux
PHP uname Linux xxxxxx 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
PHP SNMP Installed
memory_limit 512M

Any suggestions please?
voyager
Posts: 21
Joined: Sat Jun 14, 2014 11:01 am

Re: Autom8 Validation error

Post by voyager »

Hi,
I've tried the above solution and amazingly it worked !!

The original input_validate_input_number has been commented and replaced with proposed solution.

input_validate_input_regex(get_request_var_post('drp_action'), "^([a-zA-Z0-9_]+)$");
/* input_validate_input_number(get_request_var_post('drp_action'));*/

Thank you, cigamit

^_^

Regards,
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests