Genesys Health Check Part Two-Agent Desktop

The second part of the Genesys health check involves smoke-testing GAD (Genesys Agent Desktop). This script requires wget to be in your path or in the same directory.
To customize for your location, just put the host:port for all the GAD servers in the SERVERS variable. This script will then spawn a new process for each one and check:

  1. Administrative login
  2. Count of users logged in
  3. Verify user login is presented
  4. Check GAD application status via a proprietary (to my company) widget which returns the application status. You’ll probably have to comment out the whole :check_status section.

@echo off
REM Version 3.0
REM This version is more complicated because it has been redesigned to run multi-threaded for its results.
rem if we don’t have a command line being passed in, then we are the parent process

set result=%temp%\gad-healthcheck.txt
set SERVERS=wpoh0010gengw01:10362 wpoh0010gengw02:10362 wpil0210gengw01:10362 wpil0210gengw02:10362 wpky0190gngad01:10100 wpky0190gngad01:10120 wpky0190gngad02:10100 wpky0190gngad02:10120 wpky0190gngad03:10100 wpky0190gngad03:10120 wpar0130gngad01:10100 wpar0130gngad01:10120 wpar0130gngad02:10100 wpar0130gngad02:10120 wpar0130gngad03:10100 wpar0130gngad03:10120

if .%1.==.. (
if exist %result% del %result%
echo Spawning individual threads…
for %%j in (%SERVERS%) do start /min “%%j” %0 %%j
rem check for the existence of the log files and wait until all processes are complete.
ping localhost -n 5 > nul
echo.|set/p BLAH=Waiting for threads to complete
:wait_here
ping localhost -n 1 > nul
echo.|set/p BLAH=.
if exist %temp%\gad-health-check-wp*.txt goto :wait_here
type %temp%\gad-health-check-wpoh*.don > %result% 2>nul
type %temp%\gad-health-check-wpil*.don >> %result% 2>nul
type %temp%\gad-health-check-wpar*.don >> %result% 2>nul
type %temp%\gad-health-check-wpky*.don >> %result% 2>nul
del %temp%\gad-health-check*.don
if .%QUIETMODE%. NEQ .TRUE. start notepad %result%
goto :eof
)

rem if we got here, it is because another instance called us, and we’re our own thread, to work on a single server.

for /F “delims=: tokens=1,2″ %%p in (‘echo %1′) do call :_set_host_port %%p %%q
set result=%temp%\gad-health-check-%host%-%port%.txt
set LOG=%temp%\%host%-%port%-output.txt
set tmp=%temp%\%host%-%port%-tmp.txt
if exist %LOG% del %LOG%
if exist %tmp% del %tmp%

echo.|set/P BLAH=>%result%

echo.|set/P BLAH=Checking %1

echo.|set/p BLAH=%1 >>%result%

:admin_login
echo.|set/P BLAH=admin
wget –output-file=%LOG% –output-document=%tmp% –tries=1 –timeout=15 “http://%1/gdesktop/admin/mainpage.jsp?userName=dublin25&userPassword=dublin25″ “http://%1/gdesktop/admin/agentList.jsp”
for /F %%m in (‘findstr /c:”Available Links dublin25″ %tmp%’) do echo.|set/p BLAH=Admin OK, >> %result%
findstr /i “failed error” %LOG% >> %result%

:count_users
echo.|set/P BLAH=user count
for /F “tokens=9″ %%j in (‘find “Agents list Nb” %tmp%’) do echo.|set/p BLAH=%%j users, >>%result%

:user_login
echo.|set/P BLAH=user login
wget –output-file=%LOG% –output-document=%tmp% –tries=1 –timeout=15 “http://%1/gdesktop/”
for /F %%m in (‘findstr /c:”" %tmp%’) do echo.|set/p BLAH=Agent OK, >> %result%
findstr /i “failed error” %LOG% >> %result%

:check_status
echo.|set/P BLAH=app status
wget –output-file=%LOG% –output-document=%tmp% –tries=1 –timeout=15 “http://%1/gdesktop/JGenAppStatus?XmlAppStatusRequest=false
for /F “delims=<>(). tokens=6″ %%k in (%tmp%) do echo.|set/P BLAH=%%k >> %result%
findstr /i “failed error” %LOG% >> %result%
echo done.
echo.>> %result%

move %result% %result%.don
exit

:_set_host_port
set HOST=%1
set PORT=%2
goto :eof

 

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word