Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 87133 invoked from network); 25 Jul 2008 16:34:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2008 16:34:26 -0000 Received: (qmail 83857 invoked by uid 500); 25 Jul 2008 16:34:17 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 83836 invoked by uid 500); 25 Jul 2008 16:34:17 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 83825 invoked by uid 99); 25 Jul 2008 16:34:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2008 09:34:17 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.64.70.17] (HELO newbox.eroded.org) (69.64.70.17) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jul 2008 16:33:22 +0000 Received: from Martin.crimson-dragon.com (newbox.eroded.org [69.64.70.17]) by newbox.eroded.org (8.14.1/8.14.1) with ESMTP id m6PGVM7i002962 for ; Fri, 25 Jul 2008 09:31:26 -0700 Message-Id: <200807251631.m6PGVM7i002962@newbox.eroded.org> X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Fri, 25 Jul 2008 09:31:39 -0700 To: users@httpd.apache.org From: Dragon In-Reply-To: <4889FD27.8090103@ice-sa.com> References: <488A0C7E.19994.7130C74C@export.hope.cz> <4889FD27.8090103@ice-sa.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV 0.92.1/7826/Fri Jul 25 05:51:06 2008 on newbox.eroded.org X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] A number of Apache processes Andr=E9 Warnier wrote: >export@hope.cz wrote: >>Is there a way how to find out, from an external program running on the >>same machine, a number of a total http Apache's processes ? >>What command must I use in my C or Python program? >>Thanks for help. >>L. > >At the command-line : > >ps -ef | grep httpd | grep -v grep | wc -l >or, better : >ps -ef | grep "[h]ttpd" | wc -l > >(replace by "apache" or "apache2" if needed.) > > >At the program level : >find the function that lets you execute a system=20 >command and capture it's output, then use the above as command. >e.g. in perl you can just do : >my $var =3D `ps -ef | grep "[h]ttpd" | wc -l`; > >There are a number of more sophisticated=20 >alternatives in each programming language, but that's a simple way. ---------------- End original message. --------------------- You are of course assuming that the OP is using=20 an OS that is Unix-like that supports these=20 commands (Linux, BSD, OSX, Solaris, etc.). All bets are off if the OP is using Windows. That=20 would require digging into the Windows SDK to enumerate the system task= list. Dragon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Venimus, Saltavimus, Bibimus (et naribus canium capti sumus) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org