Daniel_Ao_10370
Jan 29, 2018Nimbostratus
Arguments in External Monitor
I have created a script to monitor Windows service state through WMI. Below is the script.
!/bin/shIP=
echo ${1} | sed 's/::ffff://'
PORT=${2}
PIDFILE="/var/run/basename ${0}
.${IP}_${PORT}.pid"
if [ -f $PIDFILE ] then echo "EAV exceeded runtime needed to kill ${IP}:${PORT}" | logger -p local0.error kill -9
cat $PIDFILE
> /dev/null 2>&1
fi
echo "$$" > $PIDFILE
rm -f $PIDFILE
wmic -U $3/$4%$5 //$IP "select State from Win32_Service where Name=$6" | grep -i ".*|Running" 2>&1
if [ $? -eq 0 ] then
I would like to know how to pass the arguments with space in GUI to the script. For example:
Arguments: domain user password "Windows Service"