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
edx
configuration
Commits
bacf12a4
Commit
bacf12a4
authored
Mar 01, 2017
by
nadeemshahzad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logs rabbitmq mem. percent and save file to rabbitmq log dir
parent
ae0a5355
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
playbooks/roles/rabbitmq/defaults/main.yml
+0
-1
playbooks/roles/rabbitmq/templates/edx/app/rabbitmq/log-rabbitmq-memory.sh.j2
+4
-3
playbooks/roles/rabbitmq/templates/etc/logrotate.d/rabbitmq.j2
+1
-1
No files found.
playbooks/roles/rabbitmq/defaults/main.yml
View file @
bacf12a4
...
@@ -5,7 +5,6 @@ rabbitmq_app_dir: "{{ COMMON_APP_DIR }}/rabbitmq"
...
@@ -5,7 +5,6 @@ rabbitmq_app_dir: "{{ COMMON_APP_DIR }}/rabbitmq"
rabbitmq_data_dir
:
"
{{
COMMON_DATA_DIR
}}/rabbitmq"
rabbitmq_data_dir
:
"
{{
COMMON_DATA_DIR
}}/rabbitmq"
rabbitmq_log_dir
:
"
{{
COMMON_LOG_DIR
}}/rabbitmq"
rabbitmq_log_dir
:
"
{{
COMMON_LOG_DIR
}}/rabbitmq"
rabbitmq_cfg_dir
:
"
{{
COMMON_CFG_DIR
}}/rabbitmq"
rabbitmq_cfg_dir
:
"
{{
COMMON_CFG_DIR
}}/rabbitmq"
rabbitmq_mem_log
:
"
{{
COMMON_LOG_DIR
}}/rabbitmq.memory.log"
rabbitmq_user
:
"
rabbitmq"
rabbitmq_user
:
"
rabbitmq"
rabbitmq_group
:
"
rabbitmq"
rabbitmq_group
:
"
rabbitmq"
...
...
playbooks/roles/rabbitmq/templates/edx/app/rabbitmq/log-rabbitmq-memory.sh.j2
View file @
bacf12a4
#!/usr/bin/env bash
#!/usr/bin/env bash
set
-x
set
-x
log_
file
={{
rabbitmq_mem_log
}}
log_
directory
={{
rabbitmq_log_dir
}}
{
% raw %
}
{
% raw %
}
memusg
=
`
/usr/sbin/rabbitmqctl status |
grep
total | awk
-F
',|}'
-v
date
=
"
$(
date
)
"
'NR==1{printf date"\tRabbitMQ Memory Usage:(MB) " $2/(1024 * 1024)}'
`
MemTotal
=
`
grep
'MemTotal'
/proc/meminfo | awk
'{print $2}'
`
echo
$memusg
>>
$log_file
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 %
}
{
% endraw %
}
playbooks/roles/rabbitmq/templates/etc/logrotate.d/rabbitmq.j2
View file @
bacf12a4
# We want to hit the top level queues and any vhost queues
# We want to hit the top level queues and any vhost queues
# such as notifier and fulfillment
# such as notifier and fulfillment
{{ rabbitmq_log_dir }}/*.log {{ rabbitmq_log_dir }}/*/*.log {
{ rabbitmq_mem_log }}{
{{ rabbitmq_log_dir }}/*.log {{ rabbitmq_log_dir }}/*/*.log {
compress
compress
dateext
dateext
dateformat -%Y%m%d-%s
dateformat -%Y%m%d-%s
...
...
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