Hello Folks,
I am trying to get the PID of tomcat process running on all the hosts that we are monitoring
ps -ef | grep tomcat | grep twadmin | awk '{print $2}'
or
ps -ef | grep tomcat | grep twadmin | awk -F ' ' '{print $2}'
These commands return the exact tomcat PID when I execute it on the hosts
When I try to do the same thing using Zabbix, it gives me weird outputs
system.run[ps -ef | grep tomcat | grep twadmin | awk '{print $2}']
o/p --> 20205 25255
The right PID is 25255
It seems like Zabbix is having hard time figuring out using awk
The same issue happening with sed/cut commands as well
Can someone please help out with this
Thanks in advance!!!
-- Vaibhav
I am trying to get the PID of tomcat process running on all the hosts that we are monitoring
ps -ef | grep tomcat | grep twadmin | awk '{print $2}'
or
ps -ef | grep tomcat | grep twadmin | awk -F ' ' '{print $2}'
These commands return the exact tomcat PID when I execute it on the hosts
When I try to do the same thing using Zabbix, it gives me weird outputs
system.run[ps -ef | grep tomcat | grep twadmin | awk '{print $2}']
o/p --> 20205 25255
The right PID is 25255
It seems like Zabbix is having hard time figuring out using awk
The same issue happening with sed/cut commands as well
Can someone please help out with this
Thanks in advance!!!

-- Vaibhav
Comment