Skip to content
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

Merged
merged 2 commits into from
May 12, 2021
Merged

Conversation

waldirio
Copy link
Contributor

@waldirio waldirio commented May 1, 2021

Hello,

This PR will cover issue #69 which is responsible for check the qpid and pulp queues.

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
Copy link

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 :)

Copy link
Contributor Author

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

check-pulp-msgs.sh Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@wbclark
Copy link
Collaborator

wbclark commented May 5, 2021

+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.

@waldirio waldirio marked this pull request as draft May 6, 2021 19:16
@waldirio waldirio marked this pull request as ready for review May 6, 2021 20:08
@waldirio
Copy link
Contributor Author

waldirio commented May 6, 2021

@ekohl Thank you for all your insights and ideas. I was working today with @wbclark, we did some follow up and also added a single push.

Please, let me know what you think, and thank you both again!!

teamwork++

check-pulp-msgs.sh Outdated Show resolved Hide resolved
@mccun934
Copy link
Contributor

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

@mccun934 mccun934 merged commit b9a4c35 into RedHatSatellite:master May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants