PDA

View Full Version : Problem with UserParameter


just2blue4u
22-05-2006, 16:03
I have configured a UserParameter as follows:
UserParameter=proc.cnt.name ,ps -efa|grep -i $1|grep -v grep|wc -l
when i test this item, i always get back the correct value +1:
[root@oracle-stdby-pbs ~]# zabbix_agentd -t proc.cnt.name[mingetty]
proc.cnt.name[ps -efa|grep -i mingetty|grep -v grep|wc -l] [s|7]
[root@oracle-stdby-pbs ~]# ps -efa|grep -i mingetty|grep -v grep|wc -l
6

Can somebody explain this behaviour to me and/or help me to solve this problem?

just2blue4u
23-05-2006, 09:23
What i found out today:
When i include that item into the frontend, the value i get back is the correct value (6).

perhaps now someone has a clue (i don't :confused: )...

Alexei
04-08-2006, 14:47
Come on! The "zabbix_agentd -t proc.cnt.name[mingetty]" obviously is calculated as well because of "grep mingetty".

just2blue4u
04-08-2006, 15:00
:rolleyes: Sometimes the solution is nearer than you'd think... :cool:

Thx! :D

azilber
08-08-2006, 20:06
I have configured a UserParameter as follows:
UserParameter=proc.cnt.name ,ps -efa|grep -i $1|grep -v grep|wc -l
when i test this item, i always get back the correct value +1:
[root@oracle-stdby-pbs ~]# zabbix_agentd -t proc.cnt.name[mingetty]
proc.cnt.name[ps -efa|grep -i mingetty|grep -v grep|wc -l] [s|7]
[root@oracle-stdby-pbs ~]# ps -efa|grep -i mingetty|grep -v grep|wc -l
6

Can somebody explain this behaviour to me and/or help me to solve this problem?


As a side note, it seems that user parameters with brackets: "[" and "]" are not supported, if they are in fact custom keys.