Archive for the ‘Genesys’ Category

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

 

Genesys Health Check Part One-SCS/SCI

Every morning, we check SCI to make sure that all our applications are running, and that they haven’t failed over for some unexplained reason. Unfortunately there are a lot of applications to check, an this gets a bit tedious. We’ve had several times where the person responsible for checking missed the fact that an application had failed.

So I wrote the following script to check current status of the applications against a list of “preferred states”. The biggest challenge I faced was that it isn’t particularly easy to get the current state of an application directly from the SCS logs. The only way I found: after someone logs into SCI, the SCS logs report a complete status check for all applications. So, support person must first login to SCI, then launch this script to check the logs against the preferred states list. In order to make use of this in your organization, you’ll need to set the LOG and APP variables. All the mentions of “CTS” in the script are references to one of our two Genesys environments. You can remove or change CTS to suite your implementation.

@echo off

set NORMAL=cts-status-normal.txt
set result=%temp%\cts-status-check.txt
set LOG=\\wpoh0010genwf01\Logs\cts_dub_scs_pr

set APP=ctssci

echo For this utility to work proprerly, you must have logged in to SCI recently, and cts_dub_SCS_pr must be PRIMARY.
echo If you have not done so, please log in to SCI now.
echo.
pause

:begin_here
if exist %result% del %result%
set FILE=%1
if .%FILE%.==.. (
rem if a file wasn’t passed in, see if we can find one
for /f %%k in (’dir /b /on %LOG%’) do set FILE=%LOG%\%%k
)
echo Checking %FILE%
copy /y “%FILE%” %TEMP%\cts-status-log.log
set BAD=false
echo Searching for SCI client connection ID
for /f “delims== tokens=1-3″ %%m in (’find /n “SC Interface ‘%APP%’ connected” %TEMP%\cts-status-log.log’) do (
set CLIENT=%%o
for /f “delims=[]” %%t in (’echo %%m’) do set /a STARTLINE=%%t-1 2>nul
rem echo %%m=%%n=%%o >> %result%
)
if .%CLIENT%.==.. (
echo Could not find client connection. Did you lauch SCI first? > %result%
exit
)
echo Searching for application statuses
if exist %temp%\cts-status-log2.log del %temp%\cts-status-log2.log
for /F “tokens=* skip=%STARTLINE%” %%t in (%temP%\cts-status-log.log) do echo %%t >> %temp%\cts-status-log2.log
find “SCI(%CLIENT%,ctssci)” %TEMP%\cts-status-log2.log > %TEMP%\cts-status-log1.log

echo Comparing application statuses against known good list: %NORMAL%
for /f “tokens=1-6 delims=(){}[]” %%i in (%TEMP%\cts-status-log1.log) do (
rem echo %%i %%j %%k %%l %%n
rem %%i — SCI
rem %%j — nnn,sci where nnn is client id
rem %%k — < ==
rem %%l — bbb, where bbb is dbid for app (I think)
rem %%m — app_name
rem %%n — app_status, mode
if “%%k” == ” <== ” (
rem echo “%%l} [%%m”
rem echo “%%k”
find “%%l} [%%n” %NORMAL% > nul
if errorlevel 1 (
echo %%l %%n IS WRONG
echo %%l %%n IS WRONG >> %result%
set BAD=true
)
)
)

if not exist %result% echo No application status problems detected > %result%

start notepad %result%

 

Genesys Tserver Textpad Syntax File

I got tserver-log.syn from an instructor in one of the classes I took at Genesys. It is a Syntax file for use with TextPad, so that keywords will be highlighted while reading Tserver and other log files. It helps a bit reading the nastiness, but not as much as Kazimir.

To install tserver-log.syn, download it to your C:\Program Files\TextPad 4\system directory.
Start TextPad.
On the Configure menu, choose New Document Class.
Type a name like “Log Files”, and click Next.
For class members, type “*.log”, and click Next.
Next, check “Enable syntax highlighting”, and select tserver-log.syn from the list of Syntax definition files.

If you want, you can customize some of the behavior for the syntax highlighting by choosing Preferences from the Configure menu. Expand Document Classes in the left pane to find your new document class.