Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoilomora/8c78398b35fddd54999307825d6c29ab to your computer and use it in GitHub Desktop.
Save zoilomora/8c78398b35fddd54999307825d6c29ab to your computer and use it in GitHub Desktop.
Temperature and Voltage from MikroTik Router by Telegraf

Temperature and Voltage from MikroTik Router by Telegraf

Telegraf is a highly modular software provided by InfluxData that allows us to configure numerous Inputs and Outputs to collect any information.

In this case I have done the tests with my MikroTik hEX S router.

Mikrotik provides you with a MIB file with the OID addresses of its Routers.

Configure Telegraf

Create a file in /etc/telegraf/telegraf.d/ with extension .conf with the following content:

[[inputs.snmp]]
  agents = [ "192.168.88.1:161" ] # Replace this with your router(s) IP/port
  interval = "60s"
  version = 1
  community = "public"
  name_override = "mikrotik"

  # System Health
  [[inputs.snmp.field]]
    name = "voltage"
    oid = ".1.3.6.1.4.1.14988.1.1.3.8.0"

  [[inputs.snmp.field]]
    name = "temperature"
    oid = ".1.3.6.1.4.1.14988.1.1.3.10.0"

Remember to restart the Telegraf process for the changes to take effect.

Note: The values will have to be divided by 10 to obtain ºC and V

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment