[Nagios-devel] statusmap.cgi and PNG output

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.
Locked
Guest

[Nagios-devel] statusmap.cgi and PNG output

Post by Guest »

Hi, list:

I'm following on my intent for a drop-in replacement for nagios user=20
interface.

Rigth now, V 0.4.8 (released today) is able to manage cmd.cgi, and only=20
pendant question is how to manage those CGIs that embed images. Now I'm=20
trying to make it work with statusmap.cgi.

It seems that something like=20
http://localhost/nagios/cgi-bin/statusm ... ge&canvas=
_x=3D0&canvas_y=3D0&canvas_width=3D593&canvas_height=3D552&max_width=3D0&ma=
x_height=3D0&layout=3D5&layermode=3Dexclude

(quite a long URL, isn't it?) does output the PNG image, and I'm trying to=
=20
wrap this invocation within a PHP file by calling the CGI as a command line=
=20
program.

=46or this to work, I do something like this:
putenv("REQUEST_METHOD=3DGET");
putenv("REMOTE_USER=3Dusername");
putenv("QUERY_STRING=3D" . $query_string);
$cgi=3DCGI_PATH . "statusmap.cgi";
$cgi_output=3Dsystem($cgi);

=2E..where, as you can imagine, $query_string equals=20
"host=3Dall&createimage&canvas_x=3D0&canvas_y=3D0&..."

This approach does work for "simple" CGIs, like tac.cgi (the Tactical Overv=
iew=20
one). Problem is that the above invocation DOES NOT return just the PNG=20
"file" but the HTTP headers too (Content-type, no cache, etc.).

Though I had a look at the statusmap source code, I haven been able to=20
discover if there's any way to call the CGI so it just returns the plain=20
image, so I can return it to the client browser the way it have to.

Well, I hope someone can guide me through this one.
=2D-=20
SALUD,
Jes=FAs
***
[email protected]
***






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked