cURL and ping checks
diff --git a/README.rst b/README.rst
index bfc5299..96b4f97 100644
--- a/README.rst
+++ b/README.rst
@@ -81,6 +81,33 @@
- connected_devices
+Collecting the cURL response times and codes
+
+.. code-block:: yaml
+
+ collectd:
+ client:
+ check:
+ curl:
+ service1:
+ url: "https://service.domain.com:443/"
+ service2:
+ url: "https://service.domain.com:443/"
+
+
+Collecting the ping response times
+
+.. code-block:: yaml
+
+ collectd:
+ client:
+ check:
+ ping:
+ host_label1:
+ host: "172.10.31.14"
+ host_label2:
+ host: "172.10.31.12"
+
Read more
=========
diff --git a/collectd/files/collectd_curl.conf b/collectd/files/collectd_curl.conf
new file mode 100644
index 0000000..a0f97f9
--- /dev/null
+++ b/collectd/files/collectd_curl.conf
@@ -0,0 +1,11 @@
+LoadPlugin curl
+
+<Plugin curl>
+ {%- for data_name, data in plugin.data.iteritems() %}
+ <Page "{{ data_name }}">
+ URL "{{ data.url }}"
+ MeasureResponseTime true
+ MeasureResponseCode true
+ </Page>
+ {%- endfor %}
+</Plugin>
diff --git a/collectd/files/collectd_ping.conf b/collectd/files/collectd_ping.conf
new file mode 100644
index 0000000..1585deb
--- /dev/null
+++ b/collectd/files/collectd_ping.conf
@@ -0,0 +1,7 @@
+LoadPlugin ping
+
+{%- for data_name, data in plugin.data.iteritems() %}
+<Plugin "ping">
+ Host "{{ data_name }}"
+</Plugin>
+{%- endfor %}
diff --git a/collectd/meta/collectd.yml b/collectd/meta/collectd.yml
index b7b6b1a..20fd457 100644
--- a/collectd/meta/collectd.yml
+++ b/collectd/meta/collectd.yml
@@ -6,6 +6,20 @@
process:
collectdmon:
match: collectdmon
+{%- if pillar.collectd.client.get('check', {}).curl is defined %}
+ collectd_curl:
+ plugin: curl
+ interval: 60
+ template: collectd/files/collectd_curl.conf
+ data: {{ pillar.collectd.client.check.curl|yaml }}
+{%- endif %}
+{%- if pillar.collectd.client.get('check', {}).ping is defined %}
+ collectd_ping:
+ plugin: ping
+ interval: 60
+ template: collectd/files/collectd_ping.conf
+ data: {{ pillar.collectd.client.check.ping|yaml }}
+{%- endif %}
{%- if pillar.get('external', {}).network_device is defined %}
collectd_network_device:
plugin: snmp
@@ -27,4 +41,4 @@
- 1.3.6.1.2.1.31.1.1.1.7
- 1.3.6.1.2.1.31.1.1.1.11
host: {{ pillar.external.network_device }}
-{%- endif %}
\ No newline at end of file
+{%- endif %}