hi,
using your example, i created something similar:
/tmp/pself
contents:
#!/bin/bash
ps -elf
it chmod'ed it 777, so bigsis user can run it (verified ok).
then i put this line in uxmon-net:
localhost pscomm=/tmp/pself proc=bash procs
i restart the script, and on another window, i monitor the process list to
see what kind of processes get executed when i restart the client.
and to my surprise, it's not /tmp/pself, but it's always the same process:
root 4815 4733 0 17:58 pts/0 00:00:00 sh -c ps cax 2>/dev/null
any ideas ?
i'm using version 0.98c8-2
thanks,
tom.
----- Original Message -----
From: <suppressed>
To: <suppressed>;
<suppressed>
Sent: Monday, March 29, 2004 5:25 PM
Subject: Re: [Bigsister-general] process monitor: what about whitespace etc.
You can specify an alternative command to the procs check. I have to
distinguish between specific Java processes which are all just "java" and
where the significant bit of the command line is after hundreds of
characters of options. I wrote a little bit of perl that searches the
whole output of a "ps -ef --width 10000" and converts it into a meaningful
name e.g.:
In uxmon-net:
localhost pscomm=/opt/bin/bsps proc=jboss min=1 max=999 procs
The bsps script looks like e.g. this, feel free to plagiarise if it is
useful to you:
#!/usr/bin/perl
# Define search strings and meaningful process names
%subs =
(
"postmaster" => "PostgreSQL",
"postgres: stats buffer" => "pgstatsbuff",
"postgres: stats collector" => "pgstatscoll",
"ns-slapd" => "LDAP",
"smbd" => "Samba",
"nmbd" => "NetBIOS",
"httpd" => "Apache",
"org.jboss.Main" => "jboss",
"su - swiftmq -c" => "swiftmq",
);
@lines = `ps -ef --width 10000`;
foreach( @lines )
{
chomp;
$comm = $_;
($f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8) = split( /[\s\t]+/, $comm );
$gotit = 0;
while ( ($ss,$sub) = each %subs )
{
if( $comm =~ /$ss/ )
{
$f8 = $sub;
# Do not break out of the loop coz it goes wrong next
# time around!
# last;
}
}
print( "$f2 $f6 $f7 $f8\n");
}
Regards,
- Pat
Tom Van Overbeke
<suppressed> To:
suppressed
Sent by: cc:
suppressed Subject:
Re: [Bigsister-general] process monitor: what about
eforge.net whitespace
etc.
29/03/2004 14:16
yes, it was a type. it was "postgres: comfire"
i've been doing a lot of tests, and i'm not even sure if what i want is
possible: i just want to check for the string 'postgres: comfire' in the
output of a ps -ef command.
my last try was this:
localhost pscomm="ps -ef" proc=comfire procs
the output from ps -ef | grep comfire is this:
postgres 1216 681 0 Mar09 ? 00:00:00 postgres: comfire comfire
127.0.0.1 idle
postgres 1218 681 0 Mar09 ? 00:00:00 postgres: comfire comfire
127.0.0.1 idle
postgres 1219 681 0 Mar09 ? 00:00:00 postgres: comfire comfire
127.0.0.1 idle
postgres 1220 681 0 Mar09 ? 00:00:00 postgres: comfire comfire
127.0.0.1 idle
postgres 1221 681 0 Mar09 ? 00:00:00 postgres: comfire comfire
127.0.0.1 idle
what i can see in the status.log file is this:
status.log.0:1080552987 209.28.229.73: status+11 ccntst2m1.procs red
(1080552987) Mon Mar 29 11:36:27 2004 &red comfire(10) (no process)|>&green
sshd (3 instances)
any ideas if the procs check can search for a string in the ps output, or
does it really need to be exactly the name of a proces ?
oh and does anyone have an idea what's up with the mailing list archive on
on sourceforge.net ? the archive is not available apparently (and
sourceforge.net has been extremely slow the last few days).
----- Original Message -----
From: "Kai Schaetzl" <suppressed>
To: <suppressed>
Sent: Monday, March 29, 2004 1:32 PM
Subject: Re: [Bigsister-general] process monitor: what about whitespace
etc.
> Tom Van Overbeke wrote on Mon, 29 Mar 2004 11:35:48 +0200:
>
> > localhost alternate=yes proc="postgres=: comfire"(10) procs.
> >
>
> Is the "=" in there a typo? How does it appear in top? Possibly only
> "postgres"? I use the name from top for monitoring and that always works.
> Btw: the output for "ps ex" looks much different on my systems.
>
>
> Kai
>
> --
>
> Kai Schätzl, Berlin, Germany
> Get your web at Conactive Internet Services: http://www.conactive.com
> IE-Center: http://ie5.de & http://msie.winware.org
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Bigsister-general mailing list
> suppressed
> https://lists.sourceforge.net/lists/listinfo/bigsister-general
>
=========================== DISCLAIMER ===========================
The information contained in this communication may contain
confidential information, intended solely for the use of the
individual or entity to whom it is addressed and may be
protected by professional secrecy. You should not copy,
disclose or distribute its contents to anyone. We are neither
liable for the proper and complete transmission of the information
contained in this communication nor for any delay in its receipt.
We do not guarantee that the integrity of this communication has
been maintained nor that the communication is free of viruses,
interceptions or interference. If you are not the intended
recipient of this communication please let us know by e-mail
reply and delete it from your system.
==================================================================
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general
=========================== DISCLAIMER ===========================
The information contained in this communication may contain
confidential information, intended solely for the use of the
individual or entity to whom it is addressed and may be
protected by professional secrecy. You should not copy,
disclose or distribute its contents to anyone. We are neither
liable for the proper and complete transmission of the information
contained in this communication nor for any delay in its receipt.
We do not guarantee that the integrity of this communication has
been maintained nor that the communication is free of viruses,
interceptions or interference. If you are not the intended
recipient of this communication please let us know by e-mail
reply and delete it from your system.
==================================================================
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bigsister-general mailing list
suppressed
https://lists.sourceforge.net/lists/listinfo/bigsister-general
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.