Ad Widget

Collapse

Use of Item values in other items and in actions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ibrahim
    Junior Member
    • Sep 2006
    • 19

    #1

    Use of Item values in other items and in actions

    Hi,
    I have serached through the forum to find an answer for the following question without sucess. I would be grateful if anybody could help, or suggest something.

    Is it possible to use the value of a certian item in a macro to configure another item or a remote action?

    For example, I have one item that fetches the name of a log file. Can i use its last value in new item like zabbix agent item vfs.file.time? And then can i use this file name value in a remote action to remove the file?

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

    #2
    I'm not sure what exactly you'd like to achieve, however you may use macros like: {host:key.func()} in message subject/body. They will be subsitituted by real values.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Ibrahim
      Junior Member
      • Sep 2006
      • 19

      #3
      Hi,
      Thanks for the response. Yes I am currently using this kind of macro in my messages. But it seems these macros can't work with remote actions or define item keys.

      For example I have one item with key1 that returns a file name in host1 that changes frequently. the macro to the last value would be {host1:key1.last()}. How can I get the file modification time? Apparently, vfs.file.time[{host1:key1.last()}] doesn't work. And how I can remove this file when a certain trigger goes ON? Apprently, host1:rm {host1:key1.last()} doesnt also work in remote commands. Any work arounds?

      Currently, I have solved this problem by creating an action that will update a symbolic link to the changing file name. Then I use the symbilic link in Zabbix keys and remote actions. I am not happy with this solution. Any ideas?

      Many thanks again. And all the best luck.
      Ibrahim

      Comment

      • LPby
        Junior Member
        • Aug 2008
        • 21

        #4
        Also need such functionality.
        simple example:
        item1 - key1
        item2 - key2[{key1.last()}]

        Comment

        Working...