Compare commits

..

No commits in common. "c1d9f231b190cbcb86e23fb460e62a03792586f9" and "8066efb923d59aa05adf1fc288bbb6c9bcd7bf06" have entirely different histories.

10 changed files with 22 additions and 4368 deletions

View file

@ -2,7 +2,7 @@ files = {
'/usr/local/share/telegraf/cpu_frequency': {
'mode': '0755',
'triggers': {
'svc_systemd:telegraf.service:restart',
'svc_systemd:telegraf:restart',
},
},
}

View file

@ -1,10 +0,0 @@
files = {
# https://mikrotik.com/download/tools
'/usr/share/snmp/mibs/MIKROTIK-MIB.txt': {
'source': 'mikrotik.mib',
'mode': '0644',
'needed_by': {
'svc_systemd:telegraf.service',
},
},
}

View file

@ -1,143 +0,0 @@
h = repo.libs.hashable.hashable
defaults = {
'apt': {
'packages': {
'snmp': {},
'snmp-mibs-downloader': {},
},
},
}
@metadata_reactor.provides(
'telegraf/config/inputs/snmp',
)
def routeros_monitoring_telegraf_inputs(metadata):
return {
"telegraf": {
"config": {
"inputs": {
"snmp": [
{
"agents": [f"udp://{routeros_node.hostname}:161"],
"version": 2,
"community": "public",
"interval": "30s",
"tags": {
"host": routeros_node.name,
"operating_system": "routeros",
},
# scalar -> input-level
"field": [
{
"name": "switch_name",
"oid": "SNMPv2-MIB::sysName.0",
"is_tag": True,
},
],
"table": [
# Interface statistics
{
"name": "interface",
"oid": "IF-MIB::ifTable",
"field": [
# Labels (optional but recommended)
{
"name": "ifName",
"oid": "IF-MIB::ifName",
"is_tag": True,
},
{
"name": "ifAlias",
"oid": "IF-MIB::ifAlias",
"is_tag": True,
},
# Bytes (64-bit)
{
"name": "in_octets",
"oid": "IF-MIB::ifHCInOctets",
},
{
"name": "out_octets",
"oid": "IF-MIB::ifHCOutOctets",
},
# Packets (64-bit unicast)
{
"name": "in_ucast_pkts",
"oid": "IF-MIB::ifHCInUcastPkts",
},
{
"name": "out_ucast_pkts",
"oid": "IF-MIB::ifHCOutUcastPkts",
},
# Drops / Errors
{
"name": "in_discards",
"oid": "IF-MIB::ifInDiscards",
},
{
"name": "out_discards",
"oid": "IF-MIB::ifOutDiscards",
},
{
"name": "in_errors",
"oid": "IF-MIB::ifInErrors",
},
{
"name": "out_errors",
"oid": "IF-MIB::ifOutErrors",
},
],
},
# PoE
{
"name": "poe",
"oid": "MIKROTIK-MIB::mtxrPOETable",
"field": [
{
"name": "ifName",
"oid": "IF-MIB::ifName",
"is_tag": True,
},
{
"name": "ifAlias",
"oid": "IF-MIB::ifAlias",
"is_tag": True,
},
{
"name": "poe_ifindex",
"oid": "MIKROTIK-MIB::mtxrPOEInterfaceIndex",
"is_tag": True,
},
{
"name": "poe_status",
"oid": "MIKROTIK-MIB::mtxrPOEStatus",
},
{
"name": "poe_voltage",
"oid": "MIKROTIK-MIB::mtxrPOEVoltage",
},
{
"name": "poe_current",
"oid": "MIKROTIK-MIB::mtxrPOECurrent",
},
{
"name": "poe_power",
"oid": "MIKROTIK-MIB::mtxrPOEPower",
},
],
},
],
}
for routeros_node in repo.nodes_in_group("routeros")
]
}
}
}
}

View file

@ -27,15 +27,15 @@ routeros['/system/identity'] = {
# for topic in LOGGING_TOPICS:
# routeros[f'/system/logging?action=memory&topics={topic}'] = {}
routeros['/snmp'] = {
'enabled': True,
}
routeros['/snmp/community?name=public'] = {
'addresses': '0.0.0.0/0',
'disabled': False,
'read-access': True,
'write-access': False,
}
# routeros['/snmp'] = {
# 'enabled': True,
# }
# routeros['/snmp/community?name=public'] = {
# 'addresses': '0.0.0.0/0',
# 'disabled': False,
# 'read-access': True,
# 'write-access': False,
# }
routeros['/system/clock'] = {
'time-zone-autodetect': False,

View file

@ -12,7 +12,7 @@ files = {
sort_keys=True,
),
'triggers': [
'svc_systemd:telegraf.service:restart',
'svc_systemd:telegraf:restart',
],
},
'/usr/local/share/telegraf/procio': {
@ -27,7 +27,7 @@ files = {
},
}
svc_systemd['telegraf.service'] = {
svc_systemd['telegraf'] = {
'needs': [
'file:/etc/telegraf/telegraf.conf',
'pkg_apt:telegraf',

View file

@ -29,12 +29,11 @@ defaults = {
'collection_jitter': '0s',
'flush_interval': '15s',
'flush_jitter': '0s',
'interval': '1m',
'interval': '15s',
'metric_batch_size': 1000,
'metric_buffer_limit': 10000,
'omit_hostname': False,
'round_interval': True,
'skip_processors_after_aggregators': True,
},
'inputs': {
'cpu': {h({
@ -72,13 +71,13 @@ defaults = {
'system': {h({})},
'net': {h({})},
'exec': {
# h({
# 'commands': [
# f'sudo /usr/local/share/telegraf/procio',
# ],
# 'data_format': 'influx',
# 'interval': '20s',
# }),
h({
'commands': [
f'sudo /usr/local/share/telegraf/procio',
],
'data_format': 'influx',
'interval': '20s',
}),
h({
'commands': [
f'/usr/local/share/telegraf/pressure_stall',

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ def record_matches_view(value, type, name, zone, view, metadata):
if type not in ['A', 'AAAA']:
return True
if metadata.get(f'bind/views/{view}/is_internal'):
if metadata.get(f'bind/views/{view}/is_internal'):
if ip_address(value).is_private:
return True
elif not list(filter(

View file

@ -33,7 +33,6 @@
'raspberrymatic-cert',
'wol-waker',
'zfs',
'routeros-monitoring',
],
'metadata': {
'id': 'af96709e-b13f-4965-a588-ef2cd476437a',

View file

@ -70,7 +70,7 @@
},
'tick60_maps': {
'port': 27019,
'arguments': ['-tickrate 60'],
'arguments': ['-tickrate 100'],
'overlays': ['tickrate', 'vanilla', 'workshop_maps'],
'config': [
'exec server_tickrate.cfg',