Ad Widget

Collapse

User parameter with multiple values. How to extract them?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dotex
    Junior Member
    • Mar 2020
    • 7

    #1

    User parameter with multiple values. How to extract them?

    Hi guys,
    Once again I'm asking for your help, o' mighty Zabbix gods.
    I've got a custom user parameter set up that gives me 6 numeric values. I.E.:

    123456
    123456
    123456
    123456
    123456
    123456

    I need to extract all of them to use in triggers. Is there an easy way to do this using dependent items and pre-processing? Or is my only option setting up user parameters for every single separate value?

    Thanks in advance,
    Dom
  • dotex
    Junior Member
    • Mar 2020
    • 7

    #2
    I just realized , that having a trigger active during only certain period of hours would work fine for me too.
    Any ideas on how to set that up?

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      See the time() trigger function

      If you already have a trigger expression, you append the following "and" clause to your trigger expression:

      Code:
       and {your.host.here:your.item.here.time(0)}>073000 and {your.host.here:your.item.here.time(0)}<173000
      That makes it so whatever previous conditions you have set in your trigger expression will only evaluate as true if they happen between 7:30:00 (AM) and 17:30:00 .

      Comment

      • dotex
        Junior Member
        • Mar 2020
        • 7

        #4
        Originally posted by tim.mooney
        See the time() trigger function

        If you already have a trigger expression, you append the following "and" clause to your trigger expression:

        Code:
        and {your.host.here:your.item.here.time(0)}>073000 and {your.host.here:your.item.here.time(0)}<173000
        That makes it so whatever previous conditions you have set in your trigger expression will only evaluate as true if they happen between 7:30:00 (AM) and 17:30:00 .
        Hi Tim,

        Thank you for your reply.
        It does not seem to work for me when im trying to use your example.
        My trigger expression:
        {host:calculated.item.last()}>{AWSIR-SFTP:item.now()} and {host:calculated.item.time(0)}>203000 and {host:calculated.item.time(0)}<204000
        Any ideas why?

        Thanks,
        Dom

        Edit:
        It's a test trigger and I made sure that both calculated item and the logic with calculated.item and item is correct and should fire a trigger. Something is wrong with the time(0) part.

        Edit 2:
        I found the problem- the zabbix server is running two hours back... As in Its 8 o'clock, but the server thinks its 6... Wasntt me who set up the server so I could not have known about it... Anyways, It works, thank you for your brilliant solution Tim
        Last edited by dotex; 23-06-2020, 20:54.

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #5
          I guess I'm not sure. Was your item collected during the 10 minute time period when the trigger could have evaluated to true?

          My site had used the time() function in the past and it worked for what we were trying to do that the time, but we're no longer using it and we never used it for a calculated item.

          Comment

          • dotex
            Junior Member
            • Mar 2020
            • 7

            #6
            Originally posted by tim.mooney
            I guess I'm not sure. Was your item collected during the 10 minute time period when the trigger could have evaluated to true?

            My site had used the time() function in the past and it worked for what we were trying to do that the time, but we're no longer using it and we never used it for a calculated item.
            the problem was that zabbix server was running two hours behind, thus when I tried testing it the trigger wouldn't fire....

            Comment

            Working...