Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Is it possible to define an alert condition based on the contents of a file?

alertconditions

#1

I’d really like to be able to define an alert condition based on the contents of a file on the monitored host.

So for instance if c:\somedir\somefile.txt contains the string help me then I’d get an alert?

Is this possible without writing a custom plugin? I’m really confused by the documentation.


#2

Hey @bela.bacskai - I think you’ll need to build a custom integration using the SDK to monitor files & send Insights events based on the contents of those files: https://docs.newrelic.com/docs/integrations/integrations-sdk/getting-started/introduction-infrastructure-integrations-sdk

Once you have these events coming in, you can set up a NRQL alert on that data. :slight_smile:


#3

Bummer, that sounds like more work than I was hoping for. I guess I’ll have to get around to learning Go then.


#4

Hi, @bela.bacskai: You do not have to use Go to write an Infrastructure integration. You may write an integration in any language, as long as the resulting executable can be run from the command line, and it can export JSON data to stdout. It looks like you are on Windows; you could write an integration in C# or PowerShell.


#5

Thanks @philweber, that’s good to know. The documentation does seem to lean heavily towards Go in the first instance, but I see now that further on it describes the required file structures in a language-agnostic way.


#6

Eager to see if you have made progress here, @bela.bacskai! If our community can do anything to help, don’t hesitate to reach out!