Details

    • Team:
      Team C
    • Sprint:
      Sprint 24, Sprint 25
    • Story Points:
      3

      Description

      zabbix has a hardcoded unit blacklist where prefix multiplier (K, M, G etc) is not applied.
      currently the blacklist includes "%", "ms", "rpm" and "RPM".

      it would be useful to allow customisation of the blacklist. preferably, this would be done through the frontend. the blacklist configuration would have to be stored in the db, as it should be used both by frontend and server (for notifications)

      1. UnitEscape.patch
        2 kB
        Jonathan deBoer
      2. UnitEscape226.patch
        1 kB
        Max N

        Issue Links

          Activity

          Hide
          Oleksiy Zagorskyi added a comment - - edited

          This was many times discussed, we need dummy prefix placeholder to display value as is (without prefix itself). For example count of "something" is 19766 and it should be displayed without any prefixes.
          It is need for GUI and server notification too. Would be nice to introduce this possibility in this issue.

          Show
          Oleksiy Zagorskyi added a comment - - edited This was many times discussed, we need dummy prefix placeholder to display value as is (without prefix itself). For example count of "something" is 19766 and it should be displayed without any prefixes. It is need for GUI and server notification too. Would be nice to introduce this possibility in this issue.
          Hide
          richlv added a comment -

          "dummy unit" would be quite bad usability wise. i'd prefer a checkbox on the item level that would never apply the multiplier (i'm sure it's mentioned in some other issue somewhere )

          Show
          richlv added a comment - "dummy unit" would be quite bad usability wise. i'd prefer a checkbox on the item level that would never apply the multiplier (i'm sure it's mentioned in some other issue somewhere )
          Hide
          Steve mushero added a comment -

          Agreed we need this, and also some fixes so we don't have KKB on some units; we've adjusted hard-coding, but still messy.

          Show
          Steve mushero added a comment - Agreed we need this, and also some fixes so we don't have KKB on some units; we've adjusted hard-coding, but still messy.
          Hide
          Oleksiy Zagorskyi added a comment -

          When implementing, please check ZBX-5024

          Show
          Oleksiy Zagorskyi added a comment - When implementing, please check ZBX-5024
          Hide
          Tomas Pipo added a comment -

          I agree with richlv, the new check box in item configuration form is more suitable than special prefix in Units field.

          Show
          Tomas Pipo added a comment - I agree with richlv, the new check box in item configuration form is more suitable than special prefix in Units field.
          Hide
          Michel Meyers added a comment -

          The dummy unit is relatively easy to get going, by just making that unit list customizable and relying on the existing code. (That's what I do when I manually add 'lic', for licenses, to the func.inc.php file.)

          The check box is certainly the cleaner implementation but will require more modifications across the web interface (item form, graph generation, ...).

          Show
          Michel Meyers added a comment - The dummy unit is relatively easy to get going, by just making that unit list customizable and relying on the existing code. (That's what I do when I manually add 'lic', for licenses, to the func.inc.php file.) The check box is certainly the cleaner implementation but will require more modifications across the web interface (item form, graph generation, ...).
          Hide
          Jonathan deBoer added a comment - - edited

          I've written a patch for Zabbix 2.0.6 that does something similar. This patch allows you to prevent "unit processing" by prefixing the unit value with a "!" (So, for example, you could use "!days" for the unit, and get "1234 days", instead of "1.23 kdays") Also, you can specify the unit precision for floating point numbers: "![2]deg" would give you "123.45 deg" instead of "123 deg" or "123.450000 deg" as you would get by simply adding "deg" to the blacklist.

          Personally, I feel that having some sort of escape character is by far the easiest solution. It requires no schema changes, and the patch is really minimal.

          Show
          Jonathan deBoer added a comment - - edited I've written a patch for Zabbix 2.0.6 that does something similar. This patch allows you to prevent "unit processing" by prefixing the unit value with a "!" (So, for example, you could use "!days" for the unit, and get "1234 days", instead of "1.23 kdays") Also, you can specify the unit precision for floating point numbers: "! [2] deg" would give you "123.45 deg" instead of "123 deg" or "123.450000 deg" as you would get by simply adding "deg" to the blacklist. Personally, I feel that having some sort of escape character is by far the easiest solution. It requires no schema changes, and the patch is really minimal.
          Hide
          Jonathan deBoer added a comment -

          Patch to allow bypassing of unit processing by prefixing the unit with a "!"

          Additionally, "![num]" allows specifying floating point precision.

          Show
          Jonathan deBoer added a comment - Patch to allow bypassing of unit processing by prefixing the unit with a "!" Additionally, "! [num] " allows specifying floating point precision.
          Hide
          halt added a comment -

          Just facing the same issue with one custom userparameter, I prefer if this setup will be in the configuration of the item on the GUI, so per item, in my case I want to monitor the puppet conf version but that does not make to much sense in Gigs.
          So plus one vote from ME

          Show
          halt added a comment - Just facing the same issue with one custom userparameter, I prefer if this setup will be in the configuration of the item on the GUI, so per item, in my case I want to monitor the puppet conf version but that does not make to much sense in Gigs. So plus one vote from ME
          Hide
          Max N added a comment -

          I really like to see this in upcoming releases.
          I've modified the patch from @jdccdevel to work with zabbix 2.2.6 (there were just some variables replacd by arrays).

          UnitEscape226.patch

          Show
          Max N added a comment - I really like to see this in upcoming releases. I've modified the patch from @jdccdevel to work with zabbix 2.2.6 (there were just some variables replacd by arrays). UnitEscape226.patch
          Hide
          richlv added a comment -

          blacklist was initially implemented in ZBX-2295

          Show
          richlv added a comment - blacklist was initially implemented in ZBX-2295
          Hide
          viktorkho added a comment -

          Appropriate API method will be useful too

          Show
          viktorkho added a comment - Appropriate API method will be useful too
          Hide
          Aleksandrs Saveljevs added a comment -

          ZBXNEXT-3347 asks specifically for microseconds.

          Show
          Aleksandrs Saveljevs added a comment - ZBXNEXT-3347 asks specifically for microseconds.
          Hide
          Alexei Vladishev added a comment -

          Implemented in pre-4.0.0alpha2, revision76317.

          If unit is prefixed with character '!', then no unit prefixes (KMGT) will be applied to item values. It affects displaying of values in front-end as well as server side expansion of macros for alerting.

          A few examples:

          1024 B -> 1 KB
          1024 !B -> 1024 B
          61 s -> 1m 1s
          61 !s -> 61 s
          0 uptime -> 00:00:00
          0 !uptime -> 0 uptime
          0 ! -> 0
          0 !! -> 0 !

          Show
          Alexei Vladishev added a comment - Implemented in pre-4.0.0alpha2, revision76317. If unit is prefixed with character '!', then no unit prefixes (KMGT) will be applied to item values. It affects displaying of values in front-end as well as server side expansion of macros for alerting. A few examples: 1024 B -> 1 KB 1024 !B -> 1024 B 61 s -> 1m 1s 61 !s -> 61 s 0 uptime -> 00:00:00 0 !uptime -> 0 uptime 0 ! -> 0 0 !! -> 0 !
          Hide
          Vitaly Zhuravlev added a comment -

          It's good that its finally implemented, but so not obvious. IMHO,either a floating hint should be provided in the item configuration screen or this blacklisting moved to the separate checkbox such as 'do not apply unit prefixes'.

          Show
          Vitaly Zhuravlev added a comment - It's good that its finally implemented, but so not obvious. IMHO,either a floating hint should be provided in the item configuration screen or this blacklisting moved to the separate checkbox such as 'do not apply unit prefixes'.
          Hide
          richlv added a comment -

          awesome news, this will make many users happy - and great to see it implemented in such a flexible way.

          Vitaly, it being non-obvious does not seem to be such a big hurdle. for example, frequency units are not exposed in the ui, macros in actions, item or trigger config and so on. having a small icon next to each field that would explain all this would be great, but that's a separate thing, tracked at ZBXNEXT-130 .

          Show
          richlv added a comment - awesome news, this will make many users happy - and great to see it implemented in such a flexible way. Vitaly, it being non-obvious does not seem to be such a big hurdle. for example, frequency units are not exposed in the ui, macros in actions, item or trigger config and so on. having a small icon next to each field that would explain all this would be great, but that's a separate thing, tracked at ZBXNEXT-130 .
          Hide
          Alexei Vladishev added a comment -

          By the way, the default blacklist of units should not be used anymore (it still works, but deprecated), instead it must be replaced by !%, !ms, !rpm, etc. The standard templates should be reviewed at some point as well.

          Show
          Alexei Vladishev added a comment - By the way, the default blacklist of units should not be used anymore (it still works, but deprecated), instead it must be replaced by !%, !ms, !rpm, etc. The standard templates should be reviewed at some point as well.
          Hide
          Martins Valkovskis added a comment - - edited
          Show
          Martins Valkovskis added a comment - - edited Updated documentation: What's new Upgrade notes Item configuration Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment -

          (1) [F] No translation strings changed

          CLOSED

          Show
          Alexander Vladishev added a comment - (1) [F] No translation strings changed CLOSED
          Hide
          Nicola Mauri added a comment -

          In documentation I would replace "Unit blacklisting" with something more comprehensible in the user context, like "Automatic multiplier prefix" or "Preventing multiplier prefix".

          Show
          Nicola Mauri added a comment - In documentation I would replace "Unit blacklisting" with something more comprehensible in the user context, like "Automatic multiplier prefix" or "Preventing multiplier prefix".
          Hide
          Martins Valkovskis added a comment - - edited

          Thanks for the feedback on documentation. The title has been changed to "Preventing unit conversion flexibly".

          Alexander Vladishev Thanks! CLOSED

          Show
          Martins Valkovskis added a comment - - edited Thanks for the feedback on documentation. The title has been changed to "Preventing unit conversion flexibly". Alexander Vladishev Thanks! CLOSED
          Hide
          richlv added a comment -

          a new issue to track the default template changes might be useful

          Show
          richlv added a comment - a new issue to track the default template changes might be useful

            People

            • Assignee:
              Martins Valkovskis
              Reporter:
              richlv
            • Votes:
              34 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile