Solved

Monitor an individual process on linux with Nagios NRPE

Posted on 2009-05-14
8
3,325 Views
Last Modified: 2013-12-16
Hi

I have a Groundwork/Nagios server setup to monitor a few Windows and Linux Machines. All my Linux monitoring I do by using NRPE. All works 100%, but I would like to monitor a single individual process on a few of the Linux Servers.

I found a page where they showed how it can be done by using nrpe, but for the life of me I can't find it now.
Anyone know how to do it?
0
Comment
Question by:Rigged
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24382426
hi,

Does the process you want to monitor has a socket connection or you want to check it via ps or some other way? Will you please give some details on the proces and what is your preferred method to monitor it ?
0
 
LVL 1

Author Comment

by:Rigged
ID: 24382711
Hi KeremE

Well all my current linux checks (disk, total procs, load....) are done by nrpe and then reported back to the Server.
The specific service I want to monitor is my squid proxy server process by the process name "squid".

From what I understand you can pass any nagios check commad through to nrpe.

Below code is the other commads I have placed in /usr/local/nagios/etc/nrpe.cfg (on the machine that is being monitored)  and below it is the command I run from the Nagios server to do the NRPE check:

[the server passes check_nrpe through to the monitored client.  -c xxxx is the check/command that is run locally on the monitored monitored client, that passes the results back to NRPE for the server]
Extract from nrpe.cfg for the check commands ran on the monitored client:
---------------------
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 10% -c 5% -p /dev/sda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%
_____________________________________________________________________
Below is a few of the commands I run from the Groundwork server to get the results for the above checks:
---------------------
check_nrpe -t 60 -H $HOSTADDRESS$ -c check_disk
check_nrpe -t 60 -H $HOSTADDRESS$ -c check_load
check_nrpe -t 60 -H $HOSTADDRESS$ -c check_total_procs

Open in new window

0
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 24382952
Just use the check_procs plugin.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 125 total points
ID: 24382959
I got it. Since the Squid uses port 800 we can check the port to iss if squid is alive.
- go to /usr/local/nagios/etc/objects
- create a file called proxies.cfg

The contents would be:

define service{
            use                               generic-service
            hostname                     prox1.localdomain
            service_description     Squid proxy service
            check_command          check_nrpe!check_squid
            notfications_nabled      1
}

Save Exit

In fact this sobject should be included in nagios.cfg in one line  cfg_file directives
 
edit client side nrpe to insert
command[check_squid]=/usr/local/nagios/libexec/check_tcp -p 800 -H 10.10.10.10

Save Exit..

This will connect to the port 800
and if it can you'll get a 0 if not you'll get error.

   
0
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 125 total points
ID: 24383059
command[check_squid]=/usr/local/nagios/libexec/check_tcp -H 10.10.10.10  -p 800 -w 100 -c 200

you might as well use check_system_pp

edit cehck_system_pp script and add these lines:

PROCLIST_RED=\"squid\"
PROCLIST_YELLOW=\"less_critical_process other_stuffd\"
PORTLIST=\"800\"

command[check_squid]=/usr/local/nagios/libexec/check_system_pp -H 10.10.10.10


or snmp_ping, as tintitn suggwested with check_procs ....
you hacve los of alternatives to check something with nagios.

0
 
LVL 1

Author Comment

by:Rigged
ID: 24383201
Hey guys thanks for all the help. I came right.

I added the following line for the Groundwork monitoring server Check:

check_nrpe -t 60 -H $HOSTADDRESS$ -c check_squid

and on the monitored client all you have to add is:

command[check_squid]=/usr/local/nagios/libexec/check_procs -C squid

Quite simple actually :)
0
 
LVL 1

Author Closing Comment

by:Rigged
ID: 31581339
Thanks dudes
0
 

Expert Comment

by:rohitskapoor
ID: 24711395
Hey,

I'm New to Nagios,
I have configured Nagios in my linux machine.
My requirement is to check whether mysql is up and apache is running.
If not Nagios has to trigger a mail to a specified user.

Please help

Thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How can you create a game plan that lets you focus on special projects instead of running from cubicle to cubicle every day and feeling like you’ve accomplished nothing? Try these strategies for prioritizing your tasks, offloading what you can, and …
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question