Im trying to program a script to automatize the restart of certain applications by calling SCI with the command line using mlcmd tool.
My platform has 2 config servers, i have server genesys02b config server as primary right now and genesys02a as backup.
The config file for the config server sets the following options:
[confserv]
port =2020
management-port =2021
…
I get Conn Write error when i try to connect to the management port on both configs, and if I try to connect to the normal port an unknown error is returned in primary role and not found error is found in backup.
Try IP address of config server for the -cshost parameter and see if it works. Then if the provided -csport -csappname <app_name> -csuser -cspassword is all correct, then check SCS logs for a new mlcmd connection (Validate those credentials using CME or GA or any tool that requires authentication into Genesys Config Layer first). You should see something like this in your SCS logs which is basically the output you will also see in your command line result
Yeah you need to pass config server details and scs details. Your not providing SCS details (you can see the error when you use port 2020 that it can’t connect to scs.)
I’ve built a wrapper around mlcmd which tries primary and backup config server (incase the backup is primary) and also primary and backup SCS (again incase backup is running primary)
This is a bash script though, so you would need to adjust for windows obviously..
#!/bin/bash
# redirect output - stdout should go to stderr
# for the duration of the script except right at the end
exec 3>&1 4>&2
exec 1>&2
# return codes
SCS_CONNECTION_ERROR=254
CS_CONNECTION_ERROR=250
# uncomment for debug
# set -x
# config server user/app
CSUSER="[email removed]"
CSPASS="pass"
CSAPP="default"
# config server host and port (primary and backup)
CSHOST_PRIMARY="cs-primary.domain.com.au"
CSPORT_PRIMARY="2000"
CSHOST_BACKUP="cs-backup.domain.com.au"
CSPORT_BACKUP="2000"
# scs host and port (primary and backup)
SCSHOST_PRIMARY="scs-primary.domain.com.au"
SCSPORT_PRIMARY="2052"
SCSHOST_BACKUP="scs-backup.domain.com.au"
SCSPORT_BACKUP="2052"
CSHOST=$CSHOST_PRIMARY
CSPORT=$CSPORT_PRIMARY
SCSHOST=$SCSHOST_PRIMARY
SCSPORT=$SCSPORT_PRIMARY
MLCMD=/home/user/mlcmd_64
# execute command first time - may run into CS_CONNECTION_ERROR or SCS_CONNECTION_ERROR
output1=$($MLCMD -cshost $CSHOST -csport $CSPORT -csuser $CSUSER -cspassword $CSPASS -csappname $CSAPP -scshost $SCSHOST -scsport $SCSPORT "$@" 2>&1)
result1=$?; result=$result1; output=$output1
# execute command second time if CS_CONNECTION_ERROR or SCS_CONNECTION_ERROR errros occured
if [[ $result1 == $CS_CONNECTION_ERROR || $result1 == $SCS_CONNECTION_ERROR ]] ; then {
[[ $result1 == $CS_CONNECTION_ERROR ]] && { CSHOST=$CSHOST_BACKUP; CSPORT=$CSPORT_BACKUP; }
[[ $result1 == $SCS_CONNECTION_ERROR ]] && { SCSHOST=$SCSHOST_BACKUP; SCSPORT=$SCSPORT_BACKUP; }
output2=$($MLCMD -cshost $CSHOST -csport $CSPORT -csuser $CSUSER -cspassword $CSPASS -csappname $CSAPP -scshost $SCSHOST -scsport $SCSPORT "$@" 2>&1)
result2=$?; result=$result2; output=$output2
} fi
# execute command third time if CS_CONNECTION_ERROR or SCS_CONNECTION_ERROR errros still occured
if [[ $result2 == $CS_CONNECTION_ERROR || $result2 == $SCS_CONNECTION_ERROR ]] ; then {
[[ $result2 == $CS_CONNECTION_ERROR ]] && { CSHOST=$CSHOST_BACKUP; CSPORT=$CSPORT_BACKUP; }
[[ $result2 == $SCS_CONNECTION_ERROR ]] && { SCSHOST=$SCSHOST_BACKUP; SCSPORT=$SCSPORT_BACKUP; }
output3=$($MLCMD -cshost $CSHOST -csport $CSPORT -csuser $CSUSER -cspassword $CSPASS -csappname $CSAPP -scshost $SCSHOST -scsport $SCSPORT "$@" 2>&1)
result3=$?; result=$result3; output=$output3
} fi
exec >&3 2>&4
echo "$output"
exit $result
I believe if those options are not specified, mlcmd tries to use the SCS with the lowest DBID. Either way all great info. I hope all these help you resolve your issue and thanks to all for all the good content.