Home Directory Patches Nagios Core nagios embedded perl p1.pl that lets redirect STDOUT

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

nagios embedded perl p1.pl that lets redirect STDOUT

Rating
0 votes
Favoured:
0
Last Release Date
2012-01-10
Compatible With
  • Nagios 2.x
  • Nagios 3.x
Owner
License
GPL
Hits
79048
Files:
FileDescription
p1_new.plcopy this file to p1.pl in nagios/bin (after you backup the original p1.pl !)
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
This is a modified version of p1.pl used by embedded nagios (usually in nagios/bin) that lets perl plugins redirect STDOUT, but only in perl.
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.