-
New Feature Request
-
Resolution: Duplicate
-
Trivial
-
None
-
2.0.0
Hi,
From most backend systems you can create trigger expressions. You should only update them if there is a change, but the API call doesn't provide the full expression. I've build the following code that fixes the issue ugly, but a permanent solution would be better.
my $expression = $triggers->{$key}->
{expression};if (!defined $expression) {next;}
foreach my $function (@{$triggers->{$key}->{functions}}) {
my $itemid = $function->{itemid};
foreach my $item (@{$triggers->{$key}->{items}}) {
if($item->{itemid} eq $itemid){
foreach my $host (@{$triggers->{$key}->{hosts}}){
if($host->{hostid} eq $item->{hostid}){
my $realfunction = $host->{host}.":".$item->{key_}.".".$function->{function}."($function->{parameter})";
$expression =~ s/$function->{functionid}/$realfunction/g;
}
}
}
}
}
$triggers->{$key}->{expression}
= $expression;
- duplicates
-
ZBX-2060 api trigger.get should be able to return expanded expressions and descriptions
- Closed