l 2 monitoring server: use new kapacitor config
This commit is contained in:
parent
2b68541e29
commit
f39df4913b
|
@ -22,6 +22,7 @@ with import <stockholm/lib>;
|
|||
|
||||
lass.kapacitor =
|
||||
let
|
||||
db = "telegraf_db";
|
||||
echoToIrc = pkgs.writeDash "echo_irc" ''
|
||||
set -euf
|
||||
data="$(${pkgs.jq}/bin/jq -r .message)"
|
||||
|
@ -31,13 +32,14 @@ with import <stockholm/lib>;
|
|||
'';
|
||||
in {
|
||||
enable = true;
|
||||
check_db = "telegraf_db";
|
||||
alarms = {
|
||||
cpu = ''
|
||||
cpu = {
|
||||
database = db;
|
||||
text = ''
|
||||
var data = batch
|
||||
|query(${"'''"}
|
||||
SELECT mean("usage_user") AS mean
|
||||
FROM "${config.lass.kapacitor.check_db}"."default"."cpu"
|
||||
FROM "${db}"."default"."cpu"
|
||||
${"'''"})
|
||||
.period(10m)
|
||||
.every(1m)
|
||||
|
@ -49,11 +51,14 @@ with import <stockholm/lib>;
|
|||
.stateChangesOnly()
|
||||
.exec('${echoToIrc}')
|
||||
'';
|
||||
ram = ''
|
||||
};
|
||||
ram = {
|
||||
database = db;
|
||||
text = ''
|
||||
var data = batch
|
||||
|query(${"'''"}
|
||||
SELECT mean("used_percent") AS mean
|
||||
FROM "${config.lass.kapacitor.check_db}"."default"."mem"
|
||||
FROM "${db}"."default"."mem"
|
||||
${"'''"})
|
||||
.period(10m)
|
||||
.every(1m)
|
||||
|
@ -64,6 +69,7 @@ with import <stockholm/lib>;
|
|||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
krebs.iptables.tables.filter.INPUT.rules = [
|
||||
{ predicate = "-p tcp -i retiolum --dport 8086"; target = "ACCEPT"; }
|
||||
|
|
Loading…
Reference in a new issue