From 96f8d0f037f8b8e93315e864bdaf661f45e3c472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 12 Jul 2018 08:21:21 +0200 Subject: Add monitoring for cryptoportfolio --- modules/role/manifests/cryptoportfolio/bot.pp | 18 ++++++++++++++++++ modules/role/manifests/cryptoportfolio/front.pp | 12 ++++++++++++ 2 files changed, 30 insertions(+) (limited to 'modules/role') 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 { ], } + if ($environment == "production") { + $monitored_key = 3 + @profile::monitoring::local_service { "Last redis report is less than 2 hours old": + local => { + check_command => "check_date!redis-cli -s $redis_host GET /cryptoportfolio/$monitored_key/latest/date!2" + } + } + + @profile::monitoring::local_service { "Last bot report is less than one week old": + sudos => { + "naemon-cryptoportfolio-bot" => "naemon ALL=($user) NOPASSWD: /usr/bin/find $cf_bot_app_reports -mindepth 1 -maxdepth 1 -printf %T@?n", + }, + local => { + check_command => "check_last_file_date!$cf_bot_app_reports!168!$user", + }, + } + } + if versioncmp($trader_version, "v1.3") >= 0 { file { $cf_bot_app_conf_hourly: 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 { } } + @profile::monitoring::external_service { "Cryptoportfolio website is running on $web_host": + type => "web", + master => { + check_command => "check_https!$web_host!/!Cryptoportfolio" + } + } + @profile::monitoring::external_service { "$web_host ssl certificate is up to date": + type => "web", + master => { + check_command => "check_https_certificate!$web_host" + } + } } -- cgit v1.2.3