-
-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
Description
Describe the bug
Adding a new "Graph Create Criteria" to an Automation Graph Rule causes an SQL syntax error when and Operation is missing on an item.
To Reproduce
Steps to reproduce the behavior:
-
Go to
Automation
->Graph Rules
-
Add a new Rule:
- Name: something
- Data Query:
Net-SNMP - Get Monitored Partitions
- Graph Type: Disk Space
- Enable Rule: checked
-
add two new Graph Creation Criteria, without "Operation", e.g. for field "dskPath", Operator "does not containt", pattern "bla". See screenshots if needed.
-
Save
-
Open log; see SQL errors
Expected behaviour
UI should notify user that the Graph Creation Criteria are invalid
Screenshots
Note that item#6
has no Operation, which causes the SQL syntax error.
Log entires
2021/02/10 19:18:23 - CMDPHP SQL Backtrace: (/automation_graph_rules.php[79]:automation_graph_rules_edit(), /automation_graph_rules.php[650]:display_new_graphs(), /lib/api_automation.php[866]:db_fetch_assoc(), /lib/database.php[476]:db_fetch_assoc_prepared(), /lib/database.php[490]:db_execute_prepared())
2021/02/10 19:18:23 - CMDPHP ERROR: A DB Row Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a.`dskPath` NOT LIKE '%/home/welcomeab%') LIMIT 0,50' at line 1
2021/02/10 19:18:23 - CMDPHP SQL Backtrace: (/automation_graph_rules.php[79]:automation_graph_rules_edit(), /automation_graph_rules.php[650]:display_new_graphs(), /lib/api_automation.php[858]:db_fetch_assoc(), /lib/database.php[476]:db_fetch_assoc_prepared(), /lib/database.php[490]:db_execute_prepared())
2021/02/10 19:18:23 - CMDPHP ERROR: A DB Row Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a.`dskPath` NOT LIKE '%/home/welcomeab%')' at line 1
Additional context
Cacti version: 1.2.16