remove snmp

This commit is contained in:
Motiejus Jakštys 2024-05-30 17:14:44 +03:00
parent 632ab34bc6
commit 178aa66a03
6 changed files with 0 additions and 5752 deletions

View File

@ -174,7 +174,6 @@
tailscale.enable = true;
node_exporter.enable = true;
gitea.enable = true;
snmp_exporter.enable = true;
sshguard.enable = true;
hass.enable = true;
@ -516,41 +515,6 @@
job_name = "vno1-vinc.vincentas.jakst";
static_configs = [{targets = ["${myData.hosts."vno1-vinc.vincentas.jakst".jakstIP}:9100"];}];
}
{
job_name = "snmp_exporter";
static_configs = [{targets = ["127.0.0.1:9116"];}];
}
{
job_name = "snmp-mikrotik";
static_configs = [
{
targets = [
"192.168.189.2" # kids
"192.168.189.3" # livingroom
"192.168.189.4" # commbox
];
}
];
metrics_path = "./snmp";
params = {
auth = ["public_v2"];
module = ["mikrotik"];
};
relabel_configs = [
{
source_labels = ["__address__"];
target_label = "__param_target";
}
{
source_labels = ["__param_target"];
target_label = "instance";
}
{
target_label = "__address__";
replacement = "127.0.0.1:9116";
}
];
}
];
};

View File

@ -12,7 +12,6 @@
./nsd-acme
./postfix
./remote-builder
./snmp_exporter
./sshguard
./syncthing
./tailscale

View File

@ -1,8 +0,0 @@
How to upgrade snmp.yml
1. Extend generator.yml from the upstream generator.yml in snmp_exporter/generator/generator.yml
2. Generate snmp.yml:
snmp_exporter/generator$ make mibs
packages/snmp-yaml $ MIBDIRS=$HOME/code/snmp_exporter/generator/mibs /nix/store/wmymig1r9jfiaffbdpv1lyaj32rydbzc-snmp_exporter-0.21.0/bin/generator generate

View File

@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
myData,
...
}: {
options.mj.services.snmp_exporter = with lib.types; {
enable = lib.mkEnableOption "Enable prometheus snmp_exporter";
};
config = lib.mkIf config.mj.services.snmp_exporter.enable {
mj.services.friendlyport.ports = [
{
subnets = [myData.subnets.tailscale.cidr];
tcp = [config.services.prometheus.exporters.snmp.port];
}
];
services.prometheus.exporters.snmp = {
enable = true;
configurationPath = pkgs.concatTextFile {
name = "snmp.yml";
files = [./snmp.yml];
};
};
};
}

View File

@ -1,50 +0,0 @@
modules:
# Default IF-MIB interfaces table with ifIndex.
if_mib:
walk: [sysUpTime, interfaces, ifXTable]
lookups:
- source_indexes: [ifIndex]
lookup: ifAlias
- source_indexes: [ifIndex]
# Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
- source_indexes: [ifIndex]
# Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
overrides:
ifAlias:
ignore: true # Lookup metric
ifDescr:
ignore: true # Lookup metric
ifName:
ignore: true # Lookup metric
ifType:
type: EnumAsInfo
# Mikrotik Router
#
# http://download2.mikrotik.com/Mikrotik.mib
mikrotik:
walk:
- interfaces
- ifMIB
- laIndex
- sysUpTime
- sysDescr
- host
- mikrotik
lookups:
- source_indexes: [ifIndex]
lookup: ifName
- source_indexes: [mtxrInterfaceStatsIndex]
lookup: ifName
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
- source_indexes: [laIndex]
lookup: laNames
drop_source_indexes: true
overrides:
ifName:
ignore: true # Lookup metric
ifType:
type: EnumAsInfo

File diff suppressed because it is too large Load Diff