Page 1 of 3

SSI problem

Posted: Thu Jan 16, 2014 11:02 am
by pepe_carlos
Hello,

I have the next problem:

I have a Nagios Core (3.5.0) in Red Hat 6.5 and the code in ssi files doesn´t work. I put the simple html code but doesn´t appear

Can anyone help me?

Re: SSI problem

Posted: Thu Jan 16, 2014 11:09 am
by tmcdonald
Are you talking about Server-Side Includes?

Re: SSI problem

Posted: Thu Jan 16, 2014 11:16 am
by pepe_carlos
Yes, I refer to ssi folder, for example, the file extinfo-footer.ssi has the next source code:
<p>IT IS A TEST </p>
I don´t see this text in the extinfo.cgi page.

In other Nagios server (in debian) works

Re: SSI problem

Posted: Thu Jan 16, 2014 4:04 pm
by slansing
Can you provide an example of how/why you would like to use this? I believe PHP takes care of all of this.

Re: SSI problem

Posted: Fri Jan 17, 2014 3:04 am
by pepe_carlos
I used ssi integration for put the custom information.

Re: SSI problem

Posted: Fri Jan 17, 2014 2:36 pm
by slansing
Can you go into a bit more detail on this? What custom information? We're just trying to piece together a picture here.

Re: SSI problem

Posted: Tue Jan 21, 2014 10:34 am
by pepe_carlos
In attached image works you can see the scenario under Ubuntu Server, in this case works:
Works.jpg
Source code of web page in extinfo-info.cgi page (view source code browser option):
...
...
<TR CLASS='comment'><TH CLASS='comment'>Entry Time</TH><TH CLASS='comment'>Author</TH><TH CLASS='comment'>Comment</TH><TH CLASS='comment'>Comment ID</TH><TH CLASS='comment'>Persistent</TH><TH CLASS='comment'>Type</TH><TH CLASS='comment'>Expires</TH><TH CLASS='comment'>Actions</TH></TR>
<TR CLASS='commentOdd'><TD CLASS='commentOdd' COLSPAN='10'>This service has no comments associated with it</TD></TR></TABLE></DIV>
</TD>
</TR>
</TABLE>
</DIV>
<p>IT IS A TEST</p>
</div>

<!-- Produced by Nagios (http://www.nagios.org). Copyright (c) 1999-2007 Ethan Galstad. -->
</body>
</html>

But in RHE 6.5 Server doesn't works;
Doesnt works.jpg
Source code of web page in extinfo-info.cgi page (view source code browser option):
...
...
<TR CLASS='comment'><TH CLASS='comment'>Entry Time</TH><TH CLASS='comment'>Author</TH><TH CLASS='comment'>Comment</TH><TH CLASS='comment'>Comment ID</TH><TH CLASS='comment'>Persistent</TH><TH CLASS='comment'>Type</TH><TH CLASS='comment'>Expires</TH><TH CLASS='comment'>Actions</TH></TR>
<TR CLASS='commentOdd'><TD CLASS='commentOdd' COLSPAN='10'>This service has no comments associated with it</TD></TR></TABLE></DIV>
</TD>
</TR>
</TABLE>
</DIV>

<!-- Produced by Nagios (http://www.nagios.org). Copyright (c) 1999-2007 Ethan Galstad. -->
</body>
</html>

Re: SSI problem

Posted: Tue Jan 21, 2014 5:44 pm
by tmcdonald
Please run the following and post the output:

grep -r "Includes" /etc/httpd/

Re: SSI problem

Posted: Wed Jan 22, 2014 6:00 am
by pepe_carlos
#grep -r "Includes" /etc/httpd/
Binary file /etc/httpd/modules/mod_include.so matches
/etc/httpd/conf/httpd.conf:# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
/etc/httpd/conf/httpd.conf:# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
/etc/httpd/conf/httpd.conf:# (You will also need to add "Includes" to the "Options" directive.)
/etc/httpd/conf/httpd.conf: Options IncludesNoExec
/etc/httpd/conf/httpd.conf: AddOutputFilter Includes html

Re: SSI problem

Posted: Wed Jan 22, 2014 10:47 am
by tmcdonald
Looks like you need "Options +Include" somewhere.

http://www.cyberciti.biz/faq/why-my-apa ... t-working/

This could be a security risk, which is one reason why PHP is usually used for this now. However if you want you can add the .htaccess file in that directory with the appropriate string and it should work. If not, you will need to all overrides in the directory you want to use the SSI in so the .htaccess takes effect.