Ad Widget

Collapse

Count Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wagnerjs83
    Junior Member
    • Nov 2018
    • 15

    #1

    Count Item

    Hi,

    item A receives key "eventlog [Application ,," Warning "]

    is it possible to create item B to receive quantity of log that item A received within 1 hour?

    Thanks
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #3
      Calculated item:
      count("eventlog[Application ,," Warning "]",1h,".*",regexp)

      Comment

      • wagnerjs83
        Junior Member
        • Nov 2018
        • 15

        #4
        Originally posted by Semiadmin
        Calculated item:
        count("eventlog[Application ,," Warning "]",1h,".*",regexp)
        Error:

        Incorrect function 'count' expression. Check expression part starting from: "eventlog[Application ,,"

        Suggestion?

        Comment

        • ingus.vilnis
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Mar 2014
          • 908

          #5
          Escape the quotes inside the item key.
          Code:
          count("eventlog[Application ,,\" Warning \"]",1h)

          Comment

          • Semiadmin
            Senior Member
            • Oct 2014
            • 1625

            #6
            I tried to escape quotes but forum's engine devoured slashes
            Last edited by Semiadmin; 27-11-2018, 12:36.

            Comment

            • wagnerjs83
              Junior Member
              • Nov 2018
              • 15

              #7
              Item Application_Error

              Click image for larger version

Name:	Item Application Error.PNG
Views:	3396
Size:	156.8 KB
ID:	369691


              Item count log1

              Click image for larger version

Name:	count log 1.PNG
Views:	3448
Size:	121.3 KB
ID:	369690

              item count log 2

              Click image for larger version

Name:	count log 2.PNG
Views:	3364
Size:	119.9 KB
ID:	369692

              Error count log 1

              Click image for larger version

Name:	error count log 1.PNG
Views:	3369
Size:	12.1 KB
ID:	369693

              Error count log 2

              Click image for larger version

Name:	error count log 2.PNG
Views:	3457
Size:	14.1 KB
ID:	369694

              Comment

              • Semiadmin
                Senior Member
                • Oct 2014
                • 1625

                #8
                " Warning " or "Error"?

                Comment

                • ingus.vilnis
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Mar 2014
                  • 908

                  #9
                  So what does the error message say?
                  Item does not exist, right?

                  In your first screenshot you have an item monitoring ERROR, not WARNING as in original description. There must exist also an item which you later are referencing in calculated items' formula.

                  Comment

                  • wagnerjs83
                    Junior Member
                    • Nov 2018
                    • 15

                    #10
                    lol

                    Click image for larger version

Name:	count log 1 Warning.PNG
Views:	3340
Size:	150.4 KB
ID:	369699

                    Comment

                    • ingus.vilnis
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Mar 2014
                      • 908

                      #11
                      In the calculated item formula there is a space between quotes and the word " Warning ". Could be some copy paste or form formatting issue. Remove the spaces and see if the item goes supported within some 10 minutes. .

                      Comment

                      • wagnerjs83
                        Junior Member
                        • Nov 2018
                        • 15

                        #12
                        Originally posted by ingus.vilnis
                        In the calculated item formula there is a space between quotes and the word " Warning ". Could be some copy paste or form formatting issue. Remove the spaces and see if the item goes supported within some 10 minutes. .
                        Formula: count("eventlog[Application ,,"Warning"]",1h,".*",regexp)

                        latest data: Incorrect function 'count' expression. Check expression part starting from: "eventlog[Application ,,"

                        Comment

                        • ingus.vilnis
                          Senior Member
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Mar 2014
                          • 908

                          #13
                          Code:
                          count("eventlog[Application ,,\"Warning\"]",1h)

                          Comment

                          • wagnerjs83
                            Junior Member
                            • Nov 2018
                            • 15

                            #14
                            Originally posted by ingus.vilnis
                            Code:
                            count("eventlog[Application ,,\"Warning\"]",1h)
                            count("eventlog[Application,,"Warning"]",1h)

                            Perfect!!!

                            Thank you very much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                            Comment

                            Working...