Skip to content
Snippets Groups Projects
Commit 221c697d authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-roles/netdata#28 Implement native fluentd monitoring to netdata

parent 7a17bd97
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,19 @@
notify:
- Restart NetData
- name: Configure Go Plugins
template:
src: '{{ item }}'
dest: /etc/netdata/go.d/{{ item }}
owner: netdata
group: netdata
mode: 0644
backup: yes
with_items:
- fluentd.conf
notify:
- Restart NetData
- name: Get a list of all health config files
shell: ls /usr/lib/netdata/conf.d/health.d/*.conf -1
register: health_list
......
......@@ -29,15 +29,6 @@
chdir: /opt/{{ netdata_local_archive|default('netdata') }}
when: netdata_clone.changed or netdata_extract.changed
- name: Install Custom Charts
template:
src: '{{ item }}.chart.sh'
dest: /usr/libexec/netdata/charts.d/{{ item }}.chart.sh
with_items:
- fluentd_buffer
notify:
- Restart NetData
- name: Install Custom Alerts
template:
src: health/{{ item }}.conf
......
jobs:
- name: local
url: http://127.0.0.1:24220
fluentd_buffer_update_every=5
fluentd_buffer_priority=12000
fluentd_buffer_value1=0
fluentd_buffer_last=0
fluentd_buffer_count=0
fluentd_buffer_get() {
fluentd_buffer_value1=$(find /var/log/td-agent/buffer -type f | wc -l)
return 0
}
fluentd_buffer_check() {
return 0
}
fluentd_buffer_create() {
cat <<EOF
CHART fluentd_buffer.files '' "Files in buffer" "files" fluentd fluentd.countfiles line $((fluentd_buffer_priority + 1)) $fluentd_buffer_update_every
DIMENSION countfiles '' absolute 1 1
EOF
return 0
}
fluentd_buffer_update() {
fluentd_buffer_get || return 1
cat <<VALUESEOF
BEGIN fluentd_buffer.files $1
SET countfiles = $fluentd_buffer_value1
END
VALUESEOF
return 0
}
alarm: fluentd_buffer_files
on: fluentd_buffer.files
alarm: fluentd_local.buffer_queue_length
on: fluentd_local.buffer_queue_length
os: linux
hosts: *
lookup: max -5s unaligned
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment