Beefy Boxes and Bandwidth Generously Provided by pair Networks
RobOMonk P is for Practical  Getting a NetSNMP::TrapReceiver
registered function to accept a command line argument  by
Limbic~Region (Chancellor) on Oct 21, 2011 at 14:26 UTC
( #932914=perlquestion: print w/ replies, xml ) Need Help??
Consider this trivial modification to the example in the
NetSNMP::TrapReceiver documentation. #!/usr/bin/perl my
$greeting = $ARGV[0] // '********** PERL RECEIVED A
NOTIFICATION:'; sub my_receiver { print $greeting, "\n"; }
NetSNMP::TrapReceiver::register("all", \&my_receiver) || warn
"failed +to register\n"; print STDERR "Loaded the example perl
snmptrapd handler\n"; With the following trivial modification to
the snmprapd.conf file. perl do "/usr/local/share/snmp/ hello";
This modification doesn't work (no output is produced and as far
as I can tell, my handler is not being called). In my real world
scenario, the command line argument happens to be a
configuration file that contains extensive configuration informa