How to monitor long running processes?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

How to monitor long running processes?

Post by Siddharth Hegde »

Hello,

I have couple of long running processes in server which runs for days at stretch. Is there a way to get alerts when they stop or exit? How to monitor them in NRPE?

Regards,
Siddarth Hegde
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: How to monitor long running processes?

Post by npolovenko »

@Siddharth Hegde, Are you looking to monitor processes on a windows server or on a linux server? You can find some examples here:
https://support.nagios.com/kb/article/p ... s-782.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Post by Siddharth Hegde »

Hi @npolovenko,

All are ubuntu 16.04 servers

Thanks,
Siddarth Hegde
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: How to monitor long running processes?

Post by npolovenko »

@Siddharth Hegde, You can use the check_procs plugin. Put the following command in the nrpe.cfg file on the Ubuntu server.
command[check_process]=/usr/local/nagios/libexec/check_procs $ARG1$
And here's the command to run from the Nagios server.
/usr/local/nagios/libexec/check_nrpe -H IP_address -c check_process -a "-a httpd -c 2:5"
You can replace httpd with the name of the process you want to monitor. And you can replace my current critical range 2:5 with your own. Meaning that the plugin will return in Critical state if there are 2 to 5 httpd processes running on the Ubuntu server.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Post by Siddharth Hegde »

Hi @npolovenko,

Thanks. I will check it

Regards,
Siddarth Hegde
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to monitor long running processes?

Post by scottwilkerson »

Siddharth Hegde wrote:Hi @npolovenko,

Thanks. I will check it

Regards,
Siddarth Hegde
Let us know if we can be of further assistance
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Post by Siddharth Hegde »

Hi,

My apologies for replying very late. I have a followup query.

I have a process, process.jar, which is a single process which should be running all the time. I want to monitor this process.

What should I enter in client.cfg in nagios server? What should I put in client nrpe.cfg?

Please let me know if I have to create a new thread for this or can be continued in this thread.

Regards,
Siddarth Hegde
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to monitor long running processes?

Post by scottwilkerson »

we would need to know what the process line looks like

Can you run the following on the server

Code: Select all

ps -ef|grep process.jar
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Siddharth Hegde
Posts: 70
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Post by Siddharth Hegde »

scottwilkerson wrote:we would need to know what the process line looks like

Can you run the following on the server

Code: Select all

ps -ef|grep process.jar
I got this

Code: Select all

root      98376  98355  0 14:57 pts/0    00:00:00 grep --color=auto process.jar
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to monitor long running processes?

Post by scottwilkerson »

If this is your only output then there is not a process running called process.jar

Are you sure that is what it is called?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked