Editing CGI files in Nagios

Mark Young myoung at nagios.org
Fri Oct 3 05:13:29 CEST 2008


On Oct 2, 2008, at 4:03 PM, Mike Carey wrote:

> Is it possible to customize the avail.cgi file to add things like  
> Title and Logos to the Summary and Availability reports that run?   
> Everytime I try to adjust the avail.cgi file in /usr/local/share/ 
> nagios/sbin on a Ubuntu server, the Availability main report page  
> doesn’t come up anymore.
>
> I’ve tried editing it with both vi and nano.  And I’m just testing  
> it with a simple change, like making Nagios, ALL CAPS, in the frame  
> box just to see if it will work.

Hi Mike,

Nagios CGIs are compiled C programs.  You must be more familiar with  
interpreted language CGIs such as perl.  I am guessing the problem is  
that you accidently modified the binary file 'avail.cgi' with you text  
editor.  You will need to either restore from a backup or reinstall/ 
recompile the Nagios binary files.

So if you are still interested in making your changes, you would  
instead need to point your text editor to the Nagios source code  
('nagios-3.0.3/cgi/avail.c' plus the includes in 'nagios-3.0.3/ 
includes'), edit, then recompile. 'avail.c' and the CGIs in general  
are pretty tricky if you are unfamiliar with nagios and C.

Though it sounds like you may be more interested in adding custom  
headers and footers.  There is some documentation in the nagios docs  
here: http://nagios.sourceforge.net/docs/3_0/cgiincludes.html  It will  
allow you an easier way to insert some amounts of html and  
javascript.  I do not use this feature so there may be others that may  
be able to point you to better resources for its use.

Best of luck!

Mark Young
___
Nagios Enterprises, LLC
Web:    www.nagios.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list