2 # Result code: 1 (miss instances (and connections)), 2 (miss connections)
3 ADML_CONNECTIONS=`cat .st_conf_adml_connections 2>/dev/null`
4 ADML_INSTANCES=`cat .st_conf_adml_instances 2>/dev/null`
8 if [ -z "$ADML_CONNECTIONS" -o -z "$ADML_INSTANCES" ]
11 echo "Run './configure.sh' first !"
16 echo -n "Checking instances ... "
17 ADML_INSTANCES_ALIVE=$(pgrep "ADML-[0-9]" | wc -l)
18 echo -n "$ADML_INSTANCES_ALIVE instances alive"
19 if [ $ADML_INSTANCES_ALIVE -lt $ADML_INSTANCES ]
21 echo " ! (expected $ADML_INSTANCES configured)"
27 cmd="netstat -a | grep :diameter | grep ESTABLISHED | wc -l"
28 echo -n "Checking connections ... "
29 ADML_CONNECTIONS_ALIVE=$(eval $cmd)
30 ADML_TOTAL_CONNECTIONS=$((ADML_CONNECTIONS*ADML_INSTANCES))
31 echo -n "$ADML_CONNECTIONS_ALIVE connections established (using '$cmd')"
32 if [ $ADML_CONNECTIONS_ALIVE -ne $ADML_TOTAL_CONNECTIONS ]
34 echo " ! (expected $ADML_TOTAL_CONNECTIONS configured)"
35 [ $RESULT_CODE -ne 1 ] && RESULT_CODE=2