Creating and configuring event handler

Hi,
i can really use a help on this issue,
i am trying to use event handler for the first time. i created the script to be perform and configured it as a new “command”.

the handler should simply restart a windows process once nagios alert on HARD state.

the “command” command line look like this:
$USER1$/NagiosKillISAViaWD.pl -ip $HOSTADDRESS$ -SERVICESTATEID $SERVICESTATEID$ -SERVICESTATETYPE $SERVICESTATETYPE$
and the script will execute the desired commands when SERVICESTATEID will be “2” and SERVICESTATETYPE will be “HARD”

the problem is when i run “test” to the command it doesnt know for which service its running and therefore i dont have the values SERVICESTATETYPE and SERVICESTATETYPE in the command. the command which the nagios actually perform is “/usr/local/groundwork/nagios/libexec/NagiosKillISAViaWD.pl -ip 192.168.1.1 -SERVICESTATEID 0 -SERVICESTATETYPE -”

any lead may will help me or if anybody can tell me how can i simulate and debug executing the command for a specific service using its current parameters.

Thanks in advance,
Jecki