Commit ae0a5355 by nadeemshahzad

changed log file location , added to logrotate and splunk source

parent 109716e9
...@@ -5,6 +5,7 @@ rabbitmq_app_dir: "{{ COMMON_APP_DIR }}/rabbitmq" ...@@ -5,6 +5,7 @@ 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"
......
#!/usr/bin/env bash #!/usr/bin/env bash
set -x set -x
log_directory={{ rabbitmq_log_dir }} log_file={{ rabbitmq_mem_log }}
{% 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)}'` memusg=`/usr/sbin/rabbitmqctl status | grep total | awk -F',|}' -v date="$(date)" 'NR==1{printf date"\tRabbitMQ Memory Usage:(MB) " $2/(1024 * 1024)}'`
mkdir -p $log_directory echo $memusg >> $log_file
echo $memusg >> "$log_directory/rabbitmq.memory.log" {% endraw %}
{% endraw %}
# 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_log_dir }}/*.log {{ rabbitmq_log_dir }}/*/*.log {{ rabbitmq_mem_log }}{
compress compress
dateext dateext
dateformat -%Y%m%d-%s 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