2009/8/17 Jaskiewicz, Michael-P49499 <michael.jaskiew...@gdc4s.com>:
>        Looking at the net-snmp-config.h file, I noticed that the some
> of the #defines point to programs

One of the major difficulties in implementing a MIB module,
is determining the information that should be reported.
The SNMP agent isn't a "magic box"  (which seems to come as a
major surprise to many people on these lists!).   It can only report
information that it can retrieve from the underlying operating system.

One way to retrieve this information is to run a suitable shell command
(such as "ps") and interpret the output.  At first sight, this is a
quick-n-simple
approach, so is often used for first-draft implementations.   However there
are a number of issues with doing this (differences in output format
from one system to another, one release to another,  inefficiencies of
running a sub-command for every SNMP request, error handling, etc etc)
So in general, we try to retrieve the underlying data from some suitable
system API instead.

But that's why there are definitions such as PSCMD - mostly as a hangover
(or fallback) to this quick-n-dirty approach.



>        Is it possible in any way to run the program from a normal Win32
> cmd line or do I have to use Cygwin? The readme.win32 file led me to
> believe that Cygwin was not a requirement.

Cygwin is not necessary for running the agent under Windows, no.
But I'm not sure that the mechanism for forking off a sub-process works
under a non-Cygwin Windows environment either.   So the lack of "ps"
isn't really relevant.

The Right Way To Handle This is to use whatever API the Windows OS
provides for retrieving information about running processes.
A quick look seems to indicate that there is some support for Windows
under the 'host' group, though this may be Cygwin only.   If so, then
it simply requires a volunteer to port/extend this code to non-Cygwin
Windows environments.

   But the lack of a "ps" command should not be a problem.

Dave

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to