Zabbixazzer
13-07-2006, 15:11
Talking about zabbix 1.1 (and so referring to 1.1 syntax), it is possible to put custom intems into zabbix_agentd.conf, for example:
UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
UserParameter=mysql.version,mysql -V
If I want to create a custom item that accepts arguments, how can I do?
If I write something like this:
UserParameter=mycommand ,
then after the comma goes the shell command, in that command how can I refer to the item's argument? Can I write something like this:
UserParameter=mycommand ,shellcommand $1
where $1 refers to mycommand[] argument?
Or maybe just isn't possible to use arguments?
UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
UserParameter=mysql.version,mysql -V
If I want to create a custom item that accepts arguments, how can I do?
If I write something like this:
UserParameter=mycommand ,
then after the comma goes the shell command, in that command how can I refer to the item's argument? Can I write something like this:
UserParameter=mycommand ,shellcommand $1
where $1 refers to mycommand[] argument?
Or maybe just isn't possible to use arguments?