Ad Widget

Collapse

Testing for string values in items other than the most recent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erozen
    Junior Member
    Zabbix Certified Specialist
    • Apr 2007
    • 18

    #1

    Testing for string values in items other than the most recent

    Hi,

    I'm trying to setup a trigger to monitor the value of an item - the value is retreived by getting the return value from an HTTP GET, and storing it as a string (item type is 'char'). The test i want to get in place is 'Have all of the last three attempts failed'.

    So, if the successful return value is, for example, "OK", then i want to test:
    ((item.last(0) # OK) & (item.prev(0) # OK) & (item.prev(1) # OK))

    I can't find a way to do this - according to the documentation (and my tests), all the available string functions only work on the last value, and can't be configured to work with any of the previous ones (except diff & change, which is last and prev, but still not very useful in this case).

    I've also noticed that the documentation for trigger functions isn't quite up-to-date - for example there is a column saying which data types any given function works on, but this disagrees with a comment at the bottom saying 'only diff and change can be used with strings', so I'm not quite sure what to believe.
    It looks like string functions have been added, and some tests enhanced to support them - perhaps some of more these functions can now be used with strings, and the documentation doesn't reflect that?


    Hopefully someone has some input? My best idea to convert the string to a number (generating a checksum, concatenating ascii values for each char, treating it as a base64 number, etc), and then do my comparisons based on that.
    Seems a little clunky though.



    Thoughts?
Working...