Ad Widget

Collapse

UserParameter and zabbix agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Milio
    Junior Member
    • Oct 2009
    • 5

    #1

    UserParameter and zabbix agent

    I've got a bunch of doubts about the way UserParameters work...

    First of all, is it possible to define UserParameters in agent-less hosts?

    And second, how can I test any UserParameter?

    Let's just say I edit the file zabbix_agent.conf in one of my hosts and add this entry:

    UserParameter=test[*],snmpwalk -v2c -c public $1 .1.3.6.1.2.1.4.20.1.1.192

    When it comes to see if it works, I would create an item whose key would be "test[192.XXX.XXX.XXX]", am I right? On the other hand, which type (Zabbix agent, Zabbix agent (active), etc) should I choose from the list?

    Thanks.
  • MrKen
    Senior Member
    • Oct 2008
    • 652

    #2
    Ok, here's a real-life example that I use. It works fine.

    UserParameter=SPB.conn,snmpwalk -v2c -c public HostIP .1.3.6.1.3.94.1.6.1.6 | awk -F" " '{ print $4; }'

    I have an item with key = SPB.conn


    If a host doesn't have an agent, then it doesn't have an agent.conf in which to place a UserParameter. So the answer to Q1 would be no. However, my example above is in the Zabbix_servers zabbix-agentd.conf and is snmpwalking a remote device . Oh, and yes, the item which belongs to a remote device, is attached to Host Zabbix Server.

    MrKen
    Disclaimer: All of the above is pure speculation.

    Comment

    • Jun.Liu
      Member
      • Apr 2007
      • 91

      #3
      Originally posted by MrKen
      Oh, and yes, the item which belongs to a remote device, is attached to Host Zabbix Server.
      According to my experience, the item's configuration should belong (under) to host ”Zabbix Server“ not the remote device. in other word, the SPB.conn is created under the host "Zabbix Server". Right?

      Comment

      • MrKen
        Senior Member
        • Oct 2008
        • 652

        #4
        Hi Jun.Liu,

        Yes, the item is under the Zabbix Server.

        MrKen
        Disclaimer: All of the above is pure speculation.

        Comment

        • Jun.Liu
          Member
          • Apr 2007
          • 91

          #5
          Hi MrKen,
          Since it's easy lead to a logical confusion, Is there any way to do the opposite? that's the item is created under the remote device.

          Jun.liu

          Comment

          • MrKen
            Senior Member
            • Oct 2008
            • 652

            #6
            Hi Jun.Liu,

            Not as a UserParameter.
            You could put your command into a script, then use zabbix_sender to send the data to the correct host. Run the script through cron.
            That should work.

            MrKen
            Disclaimer: All of the above is pure speculation.

            Comment

            Working...