SSI problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
pepe_carlos
Posts: 43
Joined: Wed Aug 17, 2011 9:09 am
Location: Madrid, Spain

SSI problem

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SSI problem

Post by tmcdonald »

Are you talking about Server-Side Includes?
Former Nagios employee
pepe_carlos
Posts: 43
Joined: Wed Aug 17, 2011 9:09 am
Location: Madrid, Spain

Re: SSI problem

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SSI problem

Post 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.
pepe_carlos
Posts: 43
Joined: Wed Aug 17, 2011 9:09 am
Location: Madrid, Spain

Re: SSI problem

Post by pepe_carlos »

I used ssi integration for put the custom information.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: SSI problem

Post 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.
pepe_carlos
Posts: 43
Joined: Wed Aug 17, 2011 9:09 am
Location: Madrid, Spain

Re: SSI problem

Post 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>
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SSI problem

Post by tmcdonald »

Please run the following and post the output:

grep -r "Includes" /etc/httpd/
Former Nagios employee
pepe_carlos
Posts: 43
Joined: Wed Aug 17, 2011 9:09 am
Location: Madrid, Spain

Re: SSI problem

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SSI problem

Post 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.
Former Nagios employee
Locked