summaryrefslogtreecommitdiffstats
path: root/krebs/1systems/wolf/config.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-09-10 01:32:53 +0200
committermakefu <github@syntax-fehler.de>2017-09-10 01:32:53 +0200
commit31b9df0a3b7828887ff9ee4eaddf12b26707c3bf (patch)
tree85109fde970dc117f74bd0fb10bc05c9e347d8b0 /krebs/1systems/wolf/config.nix
parentf82de12a9a235a97085b768848c97dd023285066 (diff)
wolf: add telegraf snmp
Diffstat (limited to 'krebs/1systems/wolf/config.nix')
-rw-r--r--krebs/1systems/wolf/config.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/krebs/1systems/wolf/config.nix b/krebs/1systems/wolf/config.nix
index 4796d26f..d89d0b0b 100644
--- a/krebs/1systems/wolf/config.nix
+++ b/krebs/1systems/wolf/config.nix
@@ -1,6 +1,7 @@
{ config, pkgs, ... }:
let
shack-ip = config.krebs.build.host.nets.shack.ip4.addr;
+ influx-host = "127.0.0.1";
in
{
imports = [
@@ -23,6 +24,58 @@ in
<stockholm/krebs/2configs/shack/muell_caller.nix>
<stockholm/krebs/2configs/shack/radioactive.nix>
<stockholm/krebs/2configs/shack/share.nix>
+ {
+ systemd.services.telegraf.path = [ pkgs.net_snmp ]; # for snmptranslate
+ #systemd.services.telegraf.environment = {
+ # "MIBDIRS" : ""; # extra mibs like ADSL
+ #};
+ services.telegraf = {
+ enable = true;
+ extraConfig = {
+ inputs = {
+ snmp = {
+ agents = [ "10.0.1.3:161" ];
+ version = 2;
+ community = "shack";
+ name = "snmp";
+ field = [
+ {
+ name = "hostname";
+ oid = "RFC1213-MIB::sysName.0";
+ is_tag = true;
+ }
+ {
+ name = "load-percent"; #cisco
+ oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.4.9";
+ }
+ {
+ name = "uptime";
+ oid = "DISMAN-EVENT-MIB::sysUpTimeInstance";
+ }
+ ];
+ table = [{
+ name = "snmp";
+ inherit_tags = [ "hostname" ];
+ oid = "IF-MIB::ifXTable";
+ field = [{
+ name = "ifName";
+ oid = "IF-MIB::ifName";
+ is_tag = true;
+ }];
+ }];
+ };
+ };
+ outputs = {
+ influxdb = {
+ urls = [ "http://${influx-host}:8086" ];
+ database = "telegraf";
+ write_consistency = "any";
+ timeout = "5s";
+ };
+ };
+ };
+ };
+ }
];
# use your own binary cache, fallback use cache.nixos.org (which is used by