Forum Discussion
Daniel_Ao_10370
Nimbostratus
Jan 29, 2018Arguments 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"
1 Reply
- Daniel_Ao_10370
Nimbostratus
!/bin/shIP=
PORT=${2} PIDFILE="/var/run/echo ${1} | sed 's/::ffff://'
.${IP}_${PORT}.pid" kill of the last instance of this monitor if hung and log current pidbasename ${0}
if [ -f $PIDFILE ] then echo "EAV exceeded runtime needed to kill ${IP}:${PORT}" | logger -p local0.error kill -9
> /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 mark node UP if expected response was receivedcat $PIDFILE
if [ $? -eq 0 ] then echo "UP" fi exit
text
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects