Ad Widget

Collapse

pass string to zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rootus
    Junior Member
    • Oct 2007
    • 19

    #1

    pass string to zabbix

    I want to pass a string to zabbix.
    UserParameter=chat2zabbix,talk.sh

    talk.sh can return bladibla or bladiblewit

    How do I configure the trigger?

    it is something with regexp or str but there is no LOG file.

    I want to trigger bladiblewit.
    {Template_VmwareESX:chat2zabbix.regexp(blew)}#0) is not the way.

    How can I do this?
  • untergeek
    Senior Member
    Zabbix Certified Specialist
    • Jun 2009
    • 512

    #2
    You're much better off avoiding the # (not-equal) operator when dealing with strings.

    Far better to do a straight-up, true/false, is-the-string-there-or-not kind of check:

    {Template_VmwareESX:chat2zabbix.regexp(blew)}=1

    or

    {Template_VmwareESX:chat2zabbix.str(blew)}=1

    Comment

    • rootus
      Junior Member
      • Oct 2007
      • 19

      #3
      Thank you for your reply Untergeek.

      Zabbix it totally ignoring me.

      ITEM:
      Type: Zabbix Agent (Active)
      Type of information: Character
      Key: chat2zabbix

      TRIGGER:
      {Template_VmwareESX:chat2zabbix.str(bladibla)}=1

      I execute:
      zabbix_sender -v -z 192.168.28.55 -s VMW02 -k chat2zabbix -o bladibla
      and
      UserParameter=chat2zabbix,echo bladibla
      (restart zabbix with debug=4)

      No reaction on server and no chat2zabbix logentries in agentd.log.
      Has Zabbix already figured out I'm ignorant and ignores me?
      (I'm not on the Discovery list)

      Comment

      • untergeek
        Senior Member
        Zabbix Certified Specialist
        • Jun 2009
        • 512

        #4
        If you're using zabbix_sender, you should change the item type to Trapper, rather than Zabbix Agent (Active).

        Try that and see if it works better, even if only for testing.

        Comment

        • rootus
          Junior Member
          • Oct 2007
          • 19

          #5
          Thank you.
          It was a "when a plan comes together" case but now it works.

          This will enable me to do more with less triggers.

          I'm happy.

          Comment

          Working...