Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    NetSNMP::TrapReceiver::register("all", \&my_receiver) || warn "failed 
    +to register\n";
    print STDERR "Loaded the example perl snmptrapd handler\n";
    
  2. or download this
    perl do "/usr/local/share/snmp/mytrapd.pl hello";
    
  3. or download this
    That won't work.  The perl 'do' command only expects a filename.
    
    ...
    perl do /path/to/script
    perl foo("hello world");
    perl foo("now I am passing something different");
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://932914]
Approved by BrowserUk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-12-27 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls