Changeset 6727

Show
Ignore:
Timestamp:
10/06/08 14:20:18 (2 months ago)
Author:
jmathis
Message:

improve GMT use

Location:
trunk/centreon/www/include/views/graphs
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/www/include/views/graphs/graphODS/generateImages/generateODSImage.php

    r6725 r6727  
    301301 
    302302                $command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1"; 
     303         
     304                /* 
     305                 * Add Timezone for current user. 
     306                 */ 
     307                  
     308                $command_line = "export TZ='UTC".$CentreonGMT->getMyGMTForRRD()."' ; ".$command_line; 
     309         
    303310                $command_line = escape_command("$command_line"); 
    304311                if ($oreon->optGen["debug_rrdtool"] == "1") 
  • trunk/centreon/www/include/views/graphs/graphODS/generateImages/generateODSImageZoom.php

    r6725 r6727  
    7474                 * Get GMT for current user 
    7575                 */ 
    76                 $gmt = $CentreonGMT->getMyGMTFromSession($_GET["session_id"]); 
     76                $CentreonGMT->getMyGMTFromSession($_GET["session_id"]); 
    7777                 
    7878                /* 
     
    179179                $cpt = 0; 
    180180                $metrics = array();              
    181                 while ($metric =& $DBRESULT->fetchrow()){ 
     181                while ($metric =& $DBRESULT->fetchrow()) { 
    182182                        if (!isset($_GET["metric"]) || (isset($_GET["metric"]) && isset($_GET["metric"][$metric["metric_id"]])) || isset($_GET["index_id"]) || $pass){ 
    183183                                $metrics[$metric["metric_id"]]["metric_id"] = $metric["metric_id"]; 
     
    278278 
    279279                $command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1"; 
     280                 
     281                /* 
     282                 * Add Timezone for current user. 
     283                 */ 
     284                  
     285                $command_line = "export TZ='CMT".$CentreonGMT->getMyGMTForRRD()."' ; ".$command_line; 
     286         
     287                /* 
     288                 * Escape Special Chars 
     289                 */ 
    280290                $command_line = escape_command("$command_line"); 
     291                 
    281292                if ( $oreon->optGen["debug_rrdtool"] == "1" ) 
    282293                        error_log("[" . date("d/m/Y H:s") ."] RDDTOOL : $command_line \n", 3, $oreon->optGen["debug_path"]."rrdtool.log"); 
    283294 
    284                 //print $command_line; 
    285295                $fp = popen($command_line  , 'r'); 
    286296                if (isset($fp) && $fp ) { 
  • trunk/centreon/www/include/views/graphs/graphODS/generateImages/generateODSMetricImage.php

    r6725 r6727  
    265265 
    266266                $command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1"; 
     267                 
     268                /* 
     269                 * Add Timezone for current user. 
     270                 */ 
     271                  
     272                $command_line = "export TZ='CMT".$CentreonGMT->getMyGMTForRRD()."' ; ".$command_line; 
     273         
    267274                $command_line = escape_command("$command_line"); 
    268275                if ( $oreon->optGen["debug_rrdtool"] == "1" ) 
  • trunk/centreon/www/include/views/graphs/statusGraphs/displayServiceStatus.php

    r6646 r6727  
    2424        require_once $centreon_path."www/DBconnect.php"; 
    2525        require_once $centreon_path."www/class/Session.class.php"; 
     26        require_once $centreon_path."/www/class/centreonGMT.class.php"; 
    2627        require_once $centreon_path."www/class/Oreon.class.php"; 
     28        require_once $centreon_path."www/include/common/common-Func.php"; 
    2729 
    2830        Session::start(); 
    2931        $oreon =& $_SESSION["oreon"]; 
    3032         
    31         require_once $centreon_path."www/include/common/common-Func.php"; 
    32  
     33        $CentreonGMT = new CentreonGMT(); 
     34         
    3335        function getStatusDBDir($pearDBO){ 
    3436                $data =& $pearDBO->query("SELECT `RRDdatabase_status_path` FROM `config` LIMIT 1"); 
     
    4143         */      
    4244 
    43         (!isset($_GET["start"])) ? $start = time() - (60*60*48):$start = $_GET["start"]; 
     45        (!isset($_GET["start"])) ? $start = time() - (60*60*24): $start = $_GET["start"]; 
    4446        (!isset($_GET["end"])) ? $end = time() : $end = $_GET["end"]; 
    4547 
     
    6062                exit; 
    6163        } else { 
     64                 
     65                /* 
     66                 * Get GMT for current user 
     67                 */ 
     68                $CentreonGMT->getMyGMTFromSession($_GET["session_id"]); 
     69          
    6270                /* 
    6371                 * Get Values 
     
    169177                $command_line .= " AREA:ok#19EE11 "; 
    170178                $command_line .= " AREA:unk#FFFFFF "; 
    171                 $command_line .= " COMMENT:\" \\l\" "; 
     179         
     180                /* 
     181                 * Add comment start and end time inf graph footer. 
     182                 */ 
     183                 
     184                $rrd_time  = addslashes($CentreonGMT->getDate("Y\/m\/d G:i", $start)); 
     185                $rrd_time  = str_replace(":", "\:", $rrd_time); 
     186                $rrd_time2 = addslashes($CentreonGMT->getDate("Y\/m\/d G:i", $end)) ; 
     187                $rrd_time2 = str_replace(":", "\:", $rrd_time2); 
     188                $command_line .= " COMMENT:\" From $rrd_time to $rrd_time2 \\c\" "; 
     189                 
     190                $command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1"; 
     191                 
    172192                $command_line .= " LINE1:ok#19EE11:\"Ok\" "; 
    173193                $command_line .= " LINE1:warn#F8C706:\"Warning\" "; 
     
    181201                $command_line .= " GPRINT:v1:AVERAGE:\"Average\:%7.2lf%s\\l\""; 
    182202                 
    183                 $command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1"; 
     203                /* 
     204                 * Add Timezone for current user. 
     205                 */ 
     206                $command_line = "export TZ='CMT".$CentreonGMT->getMyGMTForRRD()."' ; ".$command_line; 
     207         
     208                /* 
     209                 * Escale special char 
     210                 */ 
    184211                $command_line = escape_command("$command_line"); 
     212                 
    185213                if ($oreon->optGen["debug_rrdtool"] == "1") 
    186214                        error_log("[" . date("d/m/Y H:s") ."] RDDTOOL : $command_line \n", 3, $oreon->optGen["debug_path"]."rrdtool.log"); 
    187                 //print $command_line; 
     215                 
    188216                $fp = popen($command_line  , 'r'); 
    189217                if (isset($fp) && $fp ) {