Forum Discussion
hwidjaja_37598
Dec 23, 2010Altostratus
Try this alternative:
Download and build Zenoss' wmic on a CentOS system:
[root@CentOS ~] wget http://dev.zenoss.org/svn/trunk/inst/externallibs/wmi-1.3.14.tar.bz2
[root@CentOS ~] tar xfj wmi-1.3.14.tar.bz2
[root@CentOS ~] cd wmi-1.3.14
[root@CentOS wmi-1.3.14] make
Transfer wmic binary to your LTM:
[root@CentOS wmi-1.3.14] scp Samba/source/bin/wmic root@YourLTM:/usr/local/bin
Test wmic from your LTM:
[root@YourLTM] ~ wmic -U [domain/]adminuser%password //host "select State from Win32_Service where Name='TermService'"
CLASS: Win32_Service
Name|State
TermService|Running
Sample code on how to check whether or not RDP service is running:
wmic -U [domain/]adminuser%password //host \
"select State from Win32_Service where Name='TermService'" \
| egrep "^TermService\|Running$" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "UP"
fi
Good luck ...