Netdata + SNMP + Mikrotik



Always wanted to see my Internet line usage as a gauge without having to log into the router.
So today I configured SNMP in Netdata to collect from my Mikrotik router.

/etc/netdata/node.d/snmp.conf:

{
"enable_autodetect": false,
"update_every": 5,
"max_request_size": 100,
"servers": [
{
"hostname": "10.1.1.1",
"community": "public",
"update_every": 5,
"max_request_size": 50,
"options": { "timeout": 20 },
"charts": {
"mikrotik1.cpu": {
"title": "CPU ",
"units": "percentage",
"type": "line",
"family": "cpu",
"dimensions": {
"used": {
"oid": "1.3.6.1.2.1.25.3.3.1.2.1",
"algorithm": "absolute"
}
}
},
"mikrotik1.memory": {
"title": "Memory ",
"units": "Mb",
"type": "line",
"family": "memory",
"dimensions": {
"total": {
"oid": "1.3.6.1.2.1.25.2.3.1.5.65536",
"algorithm": "absolute",
"multiplier": 1,
"divisor": 1,
"offset": 0
},
"used": {
"oid": "1.3.6.1.2.1.25.2.3.1.6.65536",
"algorithm": "absolute",
"multiplier": 1,
"divisor": 1,
"offset": 0
}
}
},
"mikrotik1.port": {
"title": "Bandwidth for port ",
"titleoid": "1.3.6.1.2.1.2.2.1.2.",
"units": "kilobits/s",
"type": "area",
"priority": 1,
"family": "ports",
"multiply_range": [ 1, 7 ],
"dimensions": {
"in": {
"oid": "1.3.6.1.2.1.2.2.1.10.",
"algorithm": "incremental",
"multiplier": 8,
"divisor": 1024,
"offset": 0
},
"out": {
"oid": "1.3.6.1.2.1.2.2.1.16.",
"algorithm": "incremental",
"multiplier": -8,
"divisor": 1024,
"offset": 0
}
}
}
}
]
}

And then a simple HTML page to show the data as a gauge:



   
            data-dimensions="in"
            data-chart-library="gauge"
            data-width="300px"
            data-title="Download"
            data-units="Kbps"
            data-colors="#55ff55"
            data-common-units="mikrotik1.ports"
            >

   
            data-dimensions="out"
            data-chart-library="gauge"
            data-width="300px"
            data-title="Upload"
            data-units="Kbps"
            data-colors="#FF5555"
            data-common-units="mikrotik1.ports"
            >

   

Comments