Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
nagios embedded perl p1.pl that lets redirect STDOUT
2012-01-10
- Nagios 2.x
- Nagios 3.x
GPL
79380
File | Description |
---|---|
p1_new.pl | copy this file to p1.pl in nagios/bin (after you backup the original p1.pl !) |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Normally embedded nagios redirects STDOUT to internal variable and does not let nagios plugins redirect if further. And normally plugins would really not need to do that as they should output status info, etc. However some plugins may use libraries that create separate thread and there want to redirect STDOUT and that is where this modified p1.pl would help. But of course you can also just run those plugins outside of embedded perl.
Please note that this DOES NOT redirect STDOUT for external (non-perl) programs that maybe run with exec() or system() from perl script. For that you need to do dup2. I'm considering rewriting this so it would be possible (either doing dup2() instead of how I did it or catching exec) but have not yet decided as it may result in an unexpected behavior.
For now I'm not going to submit this as a patch to main nagios tree but may do it later if I get back to this and have time to discuss it on dev list.
Please note that this DOES NOT redirect STDOUT for external (non-perl) programs that maybe run with exec() or system() from perl script. For that you need to do dup2. I'm considering rewriting this so it would be possible (either doing dup2() instead of how I did it or catching exec) but have not yet decided as it may result in an unexpected behavior.
For now I'm not going to submit this as a patch to main nagios tree but may do it later if I get back to this and have time to discuss it on dev list.
Reviews (0)
Be the first to review this listing!