[ZBXNEXT-1812] Definition of string mappings to return a string that is referenced by an other string found in item value Created: 2013 Jul 07  Updated: 2017 Nov 14

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.0.6
Fix Version/s: None

Type: New Feature Request Priority: Minor
Reporter: Marc Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: macros, trigger, valuemapping
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux, CentOS-6.4, PostgreSQL 9.1.9, Apache HTTPD-2.2.15, PHP-5.3.3



 Description   

Beside value mapping used in frontend I would like to have something similar for use in simple macros within triggers.

Think about applications with a lot of error codes like Oracle error messages or messages produced by Tivoli Storage Manager.
These kind of messages can appear in many different flavors:

  • Code + Message
  • Code only
  • The previous two produced and mixed with upstream applications
  • ...

I would neither want to use triggers with common filters like .count(5m,"ORA-")#0 => A common Oracle error occured... nor to create thousands of triggers with exact filters.

I think about the possibility to import one generic mapping definition per application (Oracle, TSM,...) that might be used to map thousands of error codes to error messages.
These could then be referenced via simple macros by a new function especially for this purpose like {host:key.mapstr("String map name")}.
Another use case might be for example vfs.file.regexp[file,regexp,<encoding>, "String map name"] for passive agent checks with this item.

This way one could define very generic triggers with pretty messages even on varying error code positions in item values.



 Comments   
Comment by Marc [ 2013 Jul 07 ]

Distantly related to ZBXNEXT-1443

Comment by richlv [ 2013 Jul 08 ]

maybe you can provide an example on how a global regexp does not solve this, as it's not so easy to figure out what the need is

Comment by Marc [ 2013 Jul 09 ]

Can't imagine how to achieve this by global regular expressions.

What I think about is having the ability to put possible error code<->message mapping from here or here in some kind of bundled mappings similar to value maps:

Oracle mapping bundle:
...
ORA-01411 => "cannot store the length of column in the indicator"
ORA-01412 => "zero length not allowed for this datatype"
ORA-01413 => "illegal value in packed decimal number buffer"
....

or a Tivoli Storage Manager mapping bundle:
...
ANS0275S => "Trusted agent would block the operation"
ANS0276S => "The area for the include/exclude pattern is too small"
ANS0277S => "There is no closing bracket in the pattern"

If you take a look at the amount of possible error codes it's obviously one wants to do this only one time for general usage (and exchange by import/export in a bundle context)
This work needs only be done one time per product by one motivated guy, but can then be used by many - regardless in which context the error code may appear in a value, which may vary in a Zabbix environment.

There are several use cases that may benefit from this.
One case might be to have one trigger on an item that gets, lets say all log lines with Oracle error messages, maybe .regexp("ORA-[0-9]{5}").
The trigger expression fires on every change, something like .diff(0).
With ZBXNEXT-1812 kind of functionality one could use

{host:key.mapstr("Oracle")}

in trigger name or in notifications.

In short:
One generic mapping per product that can be used in any context by less than one trigger per possible error message.
It could be used for one trigger per error code range by regexp on item or trigger expression level, down to one item/trigger/action for thousands of possible error codes.

Generated at Thu Mar 28 18:14:50 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.