My "Premature end of script headers" and/or "

I recently had trouble with nagios not showing anything when using the trends and/or the histogram.cgi. The apache error log shows a “Premature end of script headers” error.

cd /usr/local/nagios/sbin
ldd trends.cgi
The output was lengthy but one line shows and error "libiconv.so.2 => not found"
slocate libiconv.so.2
shows it in /usr/local/lib/libiconv.so.2
vi /etc/ld.so.conf
shows that /usr/local/lib is not in this config file so I added /usr/local/lib
Then ran
ldconfig

Problem solved.

Try this if you are getting that message. I know read the manuel!!!)

  1. Modify SELinux Settings
    Fedora ships with SELinux (Security Enhanced Linu:evil: installed and in Enforcing mode by default. This can result in “Internal Server Error” messages when you attempt to access the Nagios CGIs.
    See if SELinux is in Enforcing mode.
    getenforce

Put SELinux into Permissive mode.
setenforce 0

To make this change permanent, you’ll have to modify the settings in /etc/selinux/config and reboot.
Instead of disabling SELinux or setting it to permissive mode, you can use the following command to run the CGIs under SELinux enforcing/targeted mode:
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

For information on running the Nagios CGIs under Enforcing mode with a targeted policy, visit the NagiosCommunity.org wiki at nagioscommunity.org/wiki.

nagios.sourceforge.net/docs/3_0/ … edora.html