Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
582f716a
Commit
582f716a
authored
Mar 01, 2017
by
Nadeem Shahzad
Committed by
GitHub
Mar 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3710 from edx/nadeem/rabbitmq-memory-alerting
rabbitmq memory alerting
parents
cc4a23c2
d65cb4ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
playbooks/roles/rabbitmq/tasks/main.yml
+14
-1
playbooks/roles/rabbitmq/templates/edx/app/rabbitmq/log-rabbitmq-memory.sh.j2
+10
-0
playbooks/roles/splunkforwarder/defaults/main.yml
+4
-0
No files found.
playbooks/roles/rabbitmq/tasks/main.yml
View file @
582f716a
...
@@ -52,11 +52,24 @@
...
@@ -52,11 +52,24 @@
group
:
"
{{
rabbitmq_group
}}"
group
:
"
{{
rabbitmq_group
}}"
mode
:
"
0755"
mode
:
"
0755"
-
name
:
Set up a cron job to run the script
-
name
:
Add RabbitMQ memory usage script
template
:
src
:
"
edx/app/rabbitmq/log-rabbitmq-memory.sh.j2"
dest
:
"
{{
rabbitmq_app_dir
}}/log-rabbitmq-memory.sh"
owner
:
"
{{
rabbitmq_user
}}"
group
:
"
{{
rabbitmq_group
}}"
mode
:
"
0775"
-
name
:
Set up a cron job to run queue script
cron
:
cron
:
name
:
"
log-queue-lenghts"
name
:
"
log-queue-lenghts"
job
:
"
{{
rabbitmq_app_dir
}}/log-rabbitmq-queues.sh
>/dev/null
2>&1"
job
:
"
{{
rabbitmq_app_dir
}}/log-rabbitmq-queues.sh
>/dev/null
2>&1"
-
name
:
Set up a cron job to run the script
cron
:
name
:
"
log-rabbitmq-memory-usage"
job
:
"
{{
rabbitmq_app_dir
}}/log-rabbitmq-memory.sh
>/dev/null
2>&1"
-
name
:
install logrotate configuration
-
name
:
install logrotate configuration
template
:
template
:
src
:
etc/logrotate.d/rabbitmq.j2
src
:
etc/logrotate.d/rabbitmq.j2
...
...
playbooks/roles/rabbitmq/templates/edx/app/rabbitmq/log-rabbitmq-memory.sh.j2
0 → 100644
View file @
582f716a
#!/usr/bin/env bash
set
-x
log_directory
={{
rabbitmq_log_dir
}}
{
% raw %
}
MemTotal
=
`
grep
'MemTotal'
/proc/meminfo | awk
'{print $2}'
`
memusg
=
`
/usr/sbin/rabbitmqctl status |
grep
total | awk
-F
',|}'
-v
date
=
"
$(
date
)
"
-v
MemTotal
=
"
$MemTotal
"
'NR==1{printf date"\tRabbitMQ Memory Usage:(%%)\t" ((($2/1024)/MemTotal)*100)}'
`
echo
$memusg
>>
"
$log_directory
/rabbitmq.memory.log"
{
% endraw %
}
playbooks/roles/splunkforwarder/defaults/main.yml
View file @
582f716a
...
@@ -72,6 +72,10 @@ SPLUNKFORWARDER_LOG_ITEMS:
...
@@ -72,6 +72,10 @@ SPLUNKFORWARDER_LOG_ITEMS:
recursive
:
true
recursive
:
true
index
:
'
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}'
index
:
'
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}'
sourcetype
:
'
nginx'
sourcetype
:
'
nginx'
-
source
:
'
{{
COMMON_LOG_DIR
}}/rabbitmq'
recursive
:
true
index
:
'
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}'
sourcetype
:
'
rabbitmq'
#
#
# OS packages
# OS packages
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment