running net-snmp agent in windows

2010-05-07 Thread Group
Hi,

I'm able to compile the code with basic settings.

My Configuration:

net-snmp version: net-snmp-5.4.2.1
environment: cygwin
operating system: windows XP

Now i would like to run the snmp agent on windows.

I created a snmpd.conf file in /usr/local/share/snmp
with following entry:

rocommunity  private

When i tried to do a snmpget i'm getting the following error.
$ snmpget -c private localhost sysUpTime
Timeout: No Response from localhost.

and when i do a snmpget for netSnmpExampleInteger, i'm getting the following
error: (i have compiled this by
including in ./configure ... -with-mib-modules"examples/static_int")
$ snmpget -c private localhost netSnmpExampleInteger.0
netSnmpExampleInteger.0: Unknown Object Identifier (Sub-id not found: (top)
-> netSnmpExampleInteger
)

I'm not sure whether snmp agent is running or not. How can i check this.
I make sure that snmp port is not blocked (I allowed UDP port 161 in
firewall settings).

Can any one help me out in resolving this issue. Thanks in advance.
--

___
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


net-snmp compilation problem still unresolved

2010-05-07 Thread Group
Hi,

My Configuration:

net-snmp version: net-snmp-5.4.2.1
environment: cygwin
operating system: windows XP

ran configure command:
$ ./configure --without-perl-modules --disable-embedded-perl
--without-openssl -with-out-mib-module
s="snmpv3mibs ucd_snmp mibII notification utilities disman/event agentx
agent_mibs disman/schedule"

ran make command
$ make
I'm getting following warnings...and ending up with undefined references...

Warnings:

/bin/sh ../libtool  --mode=link gcc -g -O2 -Ucygwin -Dcygwin=cygwin  -rpath
/usr/local/lib -version-
info 16:2:1 -o libnetsnmpagent.la snmp_agent.lo snmp_vars.lo
agent_read_config.lo agent_registry.lo
agent_index.lo agent_trap.lo kernel.lo agent_handler.lo   ../snmplib/
libnetsnmp.la

*** Warning: This system can not link to static lib archive ../snmplib/
libnetsnmp.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
libtool: link: warning: undefined symbols not allowed in i686-pc-cygwin
shared libraries
ar cru .libs/libnetsnmpagent.a  snmp_agent.o snmp_vars.o agent_read_config.o
agent_registry.o agent_
index.o agent_trap.o kernel.o agent_handler.o
...
*** Warning: This system can not link to static lib archive helpers/
libnetsnmphelpers.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system can not link to static lib archive
libnetsnmpagent.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

*** Warning: This system can not link to static lib archive ../snmplib/
libnetsnmp.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
libtool: link: warning: undefined symbols not allowed in i686-pc-cygwin
shared libraries
ar cru .libs/libnetsnmpmibs.a
mibgroup/notification-log-mib/notification_log.o mibgroup/notificatio
n/snmpNotifyTable.o mibgroup/target/snmpTargetAddrEntry.o
mibgroup/target/snmpTargetParamsEntry.o mi
bgroup/target/target.o mibgroup/target/target_counters.o
mibgroup/header_complex.o mibgroup/util_fun
cs.o mib_modules.o auto_nlist.o
ranlib .libs/libnetsnmpmibs.a
creating libnetsnmpmibs.la
(cd .libs && rm -f libnetsnmpmibs.la && ln -s ../libnetsnmpmibs.la
libnetsnmpmibs.la)
: libnetsnmpmibs.la
/bin/sh ../libtool  --mode=compile gcc -I../include -I. -I../agent
-I../agent/mibgroup -I../snmplib
  -g -O2 -Ucygwin -Dcygwin=cygwin  -c -o snmpd.lo snmpd.c
 gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -g -O2
-Ucygwin -Dcygwin=cygwin -c
 snmpd.c  -DDLL_EXPORT -DPIC -o .libs/snmpd.o
snmpd.c: In function `main':
snmpd.c:963: warning: assignment discards qualifiers from pointer target
type
 gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -g -O2
-Ucygwin -Dcygwin=cygwin -c
 snmpd.c -o snmpd.o >/dev/null 2>&1
/bin/sh ../libtool  --mode=link gcc -g -O2 -Ucygwin -Dcygwin=cygwin  -o
snmpd.exe snmpd.lo  -L../snm
plib/.libs -L../snmplib -L./.libs -L./helpers/.libs -L./helpers
libnetsnmpagent.la helpers/libnetsn
mphelpers.la libnetsnmpmibs.la ../snmplib/libnetsnmp.la  -liphlpapi
gcc -g -O2 -Ucygwin -Dcygwin=cygwin -o snmpd.exe .libs/snmpd.o
-L/home/test/net-snmp-5.4.2.1/agen
t/.libs -L/home/test/net-snmp-5.4.2.1/agent/helpers/.libs
-L/home/test/net-snmp-5.4.2.1/snmplib/
.libs -L/home/test/net-snmp-5.4.2.1/snmplib
-L/home/test/net-snmp-5.4.2.1/agent/helpers ./.libs/
libnetsnmpagent.a helpers/.libs/libnetsnmphelpers.a ./.libs/libnetsnmpmibs.a
/home/test/net-snmp-5
.4.2.1/agent/helpers/.libs/libnetsnmphelpers.a
/home/test/net-snmp-5.4.2.1/agent/.libs/libnetsnmpa
gent.a /home/test/net-snmp-5.4.2.1/snmplib/.libs/libnetsnmp.a
../snmplib/.libs/libnetsnmp.a -liphl
papi
.libs/snmpd.o(.text+0x1ee4): In function `receive':
/home/test/net-snmp-5.4.2.1/agent/snmpd.c:1112: undefined reference to
`_sigrelse'
./.libs/libnetsnmpagent.a(agent_read_config.o)(.text+0x550): In function
`update_config':
/home/test/net-snmp-5.4.2.1/agent/agent_read_config.c:285: undefined
reference to `_vacm_standard_
views'
./.libs/libnetsnmpmibs.a(util_funcs.o)(.text+0x3d1): In function
`get_exec_output':
/home/test/net-snmp-5.4.2.1/agent/mibgroup/util_funcs.c:277: undefined
reference to `_run_exec_com
mand'
./.libs/libnetsnmpmibs.a(snmpNotifyTable.o)(.text+0x4a): In function
`_checkFilter':
/home/test/net-snmp-5.4.2.1/agent/mibgroup/notification/snmpNotifyTable.c:122:
undefined reference
 to `_get_FilterProfileName'
./.libs/libnetsnmpmibs.a(snmpNotifyTable.o)(.text+0x5c):/home/test/net-snmp-5.4.2.1/agent/mibgroup
/notificati

Net-SNMP 5.4.3.2.1 V3 encryption and decrytion code

2010-05-07 Thread Piljoo Choi

Hi all,

Is anymore who knows what c code does v3 encryption and decryption such as the 
type 'AES' in net-snmp-5.4.2.1? I want to look at the logic but so far I have 
no luck to find the code. What file does have the logic?

Thanks,

Piljoo
  --

___
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


Re: Net-SNMP 5.4.3.rc2 and 5.2.6.rc2 available for testing

2010-05-07 Thread Dave Shield
On 6 May 2010 17:12, Bart Van Assche  wrote:
> There is one open issue for the V5.4 branch I'm absolutely not happy with:
> http://www.mail-archive.com/net-snmp-users@lists.sourceforge.net/msg25049.html.

That seems to be a consequence of patch #2890931
(to add support of Counter64 values within the perl module).

I've had a quick attempt to add 'snmplib/strtoull.c' to the Win32 build
environment, but without any success.   I'm inclined to reverse the
above patch (and re-open the tracker entry), so that we can get the
releases out with no further delay.

Unless anyone can provide a fix for the strtoull compilation problem

Note that the only other occurance of this call are as follows:

mibgroup/util_funcs
sctp-mib/sctp{Scalars,Tables}_linux.c
udp-mib/data_access/udp_endpoint_linux.c

  (all Linux-only code)

if-mib/data_access_interface.c

 (any architecture)

Dave

--

___
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


Re: SNMP subagent in C + exec_command or similar

2010-05-07 Thread Dave Shield
2010/5/7 Fulko Hew :
> Since that command line actually had to spawn 3 sub-processes sort of
> daisy-chained,
> perhaps this might work instead (where a single sub-process is created, that
> then creates
> the daisy-chain (note: I haven't tried it, but its a simple experiment):
>
> ( /bin/cat /proc/cpuinfo | /usr/bin/grep vendor_id | /usr/bin/awk '{print
> $3}')


I doubt that will work.
Fundamentally, you need to invoke some form of shell (sh, bash, csh, etc),
since that is what will interpret the pipeline.
   Anything based on "exec" will invoke the binary that's specified first
on the command line - unless this is a shell binary, then it won't understand
the pipeline syntax.

As I said to Harsszegi earlier today, the simplest answer is to use the
utility function 'run_shell_command' which explicitly invokes a shell to
run the specified command.

Dave

--

___
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


Re: SNMP subagent in C + exec_command or similar

2010-05-07 Thread Fulko Hew
2010/5/7 Hársszegi Tibor 

> Hi,
>
> have tried exec_command not much luck :(
> I am trying to run scripts, like
>
> cat /proc/cpuinfo | grep vendor_id | awk '{print $3}'
>
> and similar.
> No matter how I tried using SHPROC or EXECPROC (although I don't really
> see SHPROC being handled at all anywhere in net-snmp)
> I didn't get the pipes being executed at all.
> Naturally I had to replace the command like this:
>
> /bin/cat /proc/cpuinfo | /usr/bin/grep vendor_id | /usr/bin/awk '{print
> $3}'
>
> but the output was
>
> "processor  : 0"
>
> so 'grep' was not taking place at all :(
> Any idea how to overcome this and make sure that system() is called instead
> of execv()
> ?
>

Another thought would be:

Since that command line actually had to spawn 3 sub-processes sort of
daisy-chained,
perhaps this might work instead (where a single sub-process is created, that
then creates
the daisy-chain (note: I haven't tried it, but its a simple experiment):

( /bin/cat /proc/cpuinfo | /usr/bin/grep vendor_id | /usr/bin/awk '{print
$3}')

Fulko
--

___
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


RE: SNMP subagent in C + exec_command or similar

2010-05-07 Thread Hársszegi Tibor
Yeah, actually I've done that :(
Copy-pasted the run_shell_command merely to my agent
(since after all it is just a system() invocation with output piped to a 
temporary file).
Thanks a lot Dave for the hint!!
t.

> -Original Message-
> From: Dave Shield [mailto:d.t.shi...@liverpool.ac.uk]
> Sent: Friday, May 07, 2010 11:41 AM
> To: Hársszegi Tibor
> Cc: net-snmp-users@lists.sourceforge.net
> Subject: Re: SNMP subagent in C + exec_command or similar
>
> 2010/5/7 Hársszegi Tibor :
> > have tried exec_command not much luck :( I am trying to run
> scripts,
> > like
> >
> > cat /proc/cpuinfo | grep vendor_id | awk '{print $3}'
> >
> > and similar.
>
> No - exec_command won't really help you here.
>
> Try using "run_shell_command" instead.
> (See mibgroup/utilities/execute.c for details)
>
> Dave
>



--

___
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


Re: SNMP subagent in C + exec_command or similar

2010-05-07 Thread Dave Shield
2010/5/7 Hársszegi Tibor :
> have tried exec_command not much luck :(
> I am trying to run scripts, like
>
> cat /proc/cpuinfo | grep vendor_id | awk '{print $3}'
>
> and similar.

No - exec_command won't really help you here.

Try using "run_shell_command" instead.
(See mibgroup/utilities/execute.c for details)

Dave

--

___
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


No Such Instance currently exists at this OID

2010-05-07 Thread омар нескажуев
Hi. I have NET-SNMP 5.4.1 installed.
Shortly: I can't get the values in the table
Long story:
I've generated template code with mib2c for tables.
 -mib2c -c mib2c.mfd.conf pTable
Then I started the binary as an subagent:
sudo ./pTable -f -L

I set MIBS env
-export MIBS=+ANU

However, I can't get the values in the table. The following command "snmpget -v 
2c -c public localhost ANU::runTime.0" gives "ANU::runTime.0 = No Such Instance 
currently exists at this OID".


--

___
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


Re: FW: Memory Leaking with NetSNMP V5.5

2010-05-07 Thread Mark Brooks
The patch has removed the problem, Ive run a test for about 12 hours and the
memory usage is now stable.

Thanks

Mark

On 6 May 2010 16:33, Mark Brooks  wrote:

> We may have fixed it, by applying the patch
>
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=2871747&group_id=12694&atid=312694
>
> ill let you know how it goes
>
> Mark
>
>
> On 6 May 2010 16:30, Mike Ayers  wrote:
>
>>
>>A nice detailed leak report.  Coders, can you please investigate?
>>
>>
>>Thanks,
>>
>> Mike
>>
>> -Original Message-
>> From: Mark Brooks [mailto:m...@loadbalancer.org]
>> Sent: Thursday, May 06, 2010 6:33 AM
>> To: Mike Ayers
>> Cc: net-snmp-users@lists.sourceforge.net
>> Subject: Re: Memory Leaking with NetSNMP V5.5
>>
>> Sorry I ment 225 bytes not 255
>>
>>
>> On 6 May 2010 13:59, Mark Brooks  wrote:
>>
>>
>>Ok we have had a further revelation after much testing we were able
>> to work out that there is one particular OID that is leaking 255 bytes of
>> data each time you run snmpwalk the oid in particular is:
>>
>>  
>> .1.3.6.1.2.1.88.1.4.3.1.3.6.95.115.110.109.112.100.95.109.116.101.84.114.105.103.103.101.114.82.105.115.105.110.103
>>or its shorter name is
>>
>> DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerRising'
>>the result of which is -
>>
>>  DISMAN-EVENT-MIB::mteEventNotificationObjects."_snmpd".'_mteTriggerRising'
>> = STRING: _triggerFire
>>
>>we can quite happily run snmpwalk above and below this OID and get
>> consistent memory usage with no sign of a leak.
>>
>>What we cant quite work out is what function is failing to free the
>> memory after its run.
>>
>>any help on how to debug this further would be much appreciated.
>>
>>Mark
>>
>>
>>On 5 May 2010 16:17, Mark Brooks  wrote:
>>
>>
>>
>>Mark
>>
>>
>>
>>
>>
>>On 29 April 2010 00:59, Mike Ayers <
>> mike_ay...@tva.tvworks.com> wrote:
>>
>>
>>> From: Mark Brooks [mailto:
>> m...@loadbalancer.org]
>>> Sent: Wednesday, April 28, 2010 1:27 PM
>>
>>
>>> We are running the 2.6.32.7 kernel with
>> Centos 5.3 and using the LVS
>>> SNMP module
>> http://kb.linuxvirtualserver.org/wiki/Net-SNMP-LVS-Module
>>> the memory usage increases each time we
>> use snmpwalk to poll the system,
>>> and increases with each query until the
>> box crashes. Has anyone else
>>> come across this issue. Or could kindly
>> push us in the right direction
>>> as where to look next.
>>
>>
>>   Run snmpd without the dlmod for the
>> LVS module and try the same test.  If there is no memory leak, then the
>> problem is with with the LVS module, and you'll have to get support from
>> them.  If not, let us know.
>>
>>
>>   HTH,
>>
>>Mike
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
--

___
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


RE: SNMP subagent in C + exec_command or similar

2010-05-07 Thread Hársszegi Tibor
Hi,

have tried exec_command not much luck :(
I am trying to run scripts, like

cat /proc/cpuinfo | grep vendor_id | awk '{print $3}'

and similar.
No matter how I tried using SHPROC or EXECPROC (although I don't really
see SHPROC being handled at all anywhere in net-snmp)
I didn't get the pipes being executed at all.
Naturally I had to replace the command like this:

/bin/cat /proc/cpuinfo | /usr/bin/grep vendor_id | /usr/bin/awk '{print $3}'

but the output was

"processor  : 0"

so 'grep' was not taking place at all :(
Any idea how to overcome this and make sure that system() is called instead of 
execv()
?
Thanks,

> -Original Message-
> From: Wes Hardaker [mailto:harda...@users.sourceforge.net]
> Sent: Thursday, May 06, 2010 10:35 PM
> To: Hársszegi Tibor
> Cc: net-snmp-users@lists.sourceforge.net
> Subject: Re: SNMP subagent in C + exec_command or similar
>
> > On Tue, 4 May 2010 12:22:50 +0200, Hársszegi Tibor
>  said:
>
> HT> I need to create a subagent within C.
> HT> Majority of the code executes 'scripts' like
>
> Well, that architecture will be hard to make work quickly.
> At a minimum I'd suggest using a caching mechanism so you
> don't fire the script off per ever call.
>
> HT> I know that for this only I would NOT need .C agents at all,
> HT> snmpd.conf + extend would be just fine. However it is
> also needed to
> HT> trace whenever someone changes a given OID so that a trap
> event can
> HT> ge sent to a remote host.
>
> (in theory you could also accomplish this by inserting a
> handler somewhere in between the main agent and the
> end-script execution, but that's probably more advanced :-)
>
> The problem with forking is that you'll end up duplicating
> the entire agent memory, which is expensive.
>
> HT> I have also tried to use the exec_command() within
> util_funcs, but I
> HT> can't even use that, as "struct extensible" is not being
> defined in
> HT> any of the publicly available headers.
>
> You can go steal it from the agent/mibgroup directory.  It's
> actually a header we've wanted to install for a long time but
> haven't.  The function is defined in the libnetsnmpmibs
> library when you do your linking.
>
> --
> Wes Hardaker
> Cobham Analytic Solutions
>



--

___
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