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

Process count across hosts rather than single host


#1

I want to be able to alert if more than X total matching processes are running across Y hosts. For example:

Alert if more than 1 process matching crond is running across all hostnames containing foo.

But as far as I can see I can only alert on number of matching processes per host. Any ideas on how to achieve this?


#2

Have you tried using NRQL alerts …? That would achieve what you are after.
https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/create-alert-conditions-nrql-queries

Here is an example of an NRQL alert I have set up to monitor for the MQ listener process across two hosts, and then to alert if the threshold is < 1

SELECT count(*) FROM ProcessSample WHERE (fullHostname = ‘server1’ OR fullHostname = ‘server2’) AND commandLine = ‘/opt/mqm/bin/runmqlsr’

Using your details, if might look something like this,

SELECT count(*) FROM ProcessSample WHERE commandLine = ‘crond’ and fullHostname like ‘%foo%’


#3

@antonio.berrios Did you get a chance to try @LAMBERT’s advice? NRQL alerts is the recommended way to achieve your goals - so hopefully the queries LAMBERT shared are helpful for you.


#4

Thanks, I’ll give this a go.


#5

Awesome! Let us know how it goes :smiley: