NotePage, Inc. Forum Index

Search found 1 match
NotePage, Inc. Forum Index
Author Message
  Topic: SNMP Agent development
bth_khan

Replies: 0
Views: 9192

PostForum: General Questions and Announcements   Posted: Sun Feb 25, 2007 7:58 pm   Subject: SNMP Agent development
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
 
Page 1 of 1
All times are GMT - 5 Hours
Jump to:  


Powered by phpBB © 2001, 2002 phpBB Group
Theme created by Vjacheslav Trushkin