Hello,
I installed PCP on my machine. I find it is really wonderful. I just got
one
problem: It is when I tried to launch pmie, it complained about not
finding the
file named /etc/pcp.conf.sh (tried on Debian and Redhat) I looked for it
everywhere but I couldn't find it.
So:
I copied the pcp.conf file as pcp.conf.sh, added the '#!/bin/sh' at the
beginning,
and added to the /etc/init.d/pmie file the following statement (because
IS_ON
is nowhere :-):
IS_ON=false
Then I modified the first statement of /etc/init.d/pmie which seems to
have a bug:
I modified:
if [ -fi ${PCP_CONF:-/etc/pcp.conf}.sh ] ; then
to:
if [ -f ${PCP_CONF:-/etc/pcp.conf}.sh ] ; then
(removed the 'i').
It now works really fine (even pmie :-).
There is an important variable which is missing from the standard ones,
(coming
from /proc/sys/fs/file-nr). It is the number of currently open files
(and the
maximum assigned file number, and the maximum allocatable file number).
Their description is the following:
"The three values in file-nr denote the number of allocated file
handles, the
number of used file handles, and the maximum number of file handles.
When the
allocated file handles come close to the maximum, but the number of
actually
used ones is far behind, you've encountered a peak in your usage of file
handles
and you don't need to increase the maximum. "
(From http://www.bb-zone.com/Proc/chapter2.html#section2.1)
I think I can patch pcp to add it myself, but I don't know in which
hierarchy I must put it into. In filesys.*, there are already variables
named
filesys.maxfiles, filesys.usedfiles and filesys.freefiles, but they are
totally
unrelated to the /proc/sys/fs/file-nr variables.
About practical use of pmie, I'm looking for an example on how to
monitor
the presence of a daemon on a system. For example, I have an apache
daemon, and
I'd like to get an alert if it dies, or if there are too many instances
of
it.
The only near useful variable that I see is proc.psinfo.pid. I used it
like this:
eurythro:/home/enlight# pmie -v
val = proc.psinfo.pid #'/usr/sbin/apache';
val: 254
val: 254
val: 254
val: 254
val: ?
val: ?
val: ?
val: ?
At the fifth iteration, I stopped the daemon. And it stops returning its
pid, which is cool, but it never get a pid again, even when I restart
apache. I don't understand why...Another problem with this, is that I
don't have the number of running daemons :-(
Any ideas ?
Thanks,
Luc
--
Luc Stepniewski <lstep@xxxxxxxxxxxxxx> <http://lstep.free.fr/> ICQ#
6104530
Adequat - Securite, Linux Public key:
<http://lstep.free.fr/pubkey.txt>
Key D93B2D2D fingerprint = 49 00 CC D1 69 03 E2 94 C8 78 ED 3C 75 89 A8
DE
|