Specific Process Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Specific Process Monitoring

Post by mindspring »

Hi there,

I am trying to monitor a specific program which only shows up when I do a ps -aux

Code: Select all


[root@logapi-hz]# ps -aux | grep art
root       980  0.0  0.3 393240 25804 ?        S    09:35   0:00 php /var/www/html/botapi/bot_api/artisan queue:work --sleep=3 --tries=3

So what I want to monitor specifically is the "artisan" process. This doesn't show up with a normal ps -A | grep art.

What would you recommend I use to monitor this process to check if I need to alert when the number of artisan processes drops to below X?

Thanks, appreciate it
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Specific Process Monitoring

Post by scottwilkerson »

I would suggest the NCPA agent and Wizard built into Nagios XI
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Specific Process Monitoring

Post by mindspring »

Thanks, it looks like this is almost what I would require. I see the attached option but how would I reverse it so that it warns me when process dip below a certain number?

Thanks
You do not have the required permissions to view the files attached to this post.
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Specific Process Monitoring

Post by mindspring »

I also seem to get this error when running from the command line:

Code: Select all


[root]@cloudnagios ~] $ /usr/local/nagios/libexec/check_ncpa.py -H xxxxx -t 'xxxxx' -P 5693 -M 'process/artisan/count' -w 50 -c 10
UNKNOWN: The node (process) requested does not exist. You may be trying to access the 'processes' node.

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

Re: Specific Process Monitoring

Post by scottwilkerson »

mindspring wrote:Thanks, it looks like this is almost what I would require. I see the attached option but how would I reverse it so that it warns me when process dip below a certain number?
Enter the number followed by a colon

for example, the following would alert if there was less than 2 processes

Code: Select all

2:
mindspring wrote:I also seem to get this error when running from the command line:

Code: Select all


[root]@cloudnagios ~] $ /usr/local/nagios/libexec/check_ncpa.py -H xxxxx -t 'xxxxx' -P 5693 -M 'process/artisan/count' -w 50 -c 10
UNKNOWN: The node (process) requested does not exist. You may be trying to access the 'processes' node.

Try

Code: Select all

[root]@cloudnagios ~] $ /usr/local/nagios/libexec/check_ncpa.py -H xxxxx -t 'xxxxx'  -M 'processes' -w 50: -c 10: -q 'name=artisan'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Specific Process Monitoring

Post by mindspring »

Brilliant, thank you so much. This works, the only issue I have is that it doesn't seem to reflect what the ps -aux command shows for processes.

It does show what the ps -A command shows. Any ideas on this one?

Code: Select all


[root]@cloudnagios~] $  /usr/local/nagios/libexec/check_ncpa.py -H xxxx -t 'xxxx' -M 'processes' -w 50: -c 10: -q 'name=artisan'
CRITICAL: Process count for processes named queue was 0 | 'process_count'=0;50:;10:;

Works nicely for php

Code: Select all


[root]@cloudnagios~] $  /usr/local/nagios/libexec/check_ncpa.py -H xxxxx -t 'xxxx' -M 'processes' -w 50: -c 10: -q 'name=php'    
OK: Process count for processes named php was 72 | 'process_count'=72;50:;10:; 'cpu'=1.6%;;; 'memory'=30.64%;;; 'memory_vms'=30.01GB;;; 'memory_rss'=1.92GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
38748: php: root: 0.46 % (VMS 0.45 GB, RSS 0.03 GB): 0.03 %
43566: php: root: 0.47 % (VMS 0.45 GB, RSS 0.03 GB): 0.05 %
44190: php: root: 0.45 % (VMS 0.45 GB, RSS 0.03 GB): 0.03 %
44317: php: root: 0.46 % (VMS 0.45 GB, RSS 0.03 GB): 0.03 %
44353: php: root: 0.46 % (VMS 0.45 GB, RSS 0.03 GB): 0.03 %
44731: php: root: 0.47 % (VMS 0.45 GB, RSS 0.03 GB): 0.03 %


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

Re: Specific Process Monitoring

Post by scottwilkerson »

You may need to change up the command to something like this

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H xxxx -t 'xxxx' -M 'processes' -q 'cmd=artisan,match=search'
or

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H xxxx -t 'xxxx' -M 'processes' -q 'exe=artisan,match=search'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mindspring
Posts: 117
Joined: Thu Jul 19, 2012 10:24 am

Re: Specific Process Monitoring

Post by mindspring »

Many thanks, this works great!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Specific Process Monitoring

Post by scottwilkerson »

mindspring wrote:Many thanks, this works great!
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked