How to monitor long running processes?

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

How to monitor long running processes?

Postby Siddharth Hegde » Fri Sep 14, 2018 6:11 am

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
Siddharth Hegde
 
Posts: 56
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Postby npolovenko » Fri Sep 14, 2018 12:03 pm

@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/process-checks-782.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2472
Joined: Mon May 15, 2017 5:00 pm

Re: How to monitor long running processes?

Postby Siddharth Hegde » Fri Sep 14, 2018 12:10 pm

Hi @npolovenko,

All are ubuntu 16.04 servers

Thanks,
Siddarth Hegde
Siddharth Hegde
 
Posts: 56
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Postby npolovenko » Fri Sep 14, 2018 1:07 pm

@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.
User avatar
npolovenko
Support Tech
 
Posts: 2472
Joined: Mon May 15, 2017 5:00 pm

Re: How to monitor long running processes?

Postby Siddharth Hegde » Sat Sep 15, 2018 1:29 am

Hi @npolovenko,

Thanks. I will check it

Regards,
Siddarth Hegde
Siddharth Hegde
 
Posts: 56
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Postby scottwilkerson » Mon Sep 17, 2018 8:32 am

Siddharth Hegde wrote:Hi @npolovenko,

Thanks. I will check it

Regards,
Siddarth Hegde


Let us know if we can be of further assistance
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12594
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: How to monitor long running processes?

Postby Siddharth Hegde » Wed Oct 03, 2018 9:29 am

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
Siddharth Hegde
 
Posts: 56
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Postby scottwilkerson » Wed Oct 03, 2018 9:51 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12594
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: How to monitor long running processes?

Postby Siddharth Hegde » Wed Oct 03, 2018 9:59 am

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
Siddharth Hegde
 
Posts: 56
Joined: Mon Aug 07, 2017 4:19 am

Re: How to monitor long running processes?

Postby scottwilkerson » Wed Oct 03, 2018 10:06 am

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12594
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 13 guests