Browse Source

Merge "Add health check script for qdrouterd"

tags/11.2.0
Zuul 1 week ago
parent
commit
a3104d2a14
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      healthcheck/qdrouterd

+ 18
- 0
healthcheck/qdrouterd View File

@@ -0,0 +1,18 @@
1
+#!/bin/bash
2
+
3
+LISTENER_HOST=$(grep -m1 -A7 listener /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "host") print $2}')
4
+LISTENER_PORT=$(grep -m1 -A7 listener /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "port") print $2}')
5
+CONNECTION_URL=amqp://$LISTENER_HOST:$LISTENER_PORT
6
+
7
+SSLPROFILE=$(grep -m1 -A7 listener /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "sslProfile") print $2}')
8
+
9
+if [ -z "$SSLPROFILE" ]; then
10
+  SSLARGS=""
11
+else
12
+  CERTDB=$(grep -m1 -A5 "name: $SSLPROFILE" /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "certDb") print $2}')
13
+  CERT=$(grep -m1 -A5 "name: $SSLPROFILE" /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "certFile") print $2}')
14
+  KEY=$(grep -m1 -A5 "name: $SSLPROFILE" /etc/qpid-dispatch/qdrouterd.conf | awk -F: '/:/{gsub(/ /, "", $1); /:/gsub(/ /, "", $2); if ($1 == "keyFile") print $2}')
15
+  SSLARGS="--ssl-certificate=$CERT --ssl-key=$KEY --ssl-trustfile=$CERTDB"
16
+fi
17
+
18
+qdstat -c $SSLARGS -b $CONNECTION_URL

Loading…
Cancel
Save