|
From: Flo G. <fl...@bi...> - 2005-04-20 09:02:29
|
I don't know what you plan to do, but only for displaying the image you=20
don't need php nor curl nor the header() thing. Display the image with a=20
html page including a image:
<img src=3D'http://nagtst01/nagios/cgi-bin/perfchart.png?host=3Doma3a001&..=
=2E'>
If you plan to cache images or want to copy the images automatically, then=
=20
it would be best to call the binary perfchart.png via cron or commandline=
=20
and write the output in a file:
Set the query string as apache would do:
export QUERY_STRING=3D"host=3Dbvba1&service=3DCPU+Load&metric=3Dload15&se=
lect_line=3D1&s_val=3D1&s_smo=3D0&s_war=3D1&s_cri=3D1&s_sta=3D1&g_sigma=3D1=
4.000000&timeperiod=3Dr&reltime=3D00%3A00&reldays=3D1"
execute the cgi:
./perfchart.png > /tmp/test.png
This file then includes the http header. Usually 3 lines. These can be=20
stripped with some shell script:
L=3D`wc -l /tmp/test.png|awk '{print $1}'`
tail -n $((L-2)) /tmp/test.png > /tmp/test_stripped.png
Probably there will be one time a option that surpresses the header=20
output.
Flo
On Mon, 18 Apr 2005 nu...@ts... wrote:
> I was going to try to write something that did that but I'm having
> problems with my syntax. I was going to use PHP. I copied one of the
> URLs created in perfparse and was trying to have the image displayed. I
> have two problems. First, the password has to be sent again. Secondly,
> the output is a bunch of garbage. I am new to PHP and I'm willing to hel=
p
> write something. Let me know what you guys think?
>
> #### HTML Page ####
> <html >
> <head>
> <title>PerfParse Performance Page</title>
> </head>
> <body>
> <?php
> header("Content-type: image/png");
> header("Content-Disposition: inline; ");
> $curl_handle=3Dcurl_init();
> curl_setopt($curl_handle,CURLOPT_URL,'http://nagtst01/nagios/cgi-bin/perf=
chart.png?host=3Doma3a001&service=3DOS+%2D+Load+Average&metric=3Dload1&sele=
ct_line=3D1&s_val=3D0&s_smo=3D1&s_war=3D1&s_cri=3D1&s_sta=3D1&g_sigma=3D14.=
000000&size=3D585x300&output=3DHistogram&timeperiod=3Dr&reltime=3D00%3A00&r=
eldays=3D1&title=3DHost+%27oma3a002%27+++Service+%27OS+%2D+Load+Average%27+=
++Metric+%27load1%27');
> curl_setopt($curl_handle,CURLOPT_USERPWD,'nagios:nagios');
> curl_exec($curl_handle);
> curl_close($curl_handle);
> ?>
> </body>
> </html>
> #### endo of HTML Page ####
>
> If the developers were going to write something...then I will step aside.
>
>
>
>
> schnitzel meister <sch...@gm...>
> 18-Apr-2005 04:30 AM
> Please respond to
> schnitzel meister <sch...@gm...>
>
>
> To
> "nu...@ts..." <nu...@ts...>
> cc
> Ben Clewett <bcl...@pe...>,
> per...@li...
> Subject
> Re: [Perfparse-users] PerfParse Graphs
>
>
>
>
>
>
> Nagiosgraph-style graph icons on the main page would be good too,
> leading to a page where you select which of the metrics for the
> service you want to view.
>
> On 4/14/05, nu...@ts... <nu...@ts...> wrote:
>>
>> In the meantime, has anyone created a CGI program that will generate
>> multiple graphs per URL page. This is a different approach than having
> all
>> of them in the same graph.
>>
>> I'm guessing that a program could generate similar graphs like
> nagiosgraph.
>> Nagiosgraph has a graph for the day, week and by the year. Has anyone
>> attempted that yet?
>>
>> I do like perfparse better.
>>
>>
>>
>>
>> Ben Clewett <bcl...@pe...>
>>
>> 14-Apr-2005 10:18 AM
>>
>> To schnitzel meister <sch...@gm...>
>>
>> cc "nu...@ts..." <nu...@ts...>,
>> per...@li...
>>
>> Subject Re: [Perfparse-users] PerfParse Graphs
>>
>>
>>
>>
>>
>> Schnitzel,
>>
>> This ability was planned from the start. Various starts on this
> problem
>> have been made. This problem is complicated by several issues. One of
>
>> which is a major re-write to the graph drawing program, or replacement
>> by GnuPlot.
>>
>> This was planned in great detail by my self and Yves. Unfortunately
>> neither of us have the time to complete this at this time.
>>
>> The product will one day have a 'Shopping Cart' where the user can
>> select a collection of metrics. This collection will be stored in the
>> database and could be selected to graph in the same way a single metric
>
>> is selected.
>>
>> This collection graph will not show the warn, critical. Just a single
>> line for each metric in various colours. The scale of which will be
>> from one of three options:
>> - By comparison of absolute value. Eg, for disk space.
>> - By comparison of the Max/Min of each metric as a percentage. Eg,
>> server load and user count.
>> - By best-fit, were largest value for each plot in range =3D 100%.
>>
>> The analysis of this problem also showed where some good abstraction
>> points can be built into the software. Eg, for extraction of a data
> set
>> as a memory structure for any use.
>>
>> So this is a large task. Requiring database work, mathematical work,
>> graphical work, and hard-core programming.
>>
>> When we have resources, this is a problem we will attack as soon as we
> can.
>>
>> Regards,
>>
>> Ben
>>
>> schnitzel meister wrote:
>> > Multiple services on one graph would be great.
>> >
>> > There was something about this on the wiki
>> > http://tinyurl.com/46nm8
>> >
>> > On 4/14/05, nu...@ts... <nu...@ts...> wrote:
>> >
>> >>
>> >>To my knowledge, a service can have only one extended information
> URL.
>> If
>> >>you use the perfParse URL for a service it shows one graph.
>> >>
>> >>Has anyone created or know how to have that URL pull up more than one
>> graph?
>> >>* On the same page show a different view of the same data. 1 year, 1
>> month,
>> >>1 day, etc.
>> >>* On the same page show all the services performance data in a
> separate
>> >>graph.
>> >> e.g. Disk space may have more than one
>> >>'label'=3Dvalue[UOM];[warn];[crit];[min];[max] for each
>> >>filesystem
>> >>
>> >>Steve
>> >>Nagios 2.x
>> >>FedoreCore3
>> >
>> >
>> >
>> > -------------------------------------------------------
>> > SF email is sponsored by - The IT Product Guide
>> > Read honest & candid reviews on hundreds of IT Products from real
> users.
>> > Discover which products truly live up to the hype. Start reading now.
>> > http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=CCk
>> > _______________________________________________
>> > Perfparse-users mailing list
>> > Per...@li...
>> >
>> https://lists.sourceforge.net/lists/listinfo/perfparse-users
>> >
>>
>>
>>
>
> |