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': { '/usr/local/share/telegraf/cpu_frequency': {
'mode': '0755', 'mode': '0755',
'triggers': { '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: # for topic in LOGGING_TOPICS:
# routeros[f'/system/logging?action=memory&topics={topic}'] = {} # routeros[f'/system/logging?action=memory&topics={topic}'] = {}
routeros['/snmp'] = { # routeros['/snmp'] = {
'enabled': True, # 'enabled': True,
} # }
routeros['/snmp/community?name=public'] = { # routeros['/snmp/community?name=public'] = {
'addresses': '0.0.0.0/0', # 'addresses': '0.0.0.0/0',
'disabled': False, # 'disabled': False,
'read-access': True, # 'read-access': True,
'write-access': False, # 'write-access': False,
} # }
routeros['/system/clock'] = { routeros['/system/clock'] = {
'time-zone-autodetect': False, 'time-zone-autodetect': False,

View file

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

View file

@ -29,12 +29,11 @@ defaults = {
'collection_jitter': '0s', 'collection_jitter': '0s',
'flush_interval': '15s', 'flush_interval': '15s',
'flush_jitter': '0s', 'flush_jitter': '0s',
'interval': '1m', 'interval': '15s',
'metric_batch_size': 1000, 'metric_batch_size': 1000,
'metric_buffer_limit': 10000, 'metric_buffer_limit': 10000,
'omit_hostname': False, 'omit_hostname': False,
'round_interval': True, 'round_interval': True,
'skip_processors_after_aggregators': True,
}, },
'inputs': { 'inputs': {
'cpu': {h({ 'cpu': {h({
@ -72,13 +71,13 @@ defaults = {
'system': {h({})}, 'system': {h({})},
'net': {h({})}, 'net': {h({})},
'exec': { 'exec': {
# h({ h({
# 'commands': [ 'commands': [
# f'sudo /usr/local/share/telegraf/procio', f'sudo /usr/local/share/telegraf/procio',
# ], ],
# 'data_format': 'influx', 'data_format': 'influx',
# 'interval': '20s', 'interval': '20s',
# }), }),
h({ h({
'commands': [ 'commands': [
f'/usr/local/share/telegraf/pressure_stall', 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']: if type not in ['A', 'AAAA']:
return True 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: if ip_address(value).is_private:
return True return True
elif not list(filter( elif not list(filter(

View file

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

View file

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