Ad Widget

Collapse

Suggestion: Default UserParameter Argument Values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sirtech
    Junior Member
    • Aug 2012
    • 25

    #1

    Suggestion: Default UserParameter Argument Values

    Being able to send arguments to the UserParameter items in an agent is a very good and powerful tool. One thing that is missing in the current implementation is the ability to specify default values for the arguments that get passed. Most built in Agent items already have defaults e.g.

    net.dns[<ip>,zone,<type>,<timeout>,<count>]

    Where the arguments are optional and, for instance, ip defaults to the IP of the host the item is assigned to if it is not passed in as an argument.

    In the current implementation of UserParameter arguments, the number of arguments is not fixed, and so this might present an implementation difficulty. I would be happy to see the implementation changed so that the number and name of arguments in the configuration. E.g.

    UserParameter=custom.something[arg1,arg2=default], logger -t $arg2 $arg1

    Where the default value for arg2 is used is no value is passed. I can achieve the same thing by calling a bash script to do the argument checking, but I don't think it makes sense to have wrapper scripts existing to do a check that can be done in the normal workflow of Zabbix in the first place.

    Implementation in Zabbix will also prevent someone from passing too many arguments in this kind of item -- the agent could throw an exception to the log file and return ZBX_UNSUPPORTED, so we know what is going on.
Working...