PDA

View Full Version : Parameters transfer to user-defined monitoring functions


disparo
19-10-2005, 17:25
Hello!

I added a function to zabbix_agentd.conf file:

UserParameter=chksrvc[sender],chksrvc.sh sender

it checks my 'sender' service. for 'broker' service i need to add another string, i.e.

UserParameter=chksrvc[broker],chksrvc.sh broker

but it seems tedious to add lines for each service!

It seems to be great, if users can transfer function arguments to their own functions for this scheme:

User adding an item like : chksrvc[<argument>], and in zabbix_agentd.conf file writes:

UserParameter=chksrvc[<argument>],chksrvc.sh <argument>

or something.

James Wells
19-10-2005, 18:28
Greetings,

Actually it does work that way. Based on your example, you would use;
UserParameter=chksrvc ,chksrvc.sh $1

Additionally, you can pass up to 8 more command line arguments using $2-$9

disparo
20-10-2005, 09:42
Greetings,

Actually it does work that way. Based on your example, you would use;
UserParameter=chksrvc ,chksrvc.sh $1

Additionally, you can pass up to 8 more command line arguments using $2-$9

Thanks, James! :) But this option wasn't described in docs yet... :confused:

Nate Bell
20-10-2005, 16:54
Take a look here (http://www.zabbix.com/manual/v1.1/config_items.php) in the section titled Flexible and non-flexible parameters. I believe Alexei has extended this further to allow several parameters to be passed to the UserParameter.

That section is a bit buried, but I find it to be one of the most important features of UserParameters, so maybe it should be made clearer in the documentation.

Nate