Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4379

Incorrect display of values in the title bar when using a macro trigger {ITEM.VALUE}

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.0
    • 1.8.8
    • Frontend (F)
    • None

      google translated :
      ---------------------------------------------------------------------

      Discovered a problem related to incorrect display of titles in a row trigger by using the macro

      {ITEM.VALUE}.

      Description of the file attachments and problems:
      1. Equip - PortStatus:
      The file shows the current status (operational and administrative) E22 port on the equipment: ifOperStatus.22 - Down (2), ifAdminStatus - Up (1)

      2. Monitoring-Triggers:
      operating window «Monitoring» -> «Triggers», which shows that in the name of the trigger port is substituted in accordance with the values ??of the macro {ITEM.VALUE}

      , for some reason appears as «Up». At the same time on the previous figure shows that the port on the equipment is in «Down». Time the trigger in 13:26:05.

      Analyze ...

      3. Latest data - PortStaus:
      window «Monitoring» -> «Latest data», port status E22 «administrative" and "operational." We see that in 13:26:05 element "operational" state of the port was set to "0", which corresponds to the actual state of the port on the equipment!

      4. Latest data - history
      History shows the values ??for the "operational" state of the port. We see that in 13:26:05 (at one time!) Element has two meanings, first "1", then "0".

      5. Item_config
      given the current configuration of the element that collects "operational" state of the port «E22».

      6. Trigger_config - ifOperStatus:
      description of the configuration of the trigger for the "operational" state of the port «E22», for which there is an incorrect indication.

      7. Trigger_config - ifAdminStatus (dep):
      description of the configuration of the trigger for "administrative" status of the port «E22», from which the dependence of the trigger for the "operational" state of the port.

      8. MySQL - ItemStatus:
      current state of the element in a MySQL database for "operational" state of the port «E22»: field «lastvalue» = 0, which corresponds to the actual value of the port on the equipment and meets the income line item values ??in the data (Figure: "4. Latest data - history» ), the latter a value of zero.

      9. MySQL - history_uint:
      history for the item collecting "operational" state of the port «E22», in which it appears that the value "1" and "0" did at one time (up to seconds!)

      After seeing the source code WEB-interface found that the values ??for display in windows «Monitoring» -> «Triggers» and «Monitoring» -> «Events» are selected from the tables of «history *». Sample data for display in a trigger by the function «item_get_history» located in the file «items.inc.php».
      By including this feature screen output variable «$ sql» I got formed SQL-query to display the value of the trigger:
      «Select value from history_uint where itemid = 34 432 and clock = 1314699965;"
      Which returns a "1"!

      Change the query to:
      «Select * from history_uint where itemid = 34 432 and clock = 1314699965;"
      and doing it manually in MySQL, the output is a table with two rows:
      "10. MySQL - select »

      Obviously, the problem is that changing the port state occurred with a difference of a second, but they remain in the table Zabbix over time to the nearest second. As a result, when selecting the values ??in Table history_uint (with a time value in the «clock») query returns only one (FIRST), a string, not the data that is entered last.

      PS: The other day I opened the TT ZBX-4374, associated with periodic improper handling of the state flip-flops. I hope this is a problem and this information will help to resolve them as quickly as possible.
      PSS: in file «triggers.inc.php» I made small changes that would patch up malfunctioning macro

      {ITEM.VALUE} for WEB interface using «Valuemapped» (see ZBX-3423).

      ---------------------------------------------------------------------
      oirginal :
      ---------------------------------------------------------------------
      ????????? ???????? ????????? ? ???????????? ??????????? ???????? ? ?????? ???????? ???????? ??? ????????????? ??????? {ITEM.VALUE}

      .

      ???????? ????????? ?????? ? ????????:
      1. Equip - PortStatus:
      ? ????? ???????? ??????? ????????? (???????????? ? ????????????????) ????? E22 ?? ????????????: ifOperStatus.22 - Down(2), ifAdminStatus - Up(1)

      2. Monitoring-Triggers:
      ??????? ???? «Monitoring» -> «Triggers», ? ??????? ?????, ??? ? ???????????? ???????? ????????? ?????, ???????? ????????????? ????????? ???????

      {ITEM.VALUE}, ?????? ?? ???????????? ??? «Up». ? ?? ?? ????? ?? ??????????? ??????? ?????, ??? ???? ?? ???????????? ????????? ? ????????? «Down». ????? ???????????? ???????? ? 13:26:05.

      ???????????...

      3. Latest data - PortStaus:
      ???? «Monitoring» -> «Latest data», ????????? ????? E22 «??????????????» ? «????????». ?????, ??? ? 13:26:05 ??????? «???????????» ????????? ????? ??????? ???????? «0», ??? ????????????? ??????????????? ????????? ????? ?? ????????????!

      4. Latest data - history
      ???????? ??????? ???????? ??? «?????????????» ????????? ?????. ?????, ??? ? 13:26:05 (? ???? ?????!) ??????? ??????? ??? ????????, ??????? «1», ????? «0».

      5. Item_config
      ????????????? ??????? ???????????? ??????, ??????????? «??????????» ????????? ????? «E22».

      6. Trigger_config - ifOperStatus:
      ???????? ???????????? ???????? ??? «?????????????» ????????? ????? «E22», ?? ???????? ??????????? ???????????? ?????????.

      7. Trigger_config - ifAdminStatus (dep):
      ???????? ???????????? ???????? ??? «???????????????» ????????? ????? «E22», ?? ???????? ??????????? ??????????? ??? ???????? ? «??????????» ?????????? ?????.

      8. MySQL - ItemStatus:
      ??????? ????????? ???????? ? ?? MySQL ??? «???????????» ????????? ????? «E22»: ???? «lastvalue» = 0, ??? ????????????? ??????????????? ???????? ????? ?? ???????????? ? ????????????? ??????? ??????????? ???????? ? ??????? ?????? (?.: «4. Latest data - history»), ????????? ???????? ????.

      9. MySQL - history_uint:
      ??????? ??? ???????? ??????????? «????????????» ????????? ????? «E22», ? ??????? ?????, ??? ???????? «1» ? «0» ????????? ? ???? ????? (? ????????? ?? ???????!!!)



      ????????? ???????? ??? WEB-?????????? ?????, ??? ???????? ??? ??????????? ? ????? «Monitoring»>«Triggers» ? «Monitoring»>«Events» ?????????? ?? ?????? «history*». ??????? ?????? ??? ??????????? ? ???????? ?????????????? ???????? «item_get_history» ????????????? ? ????? «items.inc.php».
      ??????? ? ?????? ??????? ????? ????? ?????????? «$sql» ? ??????? ?????????????? SQL-?????? ??? ??????????? ???????? ??????? ????????:
      «select value from history_uint where itemid=34432 and clock=1314699965;»
      ??????? ?????????? «1»!

      ??????? ?????? ??:
      «select * from history_uint where itemid=34432 and clock=1314699965;»
      ? ???????? ??? ??????? ? MySQL, ?? ?????? ???????? ??????? ? ????? ????????:
      «10. MySQL - select»

      ??????, ???????? ? ???, ??? ????????? ????????? ????? ????????? ? ???????? ? ???? ???????, ? ??????????? ??? ? ??????? Zabbix ?? ???????? ? ????????? ?? ???????. ? ??????????, ??? ??????? ???????? ?? ??????? history_uint (? ????? ????????? ??????? ? ???? «clock») ?????? ?????????? ?????? ???? (????) ??????, ? ?? ?? ??????, ??????? ????????? ??????????.

      P.S.: ?? ???? ? ???????? ?? ZBX-4374, ????????? ? ????????????? ???????????? ?????????? ????????? ?????????. ???????, ??? ???? ???????? ? ?????? ?????????? ??????? ?????? ?? ????????.
      P.S.S.: ? ???? «triggers.inc.php» ???? ??????? ????????? ?????????, ??? ?? ????????? ???????????? ?????? ??????? {ITEM.VALUE}

      ??? ??? ?????????? ??? ????????????? «Valuemapped» (??. ZBX-3423).

        1. 1. Equip - PortStatus.JPG
          14 kB
          Dmitrij Gavrilenko
        2. 10. MySQL - select.JPG
          11 kB
          Dmitrij Gavrilenko
        3. 2. Monitoring-Triggers.JPG
          41 kB
          Dmitrij Gavrilenko
        4. 3. Latest data - PortStatus.JPG
          20 kB
          Dmitrij Gavrilenko
        5. 4. Latest data - history.JPG
          48 kB
          Dmitrij Gavrilenko
        6. 5. Item_config - ifOperStatus.JPG
          54 kB
          Dmitrij Gavrilenko
        7. 6. Trigger_config - ifOperStatus.JPG
          37 kB
          Dmitrij Gavrilenko
        8. 7. Trigger_config - ifAdminStatus (dep).JPG
          36 kB
          Dmitrij Gavrilenko
        9. 8. MySQL - ItemStatus.JPG
          40 kB
          Dmitrij Gavrilenko
        10. 9. MySQL - history_uint.JPG
          72 kB
          Dmitrij Gavrilenko

            Unassigned Unassigned
            gdgsoft Dmitrij Gavrilenko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: