Ridiculous, but collectd exec plugins cannot accept arguments.
So we have to template our script and "hardcode" the process we want to monitor there.
This commit is contained in:
parent
b5f6044085
commit
21f6600811
4 changed files with 7 additions and 5 deletions
|
@ -63,6 +63,8 @@
|
|||
roles:
|
||||
- fedmsg/hub
|
||||
- notifs/backend
|
||||
- role: collectd/fedmsg-service
|
||||
process: fedmsg-hub
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
- name: Copy in /usr/local/bin/fedmsg-service-collectd
|
||||
copy: >
|
||||
src=fedmsg-service-collectd.py
|
||||
dest=/usr/local/bin/fedmsg-service-collectd
|
||||
template=fedmsg-service-collectd.py
|
||||
dest="/usr/local/bin/fedmsg-service-collectd-{{ process }}"
|
||||
mode=0755
|
||||
notify: restart collectd
|
||||
|
||||
- name: Copy in /etc/collectd.d/fedmsg-service.conf
|
||||
template: >
|
||||
src=fedmsg-service.conf
|
||||
dest=/etc/collectd.d/{{ process }}-conf
|
||||
dest=/etc/collectd.d/{{ process }}.conf
|
||||
notify: restart collectd
|
||||
|
|
|
@ -43,7 +43,7 @@ def print_producer(service, producer):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
service, = sys.argv[-1:]
|
||||
service = "{{ process }}"
|
||||
fname = '/var/run/fedmsg/monitoring-%s.socket' % service
|
||||
|
||||
if not os.path.exists(fname):
|
|
@ -1,4 +1,4 @@
|
|||
LoadPlugin exec
|
||||
<Plugin exec>
|
||||
Exec "{{ process }}" "/usr/local/bin/fedmsg-service-collectd {{ process }}"
|
||||
Exec "fedmsg" "/usr/local/bin/fedmsg-service-collectd-{{ process }}"
|
||||
</Plugin>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue