Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3445
  • Last Modified:

Monitor an individual process on linux with Nagios NRPE

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
Rigged
Asked:
Rigged
3 Solutions
 
Kerem ERSOYPresidentCommented:
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
 
RiggedAuthor Commented:
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
 
TintinCommented:
Just use the check_procs plugin.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Kerem ERSOYPresidentCommented:
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
 
Kerem ERSOYPresidentCommented:
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
 
RiggedAuthor Commented:
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
 
RiggedAuthor Commented:
Thanks dudes
0
 
rohitskapoorCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now