Ad Widget

Collapse

Count items equal something

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • safl
    Senior Member
    • May 2005
    • 103

    #1

    Count items equal something

    Hey,

    Is it possible to count a number of values equal some value within a given time?

    I have a trapper item (backup_log) of type text, i would like to count the number of entries in the item within the last 24 hours with values like "Job Success", "Job Failed", "Job Completed With Exceptions" etc.

    Something like:

    {SERVER:backup_log.count('Job Failed', 86400)}>0

    Can this be achieved? Can't seem to find the right functions to use...

    regards,
    Simon
  • safl
    Senior Member
    • May 2005
    • 103

    #2
    Please anybody, am i not clear enough?

    To the developer(s)>
    If i implement this trigger function can it then be merged into zabbix?
    I really need the functionality but i don't wanna apply patches after each zabbix upgrade.

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      We will be happy to integrate any well-written patches which are in sync with ZABBIX vision
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • safl
        Senior Member
        • May 2005
        • 103

        #4
        Great! I will get right to it

        Can you give me a hint?
        Let's say i implement the function 'myFunc'.
        It seems like all i need to do is expand "else if" block in 'evaluate_FUNCTION' (evalfunc.c) to check for the 'myFunc' , and implement 'evaluate_myFunc' in evalfunc.c.

        Correct?

        Comment

        • safl
          Senior Member
          • May 2005
          • 103

          #5
          Allrighty then, I've made a 'txtcount' patch, take a look here:

          Comment

          Working...