-
Notifications
You must be signed in to change notification settings - Fork 65
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
Updates to process_mon.sh and ubuntu_updates_check.sh #161
base: master
Are you sure you want to change the base?
Conversation
process_mon.sh
Outdated
@@ -64,4 +68,12 @@ if [ -z "$1" ]; then | |||
fi | |||
|
|||
process_check=`ps ax | grep -v grep | grep -v process_mon | grep -c "$1"` | |||
if (( $process_check > 0 )); then | |||
process_age=`ps -o etimes= -p "$process_check"` |
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.
Since $process_check
will contain either 0 or 1 from the grep -c
this doesn't seem to grab the etimes
from the intended pid.
Oops thought it was getting a PID. Let me try again |
ubuntu_updates_check.sh
Outdated
PENDING_OTHER=$(echo "${OUTPUT}" | cut -d ";" -f 1) | ||
PENDING_SECURITY=$(echo "${OUTPUT}" | cut -d ";" -f 2) | ||
PENDING_OTHER=$(echo "${OUTPUT}" | grep -v "Listing..." | grep -v "/$(lsb_release -cs)-security" | wc -l) | ||
PENDING_SECURITY=$(echo "${OUTPUT}" | grep -v "Listing..." | grep "/$(lsb_release -cs)-security" | wc -l) |
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.
I did a quick test and noticed that some packages on my system are available via both channels, so the pattern here needs to match a leading slash or comma in order to match:
ruby1.9.1-dev/trusty-updates,trusty-security 1.9.3.484-2ubuntu1.13 amd64 [upgradable from: 1.9.3.484-2ubuntu1.7]
* /usr/lib/update-notifier/apt-check was not returning a count of upgradeable packages on various machines even though you could see packages available for update via `apt-get update` * Replace with `apt list --upgradeable` and parse out the count of upgradeable security and non-security package updates available
Updates to process_mon.sh
Add an additional metric
process_age
to theprocess_mon.sh
script. This will allow you to raise an alarm if a process has been running for too long.Updates to ubuntu_update_check.sh
/usr/lib/update-notifier/apt-check
was not returning a count of upgradeable packages on various machines even though you could see packages available for update viaapt-get upgrade
apt list --upgradeable
and parse out the count of upgradeable security and non-security package updates available