source: branches/0.4/web/addons/job_monarch/graph.php @ 796

Last change on this file since 796 was 796, checked in by ramonb, 11 years ago
  • Property svn:keywords set to Id
File size: 17.9 KB
RevLine 
[143]1<?php
[225]2/*
3 *
4 * This file is part of Jobmonarch
5 *
6 * Copyright (C) 2006  Ramon Bastiaans
7 *
8 * Jobmonarch is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * Jobmonarch is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 *
[231]22 * SVN $Id: graph.php 796 2013-04-06 12:44:23Z ramonb $
[225]23 */
24
[761]25global $rrds, $start, $r, $conf, $m;
[143]26
[409]27include "./libtoga.php";
28
[761]29# Graph specific variables
30$size = escapeshellcmd( rawurldecode( $_GET["z"] ));
31$graph = escapeshellcmd( rawurldecode( $_GET["g"] ));
32$grid = escapeshellcmd( rawurldecode( $_GET["G"] ));
33$self = escapeshellcmd( rawurldecode( $_GET["me"] ));
34$max = escapeshellcmd( rawurldecode( $_GET["x"] ));
35$min = escapeshellcmd( rawurldecode( $_GET["n"] ));
36$value = escapeshellcmd( rawurldecode( $_GET["v"] ));
37$load_color = escapeshellcmd( rawurldecode( $_GET["l"] ));
38$vlabel = escapeshellcmd( rawurldecode( $_GET["vl"] ));
39$j_title = escapeshellcmd( rawurldecode( $_GET["t"] ));
40$hostname = escapeshellcmd( rawurldecode( $_GET["h"] ));
41$range = escapeshellcmd( rawurldecode( $_GET["r"] ));
[751]42
[761]43if( strpos( $size, 'overview' ) )
44{
45    $my_dir = getcwd();
[751]46
[761]47    global $context;
[751]48
[761]49    $context = 'host';
[751]50
[761]51    chdir( $GANGLIA_PATH );
[751]52
[761]53    include "./ganglia.php";
54    include "./get_ganglia.php";
[751]55
[761]56    chdir( $my_dir );
57}
58
[717]59if ( !empty( $_GET ) ) 
60{
[143]61        extract( $_GET );
62}
63
[409]64$sourcetime = $st;
65
[143]66
[145]67$cluster = $c;
68$metricname = ($g) ? $g : $m;
69
[143]70# Assumes we have a $start variable (set in get_context.php).
[717]71if ($size == "small") 
72{
73    $height = 40;
74    $width = 130;
75} 
76else if ($size == "medium") 
77{
78    $height = 75;
79    $width = 300;
80} 
[731]81else if ($size == "overview-medium") 
82{
83    $height = 75;
84    $width = 300;
85} 
[717]86else 
87{
88    $height = 100;
89    $width = 400;
[145]90}
[143]91
[796]92// RB: Perform some formatting/spacing magic.. tinkered to fit
93//
94if ($size == 'small') {
95   $eol1 = '\\l';
96   $space1 = ' ';
97   $space2 = '         ';
98} else if ($size == 'medium') {
99   $eol1 = '';
100   $space1 = ' ';
101   $space2 = '';
102} else if ($size == 'overview-medium') {
103   $eol1   = '';
104   $space1 = '';
105   $space2 = '';
106   $extras = ' --font LEGEND:7';
107} else if ($size == 'large') {
108   $eol1 = '';
109   $space1 = '       ';
110   $space2 = '       ';
111} else if ($size == 'xlarge') {
112   $eol1 = '';
113   $space1 = '             ';
114   $space2 = '             ';
115} else if ($size == 'mobile') {
116   $eol1 = '';
117   $space1 = ' ';
118   $space2 = '';
119}
120
[795]121$jobstart_color = "3AE302";
122$jobstop_color = "F5164A";
[731]123
[717]124if($command) 
125{
[145]126      $command = '';
127}
[143]128
[145]129$graph = $metricname;
[143]130
[731]131$rrd_dirs = Array();
132
[717]133if (isset($graph)) 
134{
135    $series = '';
[739]136    if( $size == 'overview-medium' )
[717]137    {
[739]138        $rrd_dirs[] = $conf['rrds'] . '/' . $cluster .'/'. $hostname;
[717]139    }
[739]140    else
141    {
142        $trd = new TarchRrdGraph( $cluster, $hostname );
143        $rrd_dirs = $trd->getRrdDirs( $period_start, $period_stop );
[779]144
[739]145    }
[143]146
[717]147    if($graph == "cpu_report") 
148    {
[433]149
[717]150        $style = "CPU";
[143]151
[717]152        $upper_limit = "--upper-limit 100 --rigid";
153        $lower_limit = "--lower-limit 0";
[143]154
[717]155        $vertical_label = "--vertical-label Percent ";
[143]156
[717]157        $def_nr = 0;
[143]158
[717]159        foreach( $rrd_dirs as $rrd_dir ) 
160        {
[143]161
[717]162            if( $def_nr == 0 ) 
163            {
[143]164
[717]165                $user_str = ":'User CPU'";
166                $nice_str = ":'Nice CPU'";
167                $system_str = ":'System CPU'";
168                $wio_str = ":'WAIT CPU'";
169                $idle_str = ":'Idle CPU'";
170            } 
171            else 
172            {
[143]173
[717]174                $user_str = "";
175                $nice_str = "";
176                $system_str = "";
177                $wio_str = "";
178                $idle_str = "";
179            }
[143]180
[717]181            $series .= "DEF:'cpu_user${def_nr}'='${rrd_dir}/cpu_user.rrd':'sum':AVERAGE "
182                ."DEF:'cpu_nice${def_nr}'='${rrd_dir}/cpu_nice.rrd':'sum':AVERAGE "
183                ."DEF:'cpu_system${def_nr}'='${rrd_dir}/cpu_system.rrd':'sum':AVERAGE "
184                ."DEF:'cpu_idle${def_nr}'='${rrd_dir}/cpu_idle.rrd':'sum':AVERAGE "
[731]185                ."AREA:'cpu_user${def_nr}'#".$conf['cpu_user_color']."${user_str} "
186                ."STACK:'cpu_nice${def_nr}'#".$conf['cpu_nice_color']."${nice_str} "
187                ."STACK:'cpu_system${def_nr}'#".$conf['cpu_system_color']."${system_str} ";
[143]188
[717]189            if (file_exists("$rrd_dir/cpu_wio.rrd")) 
190            {
191                $series .= "DEF:'cpu_wio${def_nr}'='${rrd_dir}/cpu_wio.rrd':'sum':AVERAGE "
[731]192                    ."STACK:'cpu_wio${def_nr}'#".$conf['cpu_wio_color']."${wio_str} ";
[717]193            }
[143]194
[731]195            $series .= "STACK:'cpu_idle${def_nr}'#".$conf['cpu_idle_color']."${idle_str} ";
[143]196
[717]197            $def_nr++;
198        }
[143]199
[717]200    } 
201    else if ($graph == "job_report") 
202    {
203        $style = "Jobs";
[409]204
[717]205        $lower_limit = "--lower-limit 0 --rigid";
206        $vertical_label = "--vertical-label Jobs";
[409]207
[717]208        $def_nr = 0;
[409]209
[761]210        $rrd_dir = $conf['rrds'] . "/$clustername/$hostname/";
[409]211
[726]212        $rj_rrd    = $rrd_dir . "zplugin_monarch_rj.rrd";
213        $qj_rrd    = $rrd_dir . "zplugin_monarch_qj.rrd";
[409]214
[717]215        $sorted_hosts    = array();
[738]216        $sorted_hosts[]  = $rjqj_host;
[409]217
[717]218        $rj_str = ":'Running Jobs'";
219        $qj_str = ":'Queued Jobs'";
[409]220
[717]221        $series .= "DEF:'running_jobs'='${rj_rrd}':'sum':AVERAGE "
[796]222            ."DEF:'queued_jobs'='${qj_rrd}':'sum':AVERAGE ";
[409]223
[717]224       
[796]225        $series .= "LINE3:'running_jobs'#ff0000${rj_str} ";
[409]226
[796]227        if ( $conf['graphreport_stats'] ) 
228        {
229            $series .= "CDEF:running_pos=running_jobs,0,INF,LIMIT "
230                    . "VDEF:running_last=running_pos,LAST "
231                    . "VDEF:running_min=running_pos,MINIMUM "
232                    . "VDEF:running_avg=running_pos,AVERAGE "
233                    . "VDEF:running_max=running_pos,MAXIMUM "
234                    . "GPRINT:'running_last':' ${space1}Now\:%5.0lf' "
235                    . "GPRINT:'running_min':'${space1}Min\:%5.0lf${eol1}' "
236                    . "GPRINT:'running_avg':'${space2}Avg\:%5.0lf' "
237                    . "GPRINT:'running_max':'${space1}Max\:%5.0lf\\l' ";
238        }
239
240        $series .= "LINE3:'queued_jobs'#999999${qj_str} ";
241
242        if ( $conf['graphreport_stats'] ) 
243        {
244            $series .= "CDEF:queued_pos=queued_jobs,0,INF,LIMIT "
245                    . "VDEF:queued_last=queued_pos,LAST "
246                    . "VDEF:queued_min=queued_pos,MINIMUM "
247                    . "VDEF:queued_avg=queued_pos,AVERAGE "
248                    . "VDEF:queued_max=queued_pos,MAXIMUM "
249                    . "GPRINT:'queued_last':'  ${space1}Now\:%5.0lf' "
250                    . "GPRINT:'queued_min':'${space1}Min\:%5.0lf${eol1}' "
251                    . "GPRINT:'queued_avg':'${space2}Avg\:%5.0lf' "
252                    . "GPRINT:'queued_max':'${space1}Max\:%5.0lf\\l' ";
253        }
[717]254    } 
255    else if ($graph == "mem_report") 
256    {
257        $style = "Memory";
[143]258
[717]259        $lower_limit = "--lower-limit 0 --rigid";
[796]260        $extras .= "--base 1024";
[717]261        $vertical_label = "--vertical-label Bytes";
[143]262
[717]263        $def_nr = 0;
[143]264
[717]265        foreach( $rrd_dirs as $rrd_dir ) 
266        {
[143]267
[717]268            if( $def_nr == 0 ) 
269            {
[143]270
[717]271                $memuse_str = ":'Memory Used'";
272                $memshared_str = ":'Memory Shared'";
273                $memcached_str = ":'Memory Cached'";
274                $membuff_str = ":'Memory Buffered'";
275                $memswap_str = ":'Memory Swapped'";
276                $total_str = ":'Total In-Core Memory'";
277            } 
278            else 
279            {
[143]280
[717]281                $memuse_str = "";
282                $memshared_str = "";
283                $memcached_str = "";
284                $membuff_str = "";
285                $memswap_str = "";
286                $total_str = "";
287            }
[143]288
[717]289            $series .= "DEF:'mem_total${def_nr}'='${rrd_dir}/mem_total.rrd':'sum':AVERAGE "
290                ."CDEF:'bmem_total${def_nr}'=mem_total${def_nr},1024,* "
291                ."DEF:'mem_shared${def_nr}'='${rrd_dir}/mem_shared.rrd':'sum':AVERAGE "
292                ."CDEF:'bmem_shared${def_nr}'=mem_shared${def_nr},1024,* "
293                ."DEF:'mem_free${def_nr}'='${rrd_dir}/mem_free.rrd':'sum':AVERAGE "
294                ."CDEF:'bmem_free${def_nr}'=mem_free${def_nr},1024,* "
295                ."DEF:'mem_cached${def_nr}'='${rrd_dir}/mem_cached.rrd':'sum':AVERAGE "
296                ."CDEF:'bmem_cached${def_nr}'=mem_cached${def_nr},1024,* "
297                ."DEF:'mem_buffers${def_nr}'='${rrd_dir}/mem_buffers.rrd':'sum':AVERAGE "
298                ."CDEF:'bmem_buffers${def_nr}'=mem_buffers${def_nr},1024,* "
299                ."CDEF:'bmem_used${def_nr}'='bmem_total${def_nr}','bmem_shared${def_nr}',-,'bmem_free${def_nr}',-,'bmem_cached${def_nr}',-,'bmem_buffers${def_nr}',- "
[731]300                ."AREA:'bmem_used${def_nr}'#".$conf['mem_used_color']."${memuse_str} "
301                ."STACK:'bmem_shared${def_nr}'#".$conf['mem_shared_color']."${memshared_str} "
302                ."STACK:'bmem_cached${def_nr}'#".$conf['mem_cached_color']."${memcached_str} "
303                ."STACK:'bmem_buffers${def_nr}'#".$conf['mem_buffered_color']."${membuff_str} ";
[145]304
[717]305            if (file_exists("$rrd_dir/swap_total.rrd")) 
306            {
307                $series .= "DEF:'swap_total${def_nr}'='${rrd_dir}/swap_total.rrd':'sum':AVERAGE "
308                    ."DEF:'swap_free${def_nr}'='${rrd_dir}/swap_free.rrd':'sum':AVERAGE "
309                    ."CDEF:'bmem_swapped${def_nr}'='swap_total${def_nr}','swap_free${def_nr}',-,1024,* "
[731]310                    ."STACK:'bmem_swapped${def_nr}'#".$conf['mem_swapped_color']."${memswap_str} ";
[717]311            }
[145]312
[731]313            $series .= "LINE2:'bmem_total${def_nr}'#".$conf['cpu_num_color']."${total_str} ";
[145]314
[717]315            $def_nr++;
316        }
[145]317
[717]318    } 
319    else if ($graph == "load_report") 
320    {
321        $style = "Load";
[145]322
[717]323        $lower_limit = "--lower-limit 0 --rigid";
324        $vertical_label = "--vertical-label 'Load/Procs'";
[145]325
[717]326        $def_nr = 0;
[145]327
[717]328        foreach( $rrd_dirs as $rrd_dir ) 
329        {
[145]330
[717]331            if( $def_nr == 0 ) 
332            {
[145]333
[717]334                $load_str = ":'1-min Load'";
335                $cpu_str = ":'CPUs'";
336                $run_str = ":'Running Processes'";
337            } 
338            else 
339            {
340                $load_str = "";
341                $cpu_str = "";
342                $run_str = "";
343            }
[145]344
[717]345            $series .= "DEF:'load_one${def_nr}'='${rrd_dir}/load_one.rrd':'sum':AVERAGE "
346                ."DEF:'proc_run${def_nr}'='${rrd_dir}/proc_run.rrd':'sum':AVERAGE "
347                ."DEF:'cpu_num${def_nr}'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
[731]348            $series .="AREA:'load_one${def_nr}'#".$conf['load_one_color']."${load_str} ";
349            $series .="LINE2:'cpu_num${def_nr}'#".$conf['cpu_num_color']."${cpu_str} ";
350            $series .="LINE2:'proc_run${def_nr}'#".$conf['proc_run_color']."${run_str} ";
[145]351
[717]352            $def_nr++;
353        }
[145]354
[717]355    } 
356    else if ($graph == "network_report") 
357    {
358        $style = "Network";
[145]359
[717]360        $lower_limit = "--lower-limit 0 --rigid";
[796]361        $extras .= "--base 1024";
[717]362        $vertical_label = "--vertical-label 'Bytes/sec'";
[145]363
[717]364        $def_nr = 0;
[145]365
[717]366        foreach( $rrd_dirs as $rrd_dir ) 
367        {
[145]368
[717]369            if( $def_nr == 0 ) 
370            {
[145]371
[717]372                $in_str = ":'In'";
373                $out_str = ":'Out'";
374            } 
375            else 
376            {
[145]377
[717]378                $in_str = "";
379                $out_str = "";
380            }
[145]381
[717]382            $series .= "DEF:'bytes_in${def_nr}'='${rrd_dir}/bytes_in.rrd':'sum':AVERAGE "
383                ."DEF:'bytes_out${def_nr}'='${rrd_dir}/bytes_out.rrd':'sum':AVERAGE "
[731]384                ."LINE2:'bytes_in${def_nr}'#".$conf['mem_cached_color']."${in_str} "
385                ."LINE2:'bytes_out${def_nr}'#".$conf['mem_used_color']."${out_str} ";
[145]386
[717]387            $def_nr++;
388        }
[145]389
[717]390    } 
391    else if ($graph == "packet_report") 
392    {
393        $style = "Packets";
[145]394
[717]395        $lower_limit = "--lower-limit 0 --rigid";
[796]396        $extras .= "--base 1024";
[717]397        $vertical_label = "--vertical-label 'Packets/sec'";
[145]398
[717]399        $def_nr = 0;
[145]400
[717]401        foreach( $rrd_dirs as $rrd_dir ) 
402        {
[145]403
[717]404            if( $def_nr == 0 ) 
405            {
[145]406
[717]407                $in_str = ":'In'";
408                $out_str = ":'Out'";
409            } 
410            else 
411            {
[145]412
[717]413                $in_str = "";
414                $out_str = "";
415            }
[145]416
[717]417            $series .= "DEF:'bytes_in${def_nr}'='${rrd_dir}/pkts_in.rrd':'sum':AVERAGE "
418                ."DEF:'bytes_out${def_nr}'='${rrd_dir}/pkts_out.rrd':'sum':AVERAGE "
[731]419                ."LINE2:'bytes_in${def_nr}'#".$conf['mem_cached_color']."${in_str} "
420                ."LINE2:'bytes_out${def_nr}'#".$conf['mem_used_color']."${out_str} ";
[145]421
[717]422            $def_nr++;
423        }
[145]424
[717]425    } 
426    else 
427    {
428        /* Custom graph */
429        $style = "";
[145]430
[717]431        $subtitle = $metricname;
[736]432        if($context == "host")
[717]433        {
434            if ($size == "small")
435                $prefix = $metricname;
436            else
437                $prefix = $hostname;
[145]438
[717]439            $value = $value>1000 ? number_format($value) : number_format($value, 2);
440        }
[145]441
[717]442        if (is_numeric($max))
443            $upper_limit = "--upper-limit '$max' ";
444        if (is_numeric($min))
445            $lower_limit ="--lower-limit '$min' ";
[145]446
[717]447        if ($vlabel)
448        {
449            $vertical_label = "--vertical-label '$vlabel'";
450        }
451        else 
452        {
453            if ($upper_limit or $lower_limit) 
454            {
455                $max = $max>1000 ? number_format($max) : number_format($max, 2);
456                $min = $min>0 ? number_format($min,2) : $min;
[145]457
[717]458                $vertical_label ="--vertical-label '$min - $max' ";
459            }
460        }
[145]461
[717]462        $def_nr = 0;
[145]463
[717]464        foreach( $rrd_dirs as $rrd_dir ) 
465        {
[145]466
[717]467            if( $def_nr == 0 ) 
468            {
469                $title_str = ":'${subtitle}'";
470            } 
471            else 
472            {
473                $title_str = "";
474            }
[145]475
[717]476            $rrd_file = "$rrd_dir/$metricname.rrd";
477            $series .= "DEF:'sum${def_nr}'='$rrd_file':'sum':AVERAGE "
[731]478                ."AREA:'sum${def_nr}'#".$conf['default_metric_color']."${title_str} ";
[145]479
[717]480            $def_nr++;
481        }
[145]482
[717]483    }
[763]484}
485if( $series != '' ) 
486{
487    if ($job_start)
[717]488    {
[795]489        $series .= "VRULE:${job_start}#${jobstart_color}:'job start':dashes=4,2 ";
[717]490    }
[763]491    if ($job_stop)
492    {
[795]493        $series .= "VRULE:${job_stop}#${jobstop_color}:'job stop':dashes=4,2 ";
[763]494    }
[145]495}
496
[759]497if($graph == "job_report")
[758]498{
[759]499    if($range == 'job' )
500    {
501        $title = "Last: $j_title";
502    }
503    else
504    {
505        $title = "Last: $range";
506    }
[758]507}
508else
509{
510    $title = "$hostname";
511}
[145]512
[717]513function determineXGrid( $p_start, $p_stop ) 
514{
[152]515
[717]516    $period = intval( $p_stop - $p_start );
[152]517
[717]518    // Syntax: <minor_grid_lines_time_declr>:<major_grid_lines_time_declr>:<labels_time_declr>:<offset>:<format>
519    //
520    // Where each <*time_declr*> = <time_type>:<time_interval>
[152]521
[717]522    //$my_lines1 = intval( $period / 3.0 );
523    //$my_lines2 = intval( $period / 6.0 );
[159]524
[717]525    //$my_grid = "SECOND:$my_lines2:SECOND:$my_lines1:SECOND:$my_lines1:0:%R";
[159]526
[717]527    //return "--x-grid $my_grid";
[159]528
[717]529    // Less than 1 minute
530    if( $period < 60 ) 
531    {
[152]532
[717]533        $tm_formt = "%X";
534        $my_grid = "SECOND:15:SECOND:30:SECOND:30:0:$tm_formt";
[152]535
[717]536    // Less than 10 minutes
537    } 
538    else if( $period < 600 ) 
539    {
[152]540
[717]541        $tm_formt = "%R";
542        $my_grid = "MINUTE:1:MINUTE:3:MINUTE:3:0:$tm_formt";
[152]543
[717]544    // Less than 1 hour
545    } 
546    else if( $period < 3600 ) 
547    {
[152]548
[717]549        $tm_formt = "%R";
550        $my_grid = "MINUTE:5:MINUTE:15:MINUTE:15:0:$tm_formt";
[152]551
[717]552    // Less than 15 hour
553    } 
554    else if( $period < 3600 ) 
555    {
[159]556
[717]557        $tm_formt = "%R";
558        $my_grid = "HOUR:1:HOUR:2:HOUR:2:0:$tm_formt";
[159]559
[717]560    // Less than 1 day
561    //
562    } 
563    else if( $period < 86400 ) 
564    {
[152]565
[717]566        $tm_formt = "%R";
567        $my_grid = "HOUR:2:HOUR:5:HOUR:5:0:$tm_formt";
[152]568
[717]569    // Less than 15 days
570    //
571    } 
572    else if( $period < 1296000 ) 
573    {
[152]574
[717]575        $tm_formt = "%e-%m";
576        $my_grid = "HOUR:1:DAY:3:DAY:3:0:'$tm_formt'";
577       
578    // Less than 30 days (a month)
579    //
580    } 
581    else if( $period < 2592000 ) 
582    {
[152]583
[717]584        $tm_formt = "%e-%m";
585        $my_grid = "DAY:5:DAY:10:DAY:10:0:'$tm_formt'";
586    }
[152]587
[717]588    if( isset( $my_grid ) ) 
589    {
[152]590
[717]591        $ret_str = "--x-grid $my_grid";
592        return array($ret_str,$tm_formt);
[152]593
[717]594    } 
595    else 
596    {
597        return array( "", "" );
598    }
[152]599}
600
[193]601$lower_limit = "--lower-limit 0";
[159]602
[734]603if( !isset( $load_color ) or ( $load_color == '') )
604{
605    $load_color = 'FFFFFF';
606}
607
[409]608# Calculate time range.
[733]609if ( isset($sourcetime) )
[409]610{
[717]611    $end = $sourcetime;
612    # Get_context makes start negative.
613    $start = $sourcetime + $start;
[409]614
[717]615    # Fix from Phil Radden, but step is not always 15 anymore.
616    if ($range=="month")
[733]617    {
[717]618        $end = floor($end / 672) * 672;
[733]619    }
620        $command = $conf['rrdtool']. " graph - --start $start --end $end ".
621                "--width $width --height $height $lower_limit ".
622                "--title '$title' $extras $background ".
623                $series;
[409]624}
[733]625else
[717]626{
627    $command = $conf['rrdtool'] . " graph - --start $period_start --end $period_stop ".
[733]628               "--width $width --height $height $lower_limit --color BACK#$load_color ".
629               "--title '$title' $extras $background ".
630               $series;
[409]631}
632
[143]633$debug=0;
634
[733]635
[143]636# Did we generate a command?   Run it.
[717]637if($command) 
638{
639    /*Make sure the image is not cached*/
640    header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");   // Date in the past
641    header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
642    header ("Cache-Control: no-cache, must-revalidate");   // HTTP/1.1
643    header ("Pragma: no-cache");                     // HTTP/1.0
644    if ($debug) 
645    {
646        header ("Content-type: text/html");
647        print "$command\n\n\n\n\n";
648    } 
649    else 
650    {
651        header ("Content-type: image/gif");
652        passthru($command);
653    }
[145]654}
[143]655?>
Note: See TracBrowser for help on using the repository browser.