Hello,

I'm using NetSNMP-5.2 on Windows. I installed the compiled version available on 
Sourceforge.

I wrote a simple perl agent as it follows:

#! perl -w
use strict;
use SNMP;
$SNMP::debugging= 3;
$SNMP::auto_init_mib= 1;
$SNMP::dump_packet= 1;

use NetSNMP::agent;
my $agent= new NetSNMP::agent(Name => 'test');
SNMP::initMib();

sub handler($$$$) {
  my ($handler, $registration_info, $request_info, $reqests)= @_;
  print "In handler\n";
}

$agent->register('test', "internet", \&handler);

while (1) {
   print "***********************\n***********************\n";
   $agent->agent_check_and_process(1);
   print "+++++++++++++++++++++++\n+++++++++++++++++++++++\n";
   Win32::Sleep(500);
}

exit(0);

My configuration files are:
# test.conf
agentaddress udp:8000
rwcommunity public

#snmp.conf
defVersion 1
mibdirs C:/usr/share/snmp/mibs
persistentDir C:/usr/snmp/persist
tempFilePattern C:/usr/temp/snmpdXXXXXX

When I send a get request (for instance snmpget -v 1 -c public localhost:8000 
sysLocation.0), the perl agent does not respond: I cannot read "In handler" in 
the console, whereas this configuration works on Linux.
I get interesting debugging lines:

callback: START calling callbacks for maj=1 min=5
trace:  ..\..\snmplib\callback.c, 219:
callback: calling a callback for maj=1 min=5
trace:  ..\..\agent\mibgroup\mibII\vacm_conf.c, 708:
mibII/vacm_vars: vacm_in_view: ver=0, community=public
trace:  ..\..\agent\mibgroup\mibII\vacm_conf.c, 806:
mibII/vacm_vars: vacm_in_view: *******************No security name 
found***************
trace:  ..\..\snmplib\callback.c, 231:
callback: END calling callbacks for maj=1 min=5 (1 called)

Note: I added the *******************.

but I'm enable to make this script work.

Any ideas ?

Ga�l

This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to