Autom8 V0.33

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Locked
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please do NOT use parenthesis if there's no need to do so (example 1 + 2).
The current logic always expects sth. "meaningful" after a closing parenthesis. YOu screenshots show garbage there (example 3).
Perhaps I should change the way of handling parenthesis, who knows ...
R.
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

Ok sorry... Usually I'm just working with MPLS... and not boolean expression :cry:

Can you explain me how I can merge my expressions?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

killshoot wrote:Ok sorry... Usually I'm just working with MPLS... and not boolean expression :cry:

Can you explain me how I can merge my expressions?
For the first two, simply omit the brackets. Do a simple "a AND b" or "a OR b" type of expression.

R.
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

Thank for the answer.

For the first two - no problem (the parenthesis was just here to explain my third exemple), but for the third how I can handle that?

The two first exemple, even with dummies parenthesis, are working but the third not.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Currently, you will have to split this rule into two.
The first rule covers the first parenthesis, the second one matches the second parenthesis.
It is possible to have many rules match a single target, you know.

But thinking about your approach, I might change the options to allow a single OR/AND without selecting an operator or field ...
No promise made
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

gandalf wrote:But thinking about your approach, I might change the options to allow a single OR/AND without selecting an operator or field ...
This feature is in, now. SVN#1079
R.
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

hi,

yes my problem is that i've around 3000 devices into my cacti (all my 96000 rra on a ramdisk and I'm not using BOOST)

Unfortunately the naming concept and the IP concept of my network aren't consistant (we have merged three différent network). I need to do multiple and/or to match the correct devices for the tree.

I'll test the latest SVN tomorrow but I already thank you for this great plugin that really push Cacti before the $$$ entreprise monitoring software.

Best regards,

Vince
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

OK tested,

New option work good but I've an SQL error :

06/18/2010 08:21:16 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"SELECT host.id AS host_id, host.hostname, host.description, host.disabled, host.status, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( ( host.description LIKE '%xba%' OR host.description LIKE '%zba%' ) AND 0 ( host.description LIKE '%son%' OR host.description LIKE '%own%' OR host.description LIKE '%cln%' ))"

After manualy deleting the filed value "0" for the apporpriate ID in the "plugin_autom8_match_rule_items" SQL table everything run very good.

I think the the problem comes from this line in setup.php :

Code: Select all

 define("AUTOM8_OP_NONE", 0);
Best regards and again thank you!

Vince
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post a screenshot of the rule set.
R.
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

Here the rules. As you can see in the SQL error there is a "0" directly after the "AND"


Code: Select all

06/21/2010 11:07:43 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"SELECT host.id AS host_id, host.hostname, host.description, host.disabled, host.status, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( host.description LIKE '%bck%' AND 0 ( host.description LIKE '%pos%' OR host.description LIKE '%zen%' OR host.description LIKE '%zol%' )) ORDER BY description ASC LIMIT 0,50"
Attachments
rules_and.gif
rules_and.gif (6.36 KiB) Viewed 3427 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Thanks. I will re-check. Was quite sure to have that tested ...
But I did NOT verify
expr AND ( expr )
to be honest. But as a side effect of my last change, that might be an easy fix as well
R.

Please re-save both items that have a "0" printed. Does that change things?
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

Hi,

I've tried to resave the element with a "0" but without success. I've also tried (expr) and (expr) but I got the same error.

Comes this "0" from the structure of the table itself? I can see that the default value in table is "0".

Regards,

Vince

Code: Select all

06/22/2010 01:02:37 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"SELECT host.id AS host_id, host.hostname, host.description, host.disabled, host.status, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( ( host.description LIKE '%bck%' OR host.description LIKE '%son%' ) AND 0 ( host.description LIKE '%pos%' OR host.description LIKE '%zen%' OR host.description LIKE '%zol%' )) ORDER BY description ASC LIMIT 0,50"
Attachments
rules_and_expr.gif
rules_and_expr.gif (6.54 KiB) Viewed 3389 times
kiruah
Posts: 5
Joined: Tue May 04, 2010 8:52 am

Post by kiruah »

hello,

is there a way to automate Data Input Methods ?

Thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

DIMs are automated by default if the device matches the "matching rule". This is due to the assumption, that you will want to see all "Associated Graph Template" Graphs, else you would not have associated them :wink:
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

killshoot wrote:Here the rules. As you can see in the SQL error there is a "0" directly after the "AND"

Code: Select all

06/21/2010 11:07:43 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"SELECT host.id AS host_id, host.hostname, host.description, host.disabled, host.status, host_template.name AS host_template_name FROM host LEFT JOIN host_template ON (host.host_template_id = host_template.id) WHERE ( host.description LIKE '%bck%' AND 0 ( host.description LIKE '%pos%' OR host.description LIKE '%zen%' OR host.description LIKE '%zol%' )) ORDER BY description ASC LIMIT 0,50"
Oops, I only changed graph rules. Now the same feature is in for tree rules. SVN#1086.
You will have to re-save all bogus items. That should do.
R.
Locked

Who is online

Users browsing this forum: No registered users and 0 guests