aboutsummaryrefslogtreecommitdiff
path: root/modules/role
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-07-12 08:21:21 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-07-12 08:51:02 +0200
commit96f8d0f037f8b8e93315e864bdaf661f45e3c472 (patch)
tree96b09b188872a5d48385da467ea4a5990aeb90b0 /modules/role
parent21d531ee2e4a5952673d694342ff01822581a1f8 (diff)
downloadPuppet-96f8d0f037f8b8e93315e864bdaf661f45e3c472.tar.gz
Puppet-96f8d0f037f8b8e93315e864bdaf661f45e3c472.tar.zst
Puppet-96f8d0f037f8b8e93315e864bdaf661f45e3c472.zip
Add monitoring for cryptoportfolio
Diffstat (limited to 'modules/role')
-rw-r--r--modules/role/manifests/cryptoportfolio/bot.pp18
-rw-r--r--modules/role/manifests/cryptoportfolio/front.pp12
2 files changed, 30 insertions, 0 deletions
diff --git a/modules/role/manifests/cryptoportfolio/bot.pp b/modules/role/manifests/cryptoportfolio/bot.pp
index 2f01c98..fd3ece3 100644
--- a/modules/role/manifests/cryptoportfolio/bot.pp
+++ b/modules/role/manifests/cryptoportfolio/bot.pp
@@ -81,6 +81,24 @@ class role::cryptoportfolio::bot inherits role::cryptoportfolio {
81 ], 81 ],
82 } 82 }
83 83
84 if ($environment == "production") {
85 $monitored_key = 3
86 @profile::monitoring::local_service { "Last redis report is less than 2 hours old":
87 local => {
88 check_command => "check_date!redis-cli -s $redis_host GET /cryptoportfolio/$monitored_key/latest/date!2"
89 }
90 }
91
92 @profile::monitoring::local_service { "Last bot report is less than one week old":
93 sudos => {
94 "naemon-cryptoportfolio-bot" => "naemon ALL=($user) NOPASSWD: /usr/bin/find $cf_bot_app_reports -mindepth 1 -maxdepth 1 -printf %T@?n",
95 },
96 local => {
97 check_command => "check_last_file_date!$cf_bot_app_reports!168!$user",
98 },
99 }
100 }
101
84 if versioncmp($trader_version, "v1.3") >= 0 { 102 if versioncmp($trader_version, "v1.3") >= 0 {
85 file { $cf_bot_app_conf_hourly: 103 file { $cf_bot_app_conf_hourly:
86 owner => $user, 104 owner => $user,
diff --git a/modules/role/manifests/cryptoportfolio/front.pp b/modules/role/manifests/cryptoportfolio/front.pp
index cf73a27..5f7c097 100644
--- a/modules/role/manifests/cryptoportfolio/front.pp
+++ b/modules/role/manifests/cryptoportfolio/front.pp
@@ -187,4 +187,16 @@ class role::cryptoportfolio::front inherits role::cryptoportfolio {
187 } 187 }
188 } 188 }
189 189
190 @profile::monitoring::external_service { "Cryptoportfolio website is running on $web_host":
191 type => "web",
192 master => {
193 check_command => "check_https!$web_host!/!<title>Cryptoportfolio"
194 }
195 }
196 @profile::monitoring::external_service { "$web_host ssl certificate is up to date":
197 type => "web",
198 master => {
199 check_command => "check_https_certificate!$web_host"
200 }
201 }
190} 202}