Skip to content

OscarDCorbalan/mikrotik-newrelic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mikrotik-newrelic

Summary:

What do you get?

Out of the box functionality with New Relic:

  • An entity is created for your each one of your router/s.
  • A default overview with charts for CPU, memory, throughput, ...
  • Metrics and tags attached to the entity, which can be used to query and further explore data.

Explorer

Entity Overview

Data Explorer

Instructions

  1. Create a New Relic account if not having one already.
  2. Follow the steps under Register an Insert API key in this documentatation:
  3. Login to your Mikrotik router:
    • Go to System > Scripts, click Add New.
      • Copy the content of newrelic-metrics.rsc in the Source field.
      • Set the Name and Policy fields as described in that file.
      • Paste your API Key as the nrApiKey value.
      • There are two metricsUrl variables, one of them commented out. One is for the US region and the other one is for the Europe region. Use the one that matches the region of your NR account.
      • Click OK to save it.
    • Go to System > Scheduler, click Add New.
      • Set Start Time to startup.
      • Set the Interval to 00:00:15, so that it runs and sends metrics every 15 seconds. You can always adjust it later to any value you prefer.
      • Click OK to save it.
    • Reboot your router -so that the startup hook is fired and the scheduler starts calling the script. Mikrotik scheduler
  4. After the script has run and sent data at least once, you can check if New Relic is getting the data:
    • Open the Data Explorer ("Query your data" button at top navigation).
    • Make sure you are in the Metrics tab.
    • Use the input to filter by mikrotik (as all data is dumped with that string at the start)

Debugging

Not seeing data in New Relic?

If you can't see the data in the Data Explorer, try to:

  1. In New Relic, go to Data Explorer => Events tab
    • Look for the NrIntegrationError table -if the API is receiving the POSTs and rejecting the data, you can see the reason there.
  2. Run the script manually in your router console
    • Login to the router's web GUI
    • Click Terminal at top right
    • Type system script run newrelic-metrics and press Enter.
    • It will run the script once -if there's a script error, or an HTTP error when sending the data, you can see it there.

Contributions are welcome :)

Either posting in the Issues tab or Opening PRs are very welcome.

Docs

About

Open source agent to send data from Mikrotik router to New Relic's Metrics API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published