#!/usr/bin/perl # place this in a .pl file, and then in your snmpd.conf file put: # perl do '/path/to/file.pl'; use NetSNMP::agent; my $agent; sub myhandler { my ($handler, $registration_info, $request_info, $requests) = @_; my $request; $request->setValue(ASN_OCTET_STRING, "hello\n"); } $agent = new NetSNMP::agent( 'Name' => 'my_agent_name', ); $agent->register( "my_agent_name", ".1.3.6.1.4.1.8072.9999.9999.9999", \&myhandler ); $agent->main_loop();