NotePage, Inc. Forum Index

SNMP Agent development

 
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> General Questions and Announcements
View previous topic :: View next topic  
Author Message
bth_khan



Joined: 25 Feb 2007
Posts: 1

PostPosted: Sun Feb 25, 2007 7:58 pm    Post subject: SNMP Agent development Reply with quote

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


Back to top
View user's profile Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> General Questions and Announcements All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


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