Re: [Nagios-devel] statusmap.cgi and PNG output
Posted: Mon Jun 09, 2003 6:08 pm
The images cannot be generated separately from the existing cgis.
-sg
On Tue, 3 Jun 2003, [iso-8859-15] Jes=FAs M. NAVARRO wrote:
> Hi, list:
>=20
> I'm following on my intent for a drop-in replacement for nagios use=
r=20
> interface.
>=20
> 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. No=
w I'm=20
> trying to make it work with statusmap.cgi.
>=20
> It seems that something like=20
> http://localhost/nagios/cgi-bin/statusm ... reateimag=
e&canvas_x=3D0&canvas_y=3D0&canvas_width=3D593&canvas_height=3D552&ma=
x_width=3D0&max_height=3D0&layout=3D5&layermode=3Dexclude
>=20
> (quite a long URL, isn't it?) does output the PNG image, and I'm tr=
ying to=20
> wrap this invocation within a PHP file by calling the CGI as a comm=
and line=20
> program.
>=20
> For this to work, I do something like this:
> =09=09putenv("REQUEST_METHOD=3DGET");
> =09=09putenv("REMOTE_USER=3Dusername");
> =09=09putenv("QUERY_STRING=3D" . $query_string);
> =09=09=09$cgi=3DCGI_PATH . "statusmap.cgi";
> =09=09=09$cgi_output=3Dsystem($cgi);
>=20
> ...where, as you can imagine, $query_string equals=20
> "host=3Dall&createimage&canvas_x=3D0&canvas_y=3D0&..."
>=20
> This approach does work for "simple" CGIs, like tac.cgi (the Tactic=
al Overview=20
> one). Problem is that the above invocation DOES NOT return just th=
e PNG=20
> "file" but the HTTP headers too (Content-type, no cache, etc.).
>=20
> 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.
>=20
> Well, I hope someone can guide me through this one.
>=20
--=20
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
-sg
On Tue, 3 Jun 2003, [iso-8859-15] Jes=FAs M. NAVARRO wrote:
> Hi, list:
>=20
> I'm following on my intent for a drop-in replacement for nagios use=
r=20
> interface.
>=20
> 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. No=
w I'm=20
> trying to make it work with statusmap.cgi.
>=20
> It seems that something like=20
> http://localhost/nagios/cgi-bin/statusm ... reateimag=
e&canvas_x=3D0&canvas_y=3D0&canvas_width=3D593&canvas_height=3D552&ma=
x_width=3D0&max_height=3D0&layout=3D5&layermode=3Dexclude
>=20
> (quite a long URL, isn't it?) does output the PNG image, and I'm tr=
ying to=20
> wrap this invocation within a PHP file by calling the CGI as a comm=
and line=20
> program.
>=20
> For this to work, I do something like this:
> =09=09putenv("REQUEST_METHOD=3DGET");
> =09=09putenv("REMOTE_USER=3Dusername");
> =09=09putenv("QUERY_STRING=3D" . $query_string);
> =09=09=09$cgi=3DCGI_PATH . "statusmap.cgi";
> =09=09=09$cgi_output=3Dsystem($cgi);
>=20
> ...where, as you can imagine, $query_string equals=20
> "host=3Dall&createimage&canvas_x=3D0&canvas_y=3D0&..."
>=20
> This approach does work for "simple" CGIs, like tac.cgi (the Tactic=
al Overview=20
> one). Problem is that the above invocation DOES NOT return just th=
e PNG=20
> "file" but the HTTP headers too (Content-type, no cache, etc.).
>=20
> 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.
>=20
> Well, I hope someone can guide me through this one.
>=20
--=20
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]