Check RPA hub health
Use the RPA Manager API for a health check: RPA_MANAGER_HOST:5555/api/healthcheck/.
Below is a sample health check for cases when RPA hubs are unavailable:
{
"status": "ERROR",
"name": "RPA Manager",
"projectInfo": {
"version": "9.0.0.4-SNAPSHOT",
"path": ">origin/develop",
"revision": "8e2c40665e8e10fba586dcfb392fc12165e721c2"
},
"warningCount": 6,
"errors": [
"Number of hubs with errors: 2"
],
"warnings": [
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 chrome 1.0 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running.",
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 internet explorer 11 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running.",
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 desktop 1.0 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running.",
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 firefox 1.0 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running.",
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 MicrosoftEdge 1.0 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running.",
"Hub ec2-35-170-33-232.compute-1.amazonaws.com:4444 in the 'user' quota file declared with 2 universal 1.0 Driver instances, but only 0 driver(s) is found. Please, check that the configuration is correct in the quota file and the nodes are up and running."
],
"components": [
{
"status": "ERROR",
"name": "ec2-35-170-33-232.compute-1.amazonaws.com:4444",
"errorCount": 1,
"warningCount": 0,
"errors": [
"Hub is not available: Connect to ec2-35-170-33-232.compute-1.amazonaws.com:4444 [ec2-35-170-33-232.compute-1.amazonaws.com/10.100.3.85] failed: connect timed out"
],
"warnings": [
],
"components": [
]
},
{
"status": "ERROR",
"name": "localhost:4444",
"errorCount": 1,
"warningCount": 0,
"errors": [
"Hub is not available: Connect to localhost:4444 [localhost/127.0.0.1] failed: Connection refused (Connection refused)"
],
"warnings": [
],
"components": [
]
}
]
}
The following script can be used to check whether all hubs registered in the quota are up and running. If SSL is not configured, use http instead of https.
$ cat ./check_hub.sh
#!/bin/bash
APPALL=`find /opt/workfusion/ -type d -name app-all -print`
CONF=$APPALL/environment.conf
source $CONF
QUOTA=${INSTALL_DIR}/apps/rpa_manager/grid-router/quota/${1}.xml
USERS=${INSTALL_DIR}/apps/rpa_manager/grid-router/users.properties
sed 's/\, /\:/' ${USERS} | grep ${1} | while IFS=":" read user password quota;
do
echo "user='$user' password='$password' quota='$quota'";
egrep 'host|port' ${QUOTA} | sort | uniq | sed 's/^ *.host name/\host/' | sed 's/\/>//' | tr -d '"' | tr ' ' '=' | awk -F= '{print $2":"$4":"$6}' | while IFS=":" read host port count;
do
echo "host='$host' port='$port' count='$count'";
timeout 3 curl -k -s --data "action=getListNodes" https://$user:$password@$host:$port/grid/admin/WFServlet | python -m json.tool 2>/dev/null | grep 'remoteHost';
if [[ $? -ne 0 ]]; then
echo -e "!!! --- HUB $host:$port is unavailable --- !!! \n"
else
nod_num=`timeout 2 curl -k -s --data "action=getListNodes" https://$user:$password@$host:$port/grid/admin/WFServlet | python -m json.tool | grep -c 'remoteHost';`
if [[ ${nod_num} == ${count} ]]; then
echo -e "All nodes are running on hub ${host} \n"
else
echo -e "${nod_num} node(s) are running. Please check other nodes on hub ${host} or adjust quota file and restart rpa_manager service. Should be ${count} node(s) \n"
fi
fi
done
done
Usage example (the first parameter is the name of the file from the quota or directory):
$ ./check_hub.sh users