Hello,
I am attempting to create a UserParameter with variable substitution.
The command will sum memory for processes matching an expression passed to the UserParameter, for instance;
process.mem[jboss]
Within my command I am using the awk variable $1 to reference ps info;
awk '{a+=$1} END {print a}'
My full user parameter is;
UserParameter=process.mem[*],ps -eao "vsize command" | grep $1 | awk '{a+=$1} END {print a}'
Of course this doesn't work as Zabbix substitues all $1 variables with it's own variables. I want the first $1 to be the Zabbix supplied 'jboss' and the second $1 to be left alone as it is part of the awk awk command.
Any ideas how to do this?
I am attempting to create a UserParameter with variable substitution.
The command will sum memory for processes matching an expression passed to the UserParameter, for instance;
process.mem[jboss]
Within my command I am using the awk variable $1 to reference ps info;
awk '{a+=$1} END {print a}'
My full user parameter is;
UserParameter=process.mem[*],ps -eao "vsize command" | grep $1 | awk '{a+=$1} END {print a}'
Of course this doesn't work as Zabbix substitues all $1 variables with it's own variables. I want the first $1 to be the Zabbix supplied 'jboss' and the second $1 to be left alone as it is part of the awk awk command.
Any ideas how to do this?
Comment