checking memory and cpu consumption of procs
Dave Viner
dviner at yahoo-inc.com
Thu Dec 19 19:00:22 CET 2002
Here's my first stab at a check_cpu.c program. I want to use poll() to
watch both stdout and stderr of the child process, but I can't get it to
compile on both FreeBSD and Linux. FreeBSD just needs:
#include <poll.h>
but Linux needs:
#include <sys/poll.h>
#include <asm/poll.h>
Unfortunately this means that it requires a new definition in configure.in.
I'm not quite sure how to handle that, but I'll also look into make those
changes. Can anyone help me with that?
Other than that, this program works very well (I think).
thanks
dave
-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of Dave Viner
Sent: Wednesday, December 18, 2002 9:38 AM
To: Voon, Ton; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] checking memory and cpu consumption of procs
I'll make one for FreeBSD and Linux. I'll post it to the list when I have
it ready. Unforunately, I don't really understand autoconf/automake and
configure.in/makefile.am, so I don't know that I'll be able to help much
there....
Thanks !
dave
-----Original Message-----
From: Voon, Ton [mailto:Ton.Voon at egg.com]
Sent: Wednesday, December 18, 2002 1:33 AM
To: 'Dave Viner'; Voon, Ton; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] checking memory and cpu consumption of procs
A check_cpu, based on check_vsz, would be useful. However, it would require
quite a few non-trivial changes to the configure.in and makefile.am to pick
up various flags for the ps command to make it portable. If you want to make
a start, I'd be happy to add in other OSes.
> -----Original Message-----
> From: Dave Viner [SMTP:dviner at yahoo-inc.com]
> Sent: Tuesday, December 17, 2002 6:23 PM
> To: Voon, Ton; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] checking memory and cpu consumption of
> procs
>
> Hi,
>
> Thanks for pointing me to check_vsz. This is a really great utility.
> From
> looking at the usage message and the code itself, it looks to me like this
> monitors virtual memory consumption. Are there any hooks to monitor %cpu
> consumption ? Perhaps something like
> ps waxco 'vsz %cpu command'
> ? I'm happy to try to add this in if it sounds useful.
>
> dave
>
> -----Original Message-----
> From: Voon, Ton [mailto:Ton.Voon at egg.com]
> Sent: Tuesday, December 17, 2002 1:31 AM
> To: 'Dave Viner'; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] checking memory and cpu consumption of procs
>
>
> Dave,
>
> Take a look at check_vsz for the virtual size of memory usage on a process
> level. I've put lot of functionality patches on sourceforge, so you'll
> need
> to apply those.
>
> Ton
>
> > -----Original Message-----
> > From: Dave Viner [SMTP:dviner at yahoo-inc.com]
> > Sent: Tuesday, December 17, 2002 6:56 AM
> > To: nagios-users at lists.sourceforge.net
> > Subject: [Nagios-users] checking memory and cpu consumption of procs
> >
> > Hi,
> > I want to ensure that no process on a machine consumes more than x %
> > of the
> > cpu, and y MB memory. Is there an existing plugin that handles this? I
> > saw
> > that check_procs will monitor the number of processes on a machine
> > (including ones that match a certain name), and check_load will examine
> > the
> > machine's overall load averages as reported by uptime. But I can't seem
> > to
> > find anything that monitors cpu consumption or memory consumption. Is
> > there
> > a plugin for this already?
> >
> > thanks
> > dave
> >
>
>
This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.
-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty.
T H I N K G E E K . C O M http://www.thinkgeek.com/sf/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_cpu.c
Type: application/octet-stream
Size: 9248 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20021219/30551e88/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_cpu.patch
Type: application/octet-stream
Size: 4636 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20021219/30551e88/attachment-0001.obj>
More information about the Users
mailing list