[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-cloud/master] monitor: Monitor OnionPerf instances



commit f9fac2635993409c3f75931651dc72c1d0184dd7
Author: Iain R. Learmonth <irl@xxxxxxxx>
Date:   Thu Oct 3 11:33:57 2019 +0100

    monitor: Monitor OnionPerf instances
---
 ansible/monitors.yml                              |  2 +-
 ansible/roles/metrics-monitor/files/collector.cfg | 21 +-----
 ansible/roles/metrics-monitor/files/common.cfg    | 18 +++++
 ansible/roles/metrics-monitor/files/onionperf.cfg | 82 +++++++++++++++++++++++
 4 files changed, 103 insertions(+), 20 deletions(-)

diff --git a/ansible/monitors.yml b/ansible/monitors.yml
index 8bca27f..519c6a6 100644
--- a/ansible/monitors.yml
+++ b/ansible/monitors.yml
@@ -34,7 +34,7 @@
       - rsync
   - name: copy nagios configuration
     synchronize:
-      src: conf.d/
+      src: roles/metrics-monitor/files/
       dest: /etc/nagios4/conf.d
       delete: yes
       recursive: yes
diff --git a/ansible/roles/metrics-monitor/files/collector.cfg b/ansible/roles/metrics-monitor/files/collector.cfg
index ec046d3..2878301 100644
--- a/ansible/roles/metrics-monitor/files/collector.cfg
+++ b/ansible/roles/metrics-monitor/files/collector.cfg
@@ -4,6 +4,7 @@ define host{
 	alias		Primary CollecTor instance
 	address		collector.torproject.org
 	hostgroups	collectors,collector-bridgedescs,collector-archives
+	check_command	check_http
 	}
 
 define host{
@@ -12,6 +13,7 @@ define host{
 	alias		Secondary CollecTor instance
 	address		collector2.torproject.org
 	hostgroups	collectors
+	check_command	check_http
 	}
 
 define hostgroup{
@@ -32,25 +34,6 @@ define hostgroup{
 define service{
 	use			generic-service
 	hostgroup_name		collectors
-	service_description	ICMPv4 Echo
-	check_command		check_ping_4!200.0,20%!600.0,60%	; The command used to monitor the service
-	check_interval	5		; Check the service every 5 minutes under normal conditions
-	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
-	}
-
-# AWS doesn't have IPv6
-#define service{
-#	use			generic-service
-#	hostgroup_name		collectors
-#	service_description	ICMPv6 Echo
-#	check_command		check_ping!200.0,20%!600.0,60% -6	; The command used to monitor the service
-#	check_interval	5		; Check the service every 5 minutes under normal conditions
-#	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
-#	}
-
-define service{
-	use			generic-service
-	hostgroup_name		collectors
 	service_description	HTTP Redirect
 	check_command		check_http_redirect
 	check_interval	5		; Check the service every 5 minutes under normal conditions
diff --git a/ansible/roles/metrics-monitor/files/common.cfg b/ansible/roles/metrics-monitor/files/common.cfg
new file mode 100644
index 0000000..9d4ee0b
--- /dev/null
+++ b/ansible/roles/metrics-monitor/files/common.cfg
@@ -0,0 +1,18 @@
+define service{
+	use			generic-service
+	hostgroup_name		collectors,onionperfs
+	service_description	ICMPv4 Echo
+	check_command		check_ping_4!200.0,20%!600.0,60%	; The command used to monitor the service
+	check_interval	5		; Check the service every 5 minutes under normal conditions
+	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
+	}
+
+# AWS doesn't have IPv6
+#define service{
+#	use			generic-service
+#	hostgroup_name		collectors
+#	service_description	ICMPv6 Echo
+#	check_command		check_ping!200.0,20%!600.0,60% -6	; The command used to monitor the service
+#	check_interval	5		; Check the service every 5 minutes under normal conditions
+#	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
+#	}
diff --git a/ansible/roles/metrics-monitor/files/onionperf.cfg b/ansible/roles/metrics-monitor/files/onionperf.cfg
new file mode 100644
index 0000000..40d9ff5
--- /dev/null
+++ b/ansible/roles/metrics-monitor/files/onionperf.cfg
@@ -0,0 +1,82 @@
+define host{
+	use		linux-server
+	host_name	op-ab.onionperf.torproject.net
+	alias		OnionPerf Scotland
+	address		op-ab.onionperf.torproject.net
+	hostgroups	onionperfs,onionperfs-newport
+	}
+
+define host{
+	use		linux-server
+	host_name	op-us.onionperf.torproject.net
+	alias		OnionPerf US East
+	address		op-us.onionperf.torproject.net
+	hostgroups	onionperfs,onionperfs-oldport
+	}
+
+define host{
+	use		linux-server
+	host_name	op-nl.onionperf.torproject.net
+	alias		OnionPerf Netherlands
+	address		op-nl.onionperf.torproject.net
+	hostgroups	onionperfs,onionperfs-oldport
+	}
+
+define host{
+	use		linux-server
+	host_name	op-hk.onionperf.torproject.net
+	alias		OnionPerf Hong Kong
+	address		op-hk.onionperf.torproject.net
+	hostgroups	onionperfs,onionperfs-oldport
+	}
+
+define hostgroup{
+	hostgroup_name	onionperfs
+	alias		OnionPerf Instances
+	}
+
+define hostgroup{
+	hostgroup_name	onionperfs-oldport
+	alias		OnionPerf Instances Old Ports
+	}
+
+define hostgroup{
+	hostgroup_name	onionperfs-newport
+	alias		OnionPerf Instances New Ports
+	}
+
+define service{
+	use			generic-service
+	hostgroup_name		onionperfs-oldport
+	service_description	Root index page
+	check_command		check_https_url_content!/!Directory listing for
+	check_interval	15		; Check the service every 5 minutes under normal conditions
+	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
+	}
+
+define service{
+	use			generic-service
+	hostgroup_name		onionperfs-newport
+	service_description	Root index page
+	check_command		check_https_url_content_port!/!Directory listing for!8443
+	check_interval	15		; Check the service every 5 minutes under normal conditions
+	retry_interval	1		; Re-check the service every minute until its final/hard state is determined
+	}
+
+define service {
+	use	generic-service
+	hostgroup_name onionperfs-oldport
+	service_description HTTPS Cert Expiry
+	check_command	check_https_cert_expiry!443
+	check_interval 30
+	retry_interval 30
+}
+
+define service {
+	use	generic-service
+	hostgroup_name onionperfs-newport
+	service_description HTTPS Cert Expiry
+	check_command	check_https_cert_expiry!8443
+	check_interval 30
+	retry_interval 30
+}

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits