nrpe query
carole verdon
verdon at cict.fr
Tue Jul 6 15:35:12 CEST 2004
I suggest you to try this:
ps -ef | grep 'PushGateway$'
The '$' permit to indicate the end of string.
Perhaps that you will have to write a script to execute the good command.
I hope that will help you.
Carole.
Swati Srivastava wrote:
> I've tried the first one that does not give result.
>
> Here's some more samples:
>
> [swati at localhost libexec]$ ps -aux|grep PushGateway
> root 29139 0.0 0.6 215232 13904 ? S Mar24 10:22 java
> PushGateway1
> root 31179 1.1 2.3 256048 48140 ? S 12:57 3:20 java
> PushGateway
> swati 13950 0.0 0.0 3696 544 pts/4 S 15:53 0:00 grep
> PushGateway
>
> [swati at localhost libexec]$ ps -aux|grep java
> root 29139 0.0 0.6 215232 13904 ? S Mar24 10:22 java
> PushGateway1
> root 31179 1.1 2.3 256048 48140 ? S 12:57 3:20 java
> PushGateway
> root 32454 0.0 0.5 214428 10828 ? S 13:11 0:00 java
> runShell
> nav 410 0.1 0.7 215932 14504 ? S 13:15 0:12 java
> Server
> swati 13994 0.0 0.0 3696 544 pts/4 S 15:53 0:00 grep java
>
> [swati at localhost libexec]$ ./check_procs -w 3 -c 5 -C "java PushGateway"
> OK - 0 processes running with command name java PushGateway
>
> [swati at localhost libexec]$ ./check_procs -w 3 -c 5 -C "java PushGateway1"
> OK - 0 processes running with command name java PushGateway1
>
> [swati at localhost libexec]$ ./check_procs -w 3 -c 5 -C PushGateway
> OK - 0 processes running with command name PushGateway
>
> [swati at localhost libexec]$ ps -ef|grep java PushGateway1
> grep: PushGateway1: No such file or directory
>
> [swati at localhost libexec]$ ps -ef|grep java PushGateway
> grep: PushGateway: No such file or directory
>
> [swati at localhost libexec]$ ps -ax|grep java PushGateway
> grep: PushGateway: No such file or directory
>
> [swati at localhost libexec]$ ps -au|grep java PushGateway
> grep: PushGateway: No such file or directory
>
> What do you suggest?
>
>> From: carole verdon <verdon at cict.fr>
>> Reply-To: verdon at cict.fr
>> To: Swati Srivastava <swati220781 at hotmail.com>
>> Subject: Re: [Nagios-users] nrpe query
>> Date: Tue, 06 Jul 2004 10:55:41 +0200
>>
>> Try this:
>>
>> ./check_procs -w 3 -c 5 -C PushGateway or perhaps ./check_procs -w 3
>> -c 5 -C "java PushGateway"
>>
>> I don't know if that works.
>>
>>
>>
>> Swati Srivastava wrote:
>>
>>>
>>> [swati at localhost libexec]$ ps -ef|grep PushGateway
>>> root 29139 1 0 Mar24 ? 00:10:21 java PushGateway1
>>> root 24907 1 1 Jul01 ? 02:15:50 java PushGateway
>>> swati 24864 22471 0 11:48 pts/4 00:00:00 grep PushGateway
>>>
>>> [swati at localhost libexec]$ ./check_procs -w 3 -c 5 -C java PushGateway
>>> OK - 3 processes running with command name java
>>>
>>> [swati at localhost libexec]$ ps -ef|grep java
>>> root 29139 1 0 Mar24 ? 00:10:21 java PushGateway1
>>> root 24907 1 1 Jul01 ? 02:15:50 java PushGateway
>>> root 24752 24608 0 11:46 pts/10 00:00:00 java MTVCdrGenerator
>>> swati 24996 22471 0 11:48 pts/4 00:00:00 grep java
>>>
>>> These are some results which may explain what my query is.
>>> I want to monitor one particular process nameed PushGateway. As you
>>> can see in the ps output, there are multiple processes running with
>>> the command name java. If i want to monitor one particular process
>>> out of that, how do i do that?
>>>
>>> Kindly help.
>>>
>>>> From: carole verdon <verdon at cict.fr>
>>>> Reply-To: verdon at cict.fr
>>>> To: Swati Srivastava <swati220781 at hotmail.com>
>>>> Subject: Re: [Nagios-users] nrpe query
>>>> Date: Fri, 02 Jul 2004 14:02:37 +0200
>>>>
>>>> Here some examples of check_procs use:
>>>>
>>>> $ ./check_procs -w 1 -c 5 -C ypserv
>>>> PROCS OK: 1 process with command name 'ypserv'
>>>> $ ps -ef | grep ypserv
>>>> root 153 1 2 Feb 14 ? 1776:02
>>>> /usr/lib/netsvc/yp/ypserv -d
>>>>
>>>> $ ./check_procs -w 15 -c 30 -C httpd
>>>> PROCS OK: 11 processes with command name 'httpd'
>>>> $ ps -ef | grep httpd
>>>> apache 23297 15738 0 Jun 29 ? 0:14 /etc/init.d/httpd -k
>>>> start
>>>> apache 15742 15738 0 Jun 24 ? 0:00 /etc/init.d/httpd -k
>>>> start
>>>> apache 23242 15738 0 Jun 29 ? 0:04 /etc/init.d/httpd -k
>>>> start
>>>> apache 23283 15738 0 Jun 29 ? 0:12 /etc/init.d/httpd -k
>>>> start
>>>> apache 15743 15738 0 Jun 24 ? 0:00 /etc/init.d/httpd -k
>>>> start
>>>> apache 23289 15738 0 Jun 29 ? 0:08 /etc/init.d/httpd -k
>>>> start
>>>> apache 23012 15738 0 Jun 29 ? 0:14 /etc/init.d/httpd -k
>>>> start
>>>> apache 23298 15738 0 Jun 29 ? 0:01 /etc/init.d/httpd -k
>>>> start
>>>> root 15738 1 0 Jun 24 ? 0:00 /etc/init.d/httpd -k
>>>> start
>>>> apache 23243 15738 0 Jun 29 ? 0:08 /etc/init.d/httpd -k
>>>> start
>>>> apache 23296 15738 0 Jun 29 ? 0:03 /etc/init.d/httpd -k
>>>> start
>>>>
>>>>
>>>> $ ./check_procs -w 2 -c 5 -C nagios
>>>> PROCS OK: 1 process with command name 'nagios'
>>>> $ ps -ef | grep nagios
>>>> nagios 28752 1 0 17:31:52 ? 4:30
>>>> /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
>>>>
>>>> The option -a is used for commands that needed arguments as for
>>>> example to run nagios process:
>>>> $ ./check_procs -w 2 -c 5 -a /usr/local/nagios/etc/nagios.cfg
>>>> PROCS OK: 1 process with args '/usr/local/nagios/etc/nagios.cfg'
>>>>
>>>> I hope that help you.
>>>>
>>>> Carole.
>>>>
>>>>
>>>> Swati Srivastava wrote:
>>>>
>>>>> i am trying to check a particular process by trying
>>>>> ./check_procs -w 3 -c 5 -C <process name>, which is not givingme
>>>>> the correct result.
>>>>> I have the process id and name.
>>>>> Can you explain me what is meant by command argument and how is it
>>>>> different from process name.
>>>>> What is meant by argument array?
>>>>>
>>>>>> From: carole verdon <verdon at cict.fr>
>>>>>> Reply-To: verdon at cict.fr
>>>>>> To: Swati Srivastava <swati220781 at hotmail.com>
>>>>>> CC: nagios-users at lists.sourceforge.net
>>>>>> Subject: Re: [Nagios-users] nrpe query
>>>>>> Date: Wed, 30 Jun 2004 16:46:25 +0200
>>>>>>
>>>>>> Can you post exactly the definition of your check command?
>>>>>>
>>>>>> Carole.
>>>>>>
>>>>>> Swati Srivastava wrote:
>>>>>>
>>>>>>> Hi!!
>>>>>>> I am trying to monitor a particular process on a remote
>>>>>>> machine.How to monitor a process by its name or process id? The
>>>>>>> remote machine has RedHat Linux8.
>>>>>>> I tried giving the process name by -C as an argument. That shows
>>>>>>> 0 processes running while
>>>>>>> ps -aux|grep <process name> shows the process running.
>>>>>>> Kindly help.
>>>>>>> Thanks,
>>>>>>> Swati
>>>>>>>
>>>>>>> _________________________________________________________________
>>>>>>> Contact brides & grooms FREE!
>>>>>>> http://www.shaadi.com/index.php?ptnr=hmltag Only on
>>>>>>> www.shaadi.com. Register now!
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -------------------------------------------------------
>>>>>>> This SF.Net email sponsored by Black Hat Briefings & Training.
>>>>>>> Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
>>>>>>> digital self defense, top technical experts, no vendor pitches,
>>>>>>> unmatched networking opportunities. Visit www.blackhat.com
>>>>>>> _______________________________________________
>>>>>>> Nagios-users mailing list
>>>>>>> Nagios-users at lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/nagios-users
>>>>>>> ::: Please include Nagios version, plugin version (-v) and OS
>>>>>>> when reporting any issue. ::: Messages without supporting info
>>>>>>> will risk being sent to /dev/null
>>>>>>>
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list