Ad Widget

Collapse

system.run in triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • st4nis1av
    Junior Member
    • Dec 2006
    • 8

    #1

    system.run in triggers

    Hi! first sorry for my poor english.

    I have script name "wbtest" with output 1 or 0, depended on
    wbinfo -t output.

    can I somehow do something like

    {host:system.run["/etc/zabbix/wbtest].last(0)}]=0

    ? Is this possible?

    thank's for help )
  • just2blue4u
    Senior Member
    • Apr 2006
    • 347

    #2
    Welcome here!

    Why don't you try it out?

    But make sure you say {host:system.run["/etc/zabbix/wbtest"].last(0)}=0

    Notice that you have to monitor system.run["/etc/zabbix/wbtest"] before you can use it as a trigger!
    Big ZABBIX is watching you!
    (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

    Comment

    • st4nis1av
      Junior Member
      • Dec 2006
      • 8

      #3
      Yes, i have monitored item
      system.run["/etc/zabbix/wbtest"] active,
      but in creating trigger i have this error:

      Expression [{gentoo:system.run["/etc/zabbix/wbtest"].last(0)}] does not match to [server:key.func(param)]

      is this possible to use system.run func in triggers ??

      Comment

      • Heva
        Junior Member
        • Dec 2006
        • 15

        #4
        You could try to shorten the item, then setup the trigger, then change the item back to the longer specification (and the key in the trigger will be changed automatically).

        That's how I had to setup a lot of system.run triggers for commandline actions; not comfortable, but it works.

        Comment

        • st4nis1av
          Junior Member
          • Dec 2006
          • 8

          #5
          could you post example here ?

          Comment

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

            #6
            You may try system.run[/etc/zabbix/wbtest]. I hope it helps.
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • st4nis1av
              Junior Member
              • Dec 2006
              • 8

              #7
              {gentoo:system.run[/etc/zabbix/wbtest]}=0
              and {gentoo:system.run[/etc/zabbix/wbtest]} doesn't work (

              same error:

              Expression [{gentoo:system.run[/etc/zabbix/wbtest]}] does not match to [server:key.func(param)]

              Comment

              • Heva
                Junior Member
                • Dec 2006
                • 15

                #8
                - change item to {gentoo:system.run[ps]}
                - create trigger
                - change item back to system.run{gentoo:system.run[/etc/zabbix/wbtest]}

                Comment

                • st4nis1av
                  Junior Member
                  • Dec 2006
                  • 8

                  #9
                  Heva, thank's for you'r help!

                  All working just fine!

                  Comment

                  • SergeiChechev
                    Junior Member
                    • May 2021
                    • 8

                    #10
                    Hi! I have a same problem.. for example I have item: system.run["echo 1"], but I creating trigger, I get error: "Cannot evaluate expression: "Cannot evaluate function "gitlab:system.run["echo 1"].last()": not enough data."." ?

                    Comment

                    Working...