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`
7 echo -n "Checking instances ... "
8 ADML_INSTANCES_ALIVE=$(pgrep ADML- | wc -l)
9 echo -n "$ADML_INSTANCES_ALIVE instances alive"
10 if [ $ADML_INSTANCES_ALIVE -ne $ADML_INSTANCES ]
12 echo " ! (expected $ADML_INSTANCES configured)"
18 echo -n "Checking connections ... "
19 ADML_CONNECTIONS_ALIVE=$(netstat -a | grep :diameter | grep ESTABLISHED | wc -l)
20 ADML_TOTAL_CONNECTIONS=$((ADML_CONNECTIONS*ADML_INSTANCES))
21 echo -n "$ADML_CONNECTIONS_ALIVE connections established"
22 if [ $ADML_CONNECTIONS_ALIVE -ne $ADML_TOTAL_CONNECTIONS ]
24 echo " ! (expected $ADML_TOTAL_CONNECTIONS configured)"
25 [ $RESULT_CODE -ne 1 ] && RESULT_CODE=2