On Mar 28, 2008, at 6:03 PM, Glen Bremner-Stokes wrote:
> I am trying to develop process monitoring to monitor the full
> running command instead of the short name, preferably using ucd-snmp/
> proc.
>
> I can see (as per some previous list mails) that process monitoring
> uses pr_fname (16 bytes) as per the nix documentation but I cannot
> see anything in ioctl that will give me the full running command out
> of /proc. And yet ps is obviously able to display the full running
> command. Does anyone know where ps gets its information from ? If it
> is from /proc then where because I can see nothing in the
> documentation that indicates a full running command option (although
> it does seem like ioctl is notoriously poorly documented) ?
>
> Any guidance ?
>
> Some background for interest:
> I am building an snmp agent for Ingres database monitoring. Have a
> good basic agent running on Linux but I need to provide better
> defined process monitoring. So one option is to use popen and run ps
> -e type commands but I would imagine that /proc is a faster way to
> do things. But I can only see pr_fname and pr_psargs which I have
> tried but they still do not give me the info that displays in ps. I
> started getting into all this as I began a port to to Tru64.
This may be of use to you:
http://www.webweaving.org/tmp/net-snmp/docs/pass.html
http://www.webweaving.org/tmp/net-snmp/
in combination with a script which simply cats the output of PS into
something sensible
(
ps -w | while read PID TTY TIME CMD;
do
echo $OID.3.1.$i.1.0 integer $PID
echo $OID.3.1.$i.2.0 string $CMD
done
) > /tmp/...*
Or, if it is ingres you are after, use iimonitor, lockstat, logstat
and iinamu to get some data and write it to an OID file; and then
configure your SNMP tools (e.g. mrtg) to pick up the OID's of interest.
Dw.
*: simplified - though works :); If you are doing proper SNMP tables
you propably want this to read like:
echo $OID.3.1.$i.1.0 integer $PID >> /tmp/$OID.3.1
echo $OID.3.2.$i.1.0 string $CMD >> /tmp/$OID.3.2
as to get a proper table index and so on..
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders