-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qpid and Pulp live check #70
Conversation
check-pulp-msgs.sh
Outdated
while : | ||
do | ||
date | tee -a $LOG | ||
qpid-stat --ssl-certificate=$CERT -b amqps://localhost:5671 -q | grep -E "(resource_manager.*$SRV_FQDN.*|^ queu|^ =|resource_worker.*$SRV_FQDN.*|resource_manager )" | tee -a $LOG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can consider making this a separate function:
qpid_stat() {
qpid-stat --ssl-certificate=$CERT -b amqps://localhost:5671 -q | grep -E "(resource_manager.*$SRV_FQDN.*|^ queu|^ =|resource_worker.*$SRV_FQDN.*|resource_manager )"
}
Then in check_with_log
you can run qpid_stat | tee -a $LOG
and in without.
Another option is to write a log function:
#!/bin/bash
LOG=/tmp/log
write_log() {
if [[ $LOG_OUTPUT == "Y" ]] ; then
tee -a $LOG
else
cat
fi
}
echo date | write_log
This then works:
$ ./test.sh
Wed 5 May 09:33:39 CEST 2021
$ LOG_OUTPUT=Y ./test.sh
Wed 5 May 09:33:46 CEST 2021
$ cat /tmp/log
Wed 5 May 09:33:46 CEST 2021
I think the latter is the cleanest result since you'll end up with just check()
and write_log()
. You may be able to find a better name than write_log
, but it's about the principle :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ehokl,
Thanks for the heads up and yea, I agree with you.
Changes applied and also I added something new that I believe to be interesting.
Thank you again.
Waldirio
+1 to the idea of linking to a single KCS. The KCS can include instructions to download and run this script, basic instructions for how to interpret the output, and link to any BZs which are related. IMO this script should link to the KCS only, but not the specific BZ. The KCS itself should be the authority on which root causes are possible or likely for the symptoms you might see here. |
tried this on my Satellite and it worked great. I've been doing this by hand forever, nice to have this in a single script |
Hello,
This PR will cover issue #69 which is responsible for check the qpid and pulp queues.