When the major part of the perl script's execution time is in loading modules, the embedded perl interpreter doesn't provide any noticeable performance benefit. I have some scripts that spend 99% of the time in 'use Whatever::Module', and would like to speed them up by loading the needed modules beforehand.
So, the question is: Is there any way to load modules into the interpreter, and then access them from the embedded plugin?
This would make the embedded interpreter MUCH more useful. The best would be if the p1.pl script could automagically get the needed module names from the plugin, and load them into the plugin's scope...
Major improvement potential in embedded perl
Re: Major improvement potential in embedded perl
That would make a lot of sense, but i'm not sure how much "doing" it would require. You could probably parse out the perl plugins you're using by looking at Nagios command definitions, then identify the modules the script requires. I don't *think* the embedded interpreter would attempt to load the module twice. Or the embedded interpreter could ignore those stages.
GitHub is really the best place for this sort of discussion. I'd suggest bringing this up on the GitHub page (or I can on your behalf, if you don't have an account):
https://github.com/NagiosEnterprises/nagioscore
GitHub is really the best place for this sort of discussion. I'd suggest bringing this up on the GitHub page (or I can on your behalf, if you don't have an account):
https://github.com/NagiosEnterprises/nagioscore
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/