|Perl Monk, Perl Meditation|
Getting a NetSNMP::TrapReceiver registered function to accept a command line argumentby Limbic~Region (Chancellor)
|on Oct 21, 2011 at 14:26 UTC||Need Help??|
Limbic~Region has asked for the
wisdom of the Perl Monks concerning the following question:
Consider this trivial modification to the example in the NetSNMP::TrapReceiver documentation.
With the following trivial modification to the snmprapd.conf file.
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 information that I don't want hard coded into the code. I could of course hard code the path to the configuration file which I have done as a work around but I am wondering if anyone knows how to make this DWIM?
Update: I have received the following response from the module author which may mean what I am trying to accomplish is impossible unless kill -HUP <pid> causes the snmptrapd daemon to re-read the configuration file and re-register the function.
Update 2: The author has told me that kill -HUP <pid> doesn't do what I want so the best I can hope for is hard coding the path to the configuration file in the script and then having the function periodically reload it.
Cheers - L~R