Commit bacf12a4 by nadeemshahzad

logs rabbitmq mem. percent and save file to rabbitmq log dir

parent ae0a5355
......@@ -5,7 +5,6 @@ rabbitmq_app_dir: "{{ COMMON_APP_DIR }}/rabbitmq"
rabbitmq_data_dir: "{{ COMMON_DATA_DIR }}/rabbitmq"
rabbitmq_log_dir: "{{ COMMON_LOG_DIR }}/rabbitmq"
rabbitmq_cfg_dir: "{{ COMMON_CFG_DIR }}/rabbitmq"
rabbitmq_mem_log: "{{ COMMON_LOG_DIR }}/rabbitmq.memory.log"
rabbitmq_user: "rabbitmq"
rabbitmq_group: "rabbitmq"
......
#!/usr/bin/env bash
set -x
log_file={{ rabbitmq_mem_log }}
log_directory={{ rabbitmq_log_dir }}
{% raw %}
memusg=`/usr/sbin/rabbitmqctl status | grep total | awk -F',|}' -v date="$(date)" 'NR==1{printf date"\tRabbitMQ Memory Usage:(MB) " $2/(1024 * 1024)}'`
echo $memusg >> $log_file
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 %}
# We want to hit the top level queues and any vhost queues
# 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
dateext
dateformat -%Y%m%d-%s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment