[ZBXNEXT-1133] Improve flexibility for action conditions Created: 2012 Feb 27  Updated: 2015 Oct 30  Resolved: 2014 Sep 18

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Server (S)
Affects Version/s: 1.8.10, 1.9.9 (beta)
Fix Version/s: 2.3.4

Type: Change Request Priority: Major
Reporter: Volker Fröhlich Assignee: Pavels Jelisejevs (Inactive)
Resolution: Fixed Votes: 13
Labels: actions, and/or, conditions
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-5721 Wrong action condition calculation Closed
is duplicated by ZBX-5628 in config -> action -> condition, usi... Closed
is duplicated by ZBX-8576 Creating action based on trigger rend... Closed

 Description   

"Type of Calculation" AND, AND/OR and OR are great for many cases but make things complicated for others.

For instance, I'd like to set up an action and exclude two host groups. Type of calculation is set to AND.

(A) and (B) and (C and D).

A – Trigger value = "PROBLEM"
B – Maintenance status not in "maintenance"
C – Host group <> "I_do_not_want_you"
D – Host group <> "You_neither"

Fine so far!

Let's extend this example:

E – Trigger description like "Please help"
F – Trigger description like "Very urgent"

I'd like to see something like (A) and (B) and (C and D) and (E or F).

But that's not possible, given the constraint of either AND, AND/OR or OR. I know I could create some auxiliary host groups, but I think that's not the way to solve this in the long term.

Could this be improved to be more flexible?



 Comments   
Comment by richlv [ 2012 Apr 10 ]

probably something like writing the formula, using letter/character placeholders, or maybe even visual editor like in oo.org table of contents properties

Comment by Andris Zeila [ 2014 Mar 26 ]

(1) [S] Database upgrade patch is done in in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1133

asaveljevs Specification says that the new "formula" field should have ZBX_SYNC flag, whereas schema.tmpl does not have it.

asaveljevs In dbupgrade_2030.c there is an additional empty line after the patch, but that can be fixed when resolving patch conflicts later. REOPENED.

wiper we are removing DM for 2.4. Do we need ZBX_SYNC flag?

asaveljevs No, we do not.

wiper The extra empty line removed in r45842, RESOLVED

sasha CLOSED

Comment by Aleksandrs Saveljevs [ 2014 Apr 02 ]

Specification is available at https://www.zabbix.org/wiki/Docs/specs/ZBXNEXT-1133 .

Comment by Andris Zeila [ 2014 May 26 ]

Server side ready for testing in development branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1133

Comment by Alexander Vladishev [ 2014 May 26 ]

Server side was successfully tested.

(2) [S] Please review my changes in r45875.

wiper Thanks, CLOSED.

Comment by Krists Krigers (Inactive) [ 2014 Jun 11 ]

(3) [F] Changed/added localization strings:
Removed:

  • 'Incorrect action conditionid.'
  • 'Incorrect action condition operator.'
  • 'Incorrect action conditionid.'
  • 'Incorrect action conditions for action \"%1$s\".'

New:

  • 'Incorrect type of calculation for action "%1$s".'
  • 'Incorrect conditions for action "%1$s".'
  • 'Incorrect custom expression "%2$s" for action "%1$s": %3$s.'
  • 'Condition "%2$s" used in formula "%3$s" for action "%1$s" is not defined.'
  • 'Condition "%2$s" is not used in formula "%3$s" for action "%1$s".'
  • 'No "%2$s" given for the filter of action "%1$s".'
  • 'Unsupported parameter "%2$s" for the filter of action "%1$s".'
  • 'Incorrect filter condition type for action "%1$s".'
  • 'Empty filter condition formula ID for action "%1$s".'
  • 'Incorrect filter condition formula ID for action "%1$s".'
  • 'Incorrect filter condition operator for action "%1$s".'
  • 'No "%2$s" given for a filter condition of action "%1$s".'
  • 'Unsupported parameter "%2$s" for a filter condition of action "%1$s".'

jelisejev Made a few corrections. CLOSED.

Comment by Krists Krigers (Inactive) [ 2014 Jun 11 ]

Implemented API and frontend changes in r46381.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 12 ]

(4) I've tried the following action.get request

{
    "output": [
        "actionid",
        "evaltype",
        "formula"
    ],
    "actionids": 3,
    "selectFilter": [
        "formula"
    ]
}
{
    "jsonrpc": "2.0",
    "result": [
        {
            "actionid": "3",
            "evaltype": "0",
            "formula": "",
            "filter": {
                "evaltype": "0",
                "formula": "",
                "conditions": {
                    "5": {
                        "conditionid": "5",
                        "actionid": "3",
                        "formulaid": "A"
                    },
                    "6": {
                        "conditionid": "6",
                        "actionid": "3",
                        "formulaid": "B"
                    }
                }
            }
        }
    ],
    "id": 4
}

1. The "evaltype" and "formula" properties must not be returned for the action object;
2. The "selectFilter" parameter must return only those properties, that are requested;
3. All of the properties must be returned for the filter condition objects;
4. Filter conditions must be returned as an array, not an object.

kristsk RESOLVED in r46724.

jelisejev On line 1761 you convert $filter['conditions'] to a hash and then on line 480 you convert it back to an array. This seems unnecessary.

kristsk RESOLVED in r46895.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 12 ]

(5) The value of "evaltype" is not returned for the following request:

{
    "output": [
        "actionid"
    ],
    "actionids": 3,
    "selectFilter": [
        "evaltype"
    ]
}

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 12 ]

(6) I'm able to change the evaltype of an action with the following update request:

{
    "actionid": 10,
    "evaltype": 3
}

The "evaltype" and "formula" fields must not be accessible via the action object. Only through the filter.

kristsk RESOLVED in r46724.

jelisejev Now I can't update "evaltype" at all.

kristsk RESOLVED in r46900.

jelisejev Now the original query works again. We must only allow to update "evaltype" through the "filter" parameter, that is:

{
"actionid": 3,
"filter": { "evaltype": 3, ... }
}

kristsk RESOLVED in r47031, r47032.

jelisejev

  1. I had an action with a custom expression. I've executed the following query:
    {
        "actionid": 3,
        "evaltype": 1
    }
    

    "Evaltype" remained but the formula was deleted.

  2. Line 659
    $action['evaltype'] = $action['filter']['evaltype'];
    

    seems to duplicate 694

    if ($evalType) {
         $action['evaltype'] = $evalType;
    }
    
  3. In "if ($evalType)" $evalType must be strictly compared to NULL otherwise CONDITION_EVAL_TYPE_AND_OR will now work.
  4. The ternary operator at 688 must be written in a single line.

Please see how it's done in CDiscoveryRule. The code should be as similar as possible.

kristsk RESOLVED in r47108.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(7) In CAction::create():

foreach ($action['filter']['conditions'] as &$condition) {
	$filterConditionValidator->setObjectName($action['name']);
	$this->checkValidator($condition, $filterConditionValidator);
	$condition['actionid'] = $createdActionId;
	$conditions[] = $condition;
}
unset($condition);

There's no need to modify the $condition array by reference, if you're adding it to the $conditions array at the same time. I suggest to remove the references, since adding IDs to the input parameters seems a bit confusing to me. The same thing for operations.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(8) The action condition "actionid" and "conditionid" properties must not be validated (and even supported) for action.create, only action.update.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(9) It would be good to implement a CAction::updateFormula() to keep the code more consistent with CDiscoveryRule.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(10) Instead of manually adding IDs after calling DB::insert() you can use DB::save() instead.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(11) I have an action with "evaltype" set to "And/or" and 3 conditions: 1. Trigger value = problem; 2. Trigger severity = Not classified; 3. Trigger severity = Average. When I request the eval_formula using action.get it returns "A and B and C" when it should group the 2. and 3. conditions using "or". That is, it should return "A and (B or C)".

Here's the request and response:

{
    "output": [
        "actionid"
    ],
    "actionids": 3,
    "selectFilter": "extend"
}
{
    "jsonrpc": "2.0",
    "result": [
        {
            "actionid": "3",
            "filter": {
                "evaltype": null,
                "formula": "",
                "conditions": {
                    "6": {
                        "conditionid": "6",
                        "actionid": "3",
                        "conditiontype": "5",
                        "operator": "0",
                        "value": "1",
                        "formulaid": "A"
                    },
                    "15": {
                        "conditionid": "15",
                        "actionid": "3",
                        "conditiontype": "4",
                        "operator": "0",
                        "value": "3",
                        "formulaid": "B"
                    },
                    "16": {
                        "conditionid": "16",
                        "actionid": "3",
                        "conditiontype": "4",
                        "operator": "0",
                        "value": "0",
                        "formulaid": "C"
                    }
                },
                "eval_formula": "A and B and C"
            }
        }
    ],
    "id": 3
}

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 13 ]

(12) I've made some minor corrections in r46481 and added some tests in r46486, please review.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 16 ]

(13) Let's change the "Type of calculation" dropdown so that it wouldn't refresh the page.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 16 ]

(14) New action conditions must be added to the end of the list. Otherwise, here's what happens:

  • I have a custom expression A and B and C with three conditions: trigger value = problem (A), trigger severity = average (B) and trigger severity = not classified (C).
  • I add a new "trigger value = OK" condition and it's added after "trigger value = problem" under (B)

This shifts all other conditions to different letters.

kristsk RESOLVED in r46724.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 16 ]

(15) Related to (14): action conditions need to be sorted by formula ID in the frontend. And when generating a formula in action.get, they need to be sorted by conditiontype, operator and value. See how it's done in discovery rules.

kristsk RESOLVED in r46724.

jelisejev The conditions returned by the API mustn't be sorted, the should only be sorted when generating a formula. And only when the formula is generated automatically.

kristsk RESOLVED in r46939.

jelisejev Now conditions aren't sorted at all. Please see how it's done for discovery rules. In the API the conditions must be sorted when generating the formula (CDiscoveryRule line 1442) and in the frontend they must be sorted by formula id (configuration.host.discovery.edit.php line 299).

kristsk RESOLVED in rr47061.

jelisejev Now we're back to (14).

kristsk RESOLVED in r47112, r47113, r47118.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 16 ]

(16) In actionconf.php:

  1. you shouldn't reassign filter fields to the action object. Use them from the filter as is.
  2. there are serveral places where the selectFilter parameter received unused properties.

kristsk RESOLVED in r46724.

jelisejev I din't mean you should replace form field names, I only meant to remove the code when calling view files:

foreach ($data['actions'] as &$action) {
	$filter = $action['filter'];
	unset($action['filter']);
	$action['evaltype'] = $filter['evaltype'];
	$action['formula'] = $filter['formula'];
	$action['conditions'] = $filter['conditions'];
}

And the second issue hasn't been resolved.

kristsk RESOLVED in r46938, r46943.

jelisejev There's still some code that copies the values from the filter to the action object for the $data array.

kristsk RESOLVED in r47033.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 16 ]

(17) I've made some minor changes in r46537, please review.

kristsk CLOSED.

Comment by Aleksandrs Saveljevs [ 2014 Jun 18 ]

(18) [PS] Please take a look at r46656. Variables "total" and "optional_num" are not used in SQLite3 database upgrade code.

wiper CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 26 ]

(19) Regarding CAction::validateConditionsIntegrity():
1. This code duplicates the validation in the filter schema

			// on create operator is mandatory and needs validation, but on update it must be validated only if it's set
			if (!$update || ($update && isset($condition['operator']))) {
				$operatorValidator = new CSetValidator(array(
					'values' => get_operators_by_conditiontype($condition['conditiontype'])
				));
				if (!$operatorValidator->validate($condition['operator'])) {
					self::exception(ZBX_API_ERROR_PARAMETERS, _('Incorrect action condition operator.'));
				}
			}

2. It would be great to move the validation of the action condition "value" value to a separate filter post validator (similarly to CConditionValidator), leaving only permission validation in the method. Than it can be renamed into something more meaningful, like checkPermissions().

kristsk RESVOLVED in r46932.

jelisejev Also please cover the validator with unit tests (see how it's done for other validators).

kristsk Wrote unit test for CActionConditionValueValidator. RESOLVED in r46948.

jelisejev

  1. I think we can safely skip object existence validation when adding an action condition. Then the CAction::validateConditionsIntegrity() method can be removed CAction::validateConditionsPermissions() can be a non-static method and we can use the CActionConditionValueValidator() in the frontnend.
  2. The following file paths are too long, they must be 83 symbols max:
    pavel@pavel-HP-Pro-3010-Small-Form-Factor-PC:/opt/lampp/htdocs/zabbix/ZBXNEXT-1133$ find . | grep -v ".svn" | awk 'length > 85 {print $1,length-2}'
    ./frontends/php/tests/unit/include/classes/validators/CActionConditionValueValidatorTest.php 90
    ./frontends/php/tests/unit/report/classes/validators/action/CActionConditionValueValidator.php.html 97
    
  3. The unit test must be placed in the same folder as the class it's testing.
  4. I've added another test case in r47025.

kristsk RESOLVED in r47055 and r47062.

jelisejev

  1. If you're using $conditionError like a boolean variable, it would be better to rename it to $conditionsValid or something and set to to true/false.
  2. The error() function should be called before show_error_messages().
  3. CAction::validateConditionsPermissions() shouldn't be public.
  4. The CValidator::validatePartial() method is implemented incorrectly (we've discussed it last time).

kristsk RESOLVED in r47119, r47108, r47152.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jun 27 ]

(20) Some formatting issues: parameters should be written with more compact vertical spacing. That is:

// instead of 
DB::updateByPk(
	'actions',
	$actionId,
	array('formula' => $formula)
);

DB::updateByPk('actions', $actionId, array('formula' => $formula));
// instead of 
$filterConditionValidator->setValidator(
	'actionid',
	new CIdValidator(array(
		'empty'        => true,
		'messageRegex' => _('Incorrect action ID for action "%1$s".')
	))
);

$filterConditionValidator->setValidator('actionid', new CIdValidator(array(
	'empty'        => true,
	'messageRegex' => _('Incorrect action ID for action "%1$s".')
)));
// instead of 
$actionExists = $this->get(
	array(
		'filter'        => array('name' => $actionName),
		'output'        => array('actionid'),
		'editable'      => true,
		'nopermissions' => true,
		'preservekeys'  => true
	)
);

$actionExists = $this->get(array(
	'filter'        => array('name' => $actionName),
	'output'        => array('actionid'),
	'editable'      => true,
	'nopermissions' => true,
	'preservekeys'  => true
));

Note that we also don't align array parameters.

kristsk RESOLVED in r46904.

jelisejev I've made some more corrections in r47009 and 47019.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(21) In actionconf.php:

...
else {
	$sortFields = array(
		array('field' => 'formulaid', 'order' => ZBX_SORT_UP)
	);
}
CArrayHelper::sort($data['action']['filter']['conditions'], $sortFields);

You cannot use CArrayHelper::sort() to sort by formula ID since it uses a natural sorting algorithm, which won't do for formula IDs. Use the function in configuration.host.discovery.edit.php instead. And please move it to the CConditionHelper class so that it wouldn't be duplicated and add a unit test for it.

kristsk RESOLVED in r47272, test in r47275.

jelisejev I've made some minor corrections in r47342, please review.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(22) In actionconf.php 205:

if($condition['formulaid'] > $lastFormulaId) {
	$lastFormulaId = $condition['formulaid'];
}

You cannot directly compare formulaid IDs since then we'll get 'AA' < 'Z', which is incorrect. See (21).

It would also be good to encapsulate this code so that the formula ID generation logic wouldn't be written inline in every file.

$newCondition['formulaid'] = chr(ord($lastFormulaId) + 1);

You could implement a CConditionHelper::getNextFormulaId() method which will accept an array of already used IDs and return the next. Such a method will encapsulate all of the logic nicely.

kristsk RESOLVED in r47273 and r47276, test in r47277.

jelisejev I've added a test case in r47344, please review.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(23) I've removed all conditions from the action and saved it. Then I tried to add a "Trigger name" condition with an empty value. I got two undefined indexes:

Invalid argument supplied for foreach() [ in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/actionconf.php:190]

Invalid argument supplied for foreach() [actionconf.php:483 → CView->render() → include() in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/include/views/configuration.action.edit.php:75]

kristsk RESOLVED in r47279.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(24) Similar to (23): I try to save an action with a custom expression but without any conditions. I cannot save it and I get a whole bunch of errors:

Argument 1 passed to CArrayHelper::sort() must be of the type array, null given, called in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/actionconf.php on line 453 and defined [actionconf.php:453 → CArrayHelper::sort() in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/include/classes/helpers/CArrayHelper.php:103]
uasort() expects parameter 1 to be array, null given [actionconf.php:453 → CArrayHelper::sort() → uasort() in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/include/classes/helpers/CArrayHelper.php:110]
Invalid argument supplied for foreach() [actionconf.php:483 → CView->render() → include() in /opt/lampp/htdocs/zabbix/ZBXNEXT-1133/frontends/php/include/views/configuration.action.edit.php:75]

If there's only one condition or no conditions at all, the eval type should be reset to and/or and the formula reset. See host_discovery.php:238.

kristsk RESOLVED in r47279. Have same commit as (23) because fixes overlap.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(25) Since now we treat action conditions as a part of the filter object, action.get shouldn't return the "conditionid" and "actionid" properties and action.update shouldn't accept them as parameters.

kristsk RESOLVED in r47292.

jelisejev I've simplified the sorting code a bit, please review r47352 and made some additional changes in r47353.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(26) According to the docs, the "operator" parameter for action conditions shouldn't be required:
https://www.zabbix.com/documentation/2.4/manual/api/reference/action/object

I've also made a minor error message correction in r47190, please review.

kristsk
Corrections reviewed.
RESOLVED in r47296.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 10 ]

(27) I've removed some unused code and made some coding style corrections in r47195, please review.

kristsk CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 16 ]

(28) When I create an action via the API it returns a "0" action ID.

kristsk RESOLVED in r47359.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 16 ]

(29) When I try to add multiple action conditions at once (for example, several host groups) they are added with the same formula IDs.

kristsk RESOLVED in r47360.

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 16 ]

TESTED.

Comment by Krists Krigers (Inactive) [ 2014 Jul 16 ]

Implemented and merged to 2.3.3 (trunk) in r47383.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 17 ]

(30) Updated API docs:

Action object reference - https://www.zabbix.com/documentation/2.4/manual/api/reference/action/object
Method parameters and examples:

kristsk CLOSED.

Comment by Oleg Egorov (Inactive) [ 2014 Jul 22 ]

(31) Configuration->Actions->Triggers
Create new action...

Undefined index: formulaid [actionconf.php:453 → CConditionHelper::sortConditionsByFormulaId() → uasort() → CConditionHelper::

{closure}() in C:\xampp\htdocs\trunk\frontends\php\include\classes\helpers\CConditionHelper.php:164]
Undefined index: formulaid [actionconf.php:453 → CConditionHelper::sortConditionsByFormulaId() → uasort() → CConditionHelper::{closure}

() in C:\xampp\htdocs\trunk\frontends\php\include\classes\helpers\CConditionHelper.php:164]
uasort(): Array was modified by the user comparison function [actionconf.php:453 → CConditionHelper::sortConditionsByFormulaId() → uasort() in C:\xampp\htdocs\trunk\frontends\php\include\classes\helpers\CConditionHelper.php:165]

kristsk RESOLVED in r47501, branch svn://svn.zabbix.com/branches/dev/ZBXNEXT-1133.

oleg.egorov CLOSED

Comment by Krists Krigers (Inactive) [ 2014 Jul 22 ]

Fixed and merged to 2.3.3 (trunk) in r47506.

Comment by Alexander Vladishev [ 2014 Jul 23 ]

(32) Error occurs when open default trigger and discovery actions

Fatal error: Call to protected method CConditionHelper::compareFormulaIds() from context '' in /include/classes/helpers/CConditionHelper.php on line 164

the same issue with LLD filter

kristsk RESOLVED in r47573.

oleg.egorov CLOSED

Comment by Alexander Vladishev [ 2014 Jul 23 ]

(33) SQL errors when saving existing action (ZBX-8515):

How to repeat:

  • create new action, name it
  • add one simple action condition (i.e. IP)
  • add one operation "link to template", select one template
  • save the action
  • edit the action
  • click "edit" on "operations" -> "link to templates"
  • click "update"
  • click "save"
Undefined index: actionid [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() in /home/sasha/zabbix-svn/trunk/frontends/php/api/classes/CAction.php:933]
Undefined index:  [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() in /home/sasha/zabbix-svn/trunk/frontends/php/api/classes/CAction.php:933]
Undefined index: opconditions [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() in /home/sasha/zabbix-svn/trunk/frontends/php/api/classes/CAction.php:1169]
Argument 2 passed to zbx_array_diff() must be an array, null given, called in /home/sasha/zabbix-svn/trunk/frontends/php/api/classes/CAction.php on line 1169 and defined [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() → zbx_array_diff() in /home/sasha/zabbix-svn/trunk/frontends/php/include/func.inc.php:864]
array_diff(): Argument #2 is not an array [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() → zbx_array_diff() → array_diff() in /home/sasha/zabbix-svn/trunk/frontends/php/include/func.inc.php:868]
array_diff(): Argument #1 is not an array [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() → zbx_array_diff() → array_diff() in /home/sasha/zabbix-svn/trunk/frontends/php/include/func.inc.php:871]
Invalid argument supplied for foreach() [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() → zbx_array_diff() in /home/sasha/zabbix-svn/trunk/frontends/php/include/func.inc.php:892]
pg_query(): Query failed: ERROR:  invalid input syntax for integer: ""
LINE 1: DELETE FROM opmessage WHERE operationid=''
                                                ^ [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->updateOperations() → DB::delete() → DBexecute() → pg_query() in /home/sasha/zabbix-svn/trunk/frontends/php/include/db.inc.php:520]
Error in query [DELETE FROM opmessage WHERE operationid=''] [ERROR:  invalid input syntax for integer: ""
LINE 1: DELETE FROM opmessage WHERE operationid=''
                                                ^]
SQL statement execution has failed "DELETE FROM opmessage WHERE operationid=''"

kristsk RESOLVED in r47574.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Jul 31 ]

(34) Error:

Error in query [INSERT INTO opgroup (operationid,groupid,opgroupid) VALUES ('2','2','12')] [Duplicate entry '2-2' for key 2]
SQL statement execution has failed "INSERT INTO opgroup (operationid,groupid,opgroupid) VALUES ('2','2','12')". [actionconf.php:163 → CFrontendApiWrapper->create() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->create() → CAction->addOperations() → DB::insert() → DB::exception() in include\classes\db\DB.php:441]

How to reproduce:
1. Open Action
2. Clone
3. Rename it
4. Save...

kristsk RESOLVED in r47742.

sasha REOPENED #operations[n]['operationid'] should be removed with #actionid in one place

kristsk RESOLVED in r48235, r48236.

sasha CLOSED

Comment by Andrejs Čirkovs (Inactive) [ 2014 Jul 31 ]

(35) Error:

Incorrect action condition proxy. Proxy does not exist or you have no access to it. [actionconf.php:152 → CFrontendApiWrapper->update() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → call_user_func_array() → CAction->update() → CAction->validateUpdate() → CAction->validateConditionsPermissions() → CApiService::exception() in /home/andrew/zabbix/dev/ZBX-8430/frontends/php/api/classes/CAction.php:2435]

how to repeat:

  • create discovery rule (proxy says "No proxy")
  • create discovery check
  • create action with two conditions: "discovery rule=" and "discovery check=" pointing to rules / check created above
  • save and observe the error

kristsk RESOLVED in r47743.

sasha REOPENED the fix disappeared in r48209

kristsk RESOLVED in r48237.

sasha CLOSED

Comment by Andris Zeila [ 2014 Aug 20 ]

(36) [S] Possible memory leak in check_action_conditions()

RESOLVED in r48254

sasha CLOSED

Comment by Krists Krigers (Inactive) [ 2014 Aug 20 ]

Fixed and merged to 2.3.4 (trunk) in r48268.

Comment by richlv [ 2014 Aug 22 ]

(37) documentation

martins-v Updated documentation, please review:

sasha Thanks! CLOSED

Comment by richlv [ 2014 Aug 22 ]

subissues still open : 30, 37

Comment by Ivo Kurzemnieks [ 2014 Sep 03 ]

Regression: ZBX-8707

Comment by Ivo Kurzemnieks [ 2015 Oct 30 ]

Regression: ZBX-10030

Generated at Sat Apr 20 08:54:28 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.