Hi Every One,
i want to develop an emulator for an SNMP agent.which will act
as an SNMP agent.
This Agent will start and register itself to service then it
will respond to SNMP messages.
Actually i have seen a lot of codes about to implement managers
but my task is to implement responses.
i have the ability to get SNMP command and Can respond them.
For that i am using PERL NetSNMP::Agent API.. i am doing all
the work on Windows.. The problem is this when i run
following code this program does not give any error but this
program does not work.. Means when the manager query to this
code this code does not do any thing...
if any one know about it please respond to it... i shall be
very thankful to him
following is the code:
use NetSNMP::OID (':all');
use NetSNMP::agent(':all');
use NetSNMP::ASN(':all');
my $regOID = new NetSNMP::OID(".1.3.6.1.2.1");
my $agent = new NetSNMP::agent( 'Name' => "test_agent", 'AgentX' =>
1 );
$agent->register("test_agent", $regOID, \&mysql_snmp_handler);
while(1)
{
$agent->agent_check_and_process(1);
}
$agent->shutdown();
sub mysql_snmp_handler {
my ($handler, $registration_info, $request_info, $requests) =
@_;
my ($request);
for($request = $requests; $request; $request = $request->next())
{
print "INSIDE Main Loop\n";
my $val = $request_info->getMode();
}
}
Thanks
salman
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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