Changeset 5912

Show
Ignore:
Timestamp:
07/24/08 16:58:52 (2 months ago)
Author:
jmathis
Message:
 
Location:
trunk/centreon/www/include/eventLogs
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/www/include/eventLogs/GetODSXmlLog.php

    r5885 r5912  
    3838        require_once 'DB.php'; 
    3939         
    40         include_once("@CENTREON_ETC@/centreon.conf.php"); 
     40        include_once("/etc/centreon/centreon.conf.php"); 
    4141        include_once($centreon_path . "www/include/eventLogs/common-Func.php"); 
    4242        include_once($centreon_path . "www/DBconnect.php"); 
     
    8181        (isset($_GET["alert"]) && !check_injection($_GET["alert"])) ? set_user_param($contact_id, $pearDB, "log_filter_alert", htmlentities($_GET["alert"])) : $alert = "true"; 
    8282        (isset($_GET["error"]) && !check_injection($_GET["error"])) ? set_user_param($contact_id, $pearDB, "log_filter_error", htmlentities($_GET["error"])) : $error = "false"; 
     83        (isset($_GET["oh"]) && !check_injection($_GET["oh"])) ? set_user_param($contact_id, $pearDB, "log_filter_oh", htmlentities($_GET["oh"])) : $oh = "false"; 
    8384 
    8485        if ($contact_id){ 
     
    120121                $warning = $user_params["log_filter_svc_warning"]; 
    121122                $critical = $user_params["log_filter_svc_critical"]; 
     123                $oh = $user_params["log_filter_oh"]; 
    122124        } 
    123125 
     
    172174        echo "<critical>".$critical."</critical>"; 
    173175        echo "<unknown>".$unknown."</unknown>"; 
     176        echo "<oh>".$oh."</oh>"; 
    174177        echo "</infos>"; 
    175178         
     
    201204                array_push ($msg_status_set, "'UNREACHABLE'"); 
    202205         
    203         if ($ok == 'true' ) 
     206        if ($ok == 'true') 
    204207                array_push ($msg_status_set, "'ok'"); 
    205         if ($warning == 'true' ) 
     208        if ($warning == 'true') 
    206209                array_push ($msg_status_set, "'warning'"); 
    207         if ($critical == 'true' ) 
     210        if ($critical == 'true') 
    208211                array_push ($msg_status_set, "'critical'"); 
    209         if ($unknown == 'true' ) 
     212        if ($unknown == 'true') 
    210213                array_push ($msg_status_set, "'unknown'"); 
    211214         
     
    215218                        $msg_req .= 'OR status is null'; 
    216219                $msg_req .=')'; 
     220        } 
     221 
     222        if ($oh == 'true'){ 
     223                $msg_req .= " AND `type` = 'HARD' "; 
    217224        } 
    218225 
     
    482489 
    483490        echo "<lang>"; 
     491         
    484492        echo "<typeAlert>"._("Type")."</typeAlert>"; 
    485493        echo "<notification>"._("notification")."</notification>"; 
     
    495503        echo "<critical>"._("critical")."</critical>"; 
    496504        echo "<unknown>"._("unknown")."</unknown>"; 
     505        echo "<oh>"._("Only Hard")."</oh>"; 
     506        /* 
     507         * Translation for tables. 
     508         */ 
     509        echo "<d>"._("Day")."</d>"; 
     510        echo "<t>"._("Time")."</t>"; 
     511        echo "<h>"._("Host")."</h>"; 
     512        echo "<s>"._("Status")."</s>"; 
     513        echo "<T>"._("Type")."</T>"; 
     514        echo "<R>"._("Retry")."</R>"; 
     515        echo "<o>"._("Output")."</o>"; 
     516        echo "<c>"._("Contact")."</c>"; 
     517        echo "<C>"._("Cmd")."</C>"; 
     518         
    497519        echo "</lang>"; 
    498520        echo "</root>"; 
  • trunk/centreon/www/include/eventLogs/log.xsl

    r5859 r5912  
    1818                                                                                <xsl:attribute name="name">notification</xsl:attribute> 
    1919                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    20          
    2120                                                                                <xsl:if test="//infos/notification = 'true'"> 
    2221                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    3029                                                                                <xsl:attribute name="name">alert</xsl:attribute> 
    3130                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    32          
    3331                                                                                <xsl:if test="//infos/alert = 'true'"> 
    3432                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    4442                                                                                <xsl:attribute name="name">error</xsl:attribute> 
    4543                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    46          
    4744                                                                                <xsl:if test="//infos/error = 'true'"> 
    4845                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    6663                                                                                <xsl:attribute name="name">up</xsl:attribute> 
    6764                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    68          
    6965                                                                                <xsl:if test="//infos/up = 'true'"> 
    7066                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    7874                                                                                <xsl:attribute name="name">down</xsl:attribute> 
    7975                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    80          
    8176                                                                                <xsl:if test="//infos/down = 'true'"> 
    8277                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    9287                                                                                <xsl:attribute name="name">unreachable</xsl:attribute> 
    9388                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    94          
    9589                                                                                <xsl:if test="//infos/unreachable = 'true'"> 
    9690                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    114108                                                                                <xsl:attribute name="name">ok</xsl:attribute> 
    115109                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    116          
    117110                                                                                <xsl:if test="//infos/ok = 'true'"> 
    118111                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    126119                                                                                <xsl:attribute name="name">warning</xsl:attribute> 
    127120                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    128          
    129121                                                                                <xsl:if test="//infos/warning = 'true'"> 
    130122                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    140132                                                                                <xsl:attribute name="name">critical</xsl:attribute> 
    141133                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    142          
    143134                                                                                <xsl:if test="//infos/critical = 'true'"> 
    144135                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    152143                                                                                <xsl:attribute name="name">unknown</xsl:attribute> 
    153144                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
    154          
    155145                                                                                <xsl:if test="//infos/unknown = 'true'"> 
    156146                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     
    158148                                                                        </xsl:element> 
    159149                                                        <xsl:value-of select="//lang/unknown"/> 
     150                                                </td> 
     151                                        </tr> 
     152                                                </table> 
     153                                        </td> 
     154                                        <td> 
     155                                <xsl:value-of select="//lang/T"/> 
     156                        </td> 
     157                                        <td> 
     158                                                <table> 
     159                                        <tr>                                     
     160                                                <td rowspan="2"> 
     161                                                                        <xsl:element name='input'> 
     162                                                                                <xsl:attribute name="onClick">log_4_host('<xsl:value-of select="//opid"/>', this.form, ''); return false;</xsl:attribute> 
     163                                                                                <xsl:attribute name="name">oh</xsl:attribute> 
     164                                                                                <xsl:attribute name="type">checkbox</xsl:attribute> 
     165                                                                                <xsl:if test="//infos/oh = 'true'"> 
     166                                                                                        <xsl:attribute name="checked">checked</xsl:attribute> 
     167                                                                                </xsl:if> 
     168                                                                        </xsl:element> 
     169                                                        <xsl:value-of select="//lang/oh"/> 
    160170                                                </td> 
    161171                                        </tr> 
     
    176186                                                        <xsl:attribute name="href">#</xsl:attribute> 
    177187                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="first"/>'); return false;</xsl:attribute> 
    178  
    179188                                                        <xsl:element name='img'> 
    180189                                                                <xsl:attribute name="title">first</xsl:attribute>                                                
     
    198207                                        </td> 
    199208                                </xsl:if> 
    200                         <xsl:for-each select="//page"> 
     209                                <xsl:for-each select="//page"> 
    201210                                <td> 
    202211                                        <xsl:element name='a'> 
     
    212221                                        </xsl:element> 
    213222                                </td> 
    214                         </xsl:for-each> 
     223                                </xsl:for-each> 
    215224                                <xsl:if test="next/@show = 'true'"> 
    216225                                        <td> 
     
    231240                                                        <xsl:attribute name="href">#</xsl:attribute> 
    232241                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="last"/>'); return false;</xsl:attribute> 
    233  
    234242                                                        <xsl:element name='img'> 
    235243                                                                <xsl:attribute name="title">last</xsl:attribute>                                                 
     
    246254        <table class="ListTable"> 
    247255                <tr class='ListHeader'> 
    248                         <td class="ListColHeaderCenter">Day</td> 
    249                         <td class="ListColHeaderCenter">Time</td> 
    250                         <td class="ListColHeaderCenter" colspan="2">Host</td> 
    251                         <td class="ListColHeaderCenter">Status</td> 
    252                         <td class="ListColHeaderCenter">Type</td> 
    253                         <td class="ListColHeaderCenter">Retry</td> 
    254                         <td class="ListColHeaderCenter">Output</td> 
    255                         <td class="ListColHeaderCenter">Contact</td> 
    256                         <td class="ListColHeaderCenter">Cmd</td> 
     256                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/d"/></td> 
     257                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/t"/></td> 
     258                        <td class="ListColHeaderLeft" colspan="2"><xsl:value-of select="//lang/h"/></td> 
     259                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/s"/></td> 
     260                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/T"/></td> 
     261                        <td class="ListColHeaderCenter">R</td> 
     262                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/o"/></td> 
     263                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/c"/></td> 
     264                        <td class="ListColHeaderCenter"><xsl:value-of select="//lang/C"/></td> 
    257265                </tr> 
    258266                <xsl:for-each select="//line"> 
    259267                <tr> 
    260268                        <xsl:attribute name="class"><xsl:value-of select="class"/></xsl:attribute> 
    261                         <td style="padding-left:10px;" class="ListColCenter"> 
    262                                 <xsl:value-of select="date"/> 
    263                         </td> 
    264                         <td style="padding-left:10px;" class="ListColCenter"> 
    265                                 <xsl:value-of select="time"/> 
    266                         </td> 
    267                         <td style="padding-left:10px;"> 
    268                                 <xsl:value-of select="host_name"/> 
    269                         </td> 
    270                         <td style="padding-left:10px;"> 
    271                                 <xsl:value-of select="service_description"/> 
    272                         </td> 
    273                         <td style="padding-left:10px;" class="ListColCenter"> 
    274                                 <xsl:attribute name="style"> 
    275                                         background-color:<xsl:value-of select="status/@color"/>; 
    276                                 </xsl:attribute> 
    277                                 <xsl:value-of select="status"/> 
    278                         </td> 
    279                         <td style="padding-left:10px;" class="ListColCenter"> 
    280                                 <xsl:value-of select="type"/> 
    281                         </td> 
    282                         <td style="padding-left:10px;" class="ListColCenter"> 
    283                                 <xsl:value-of select="retry"/> 
    284                         </td> 
    285                         <td style="padding-left:10px;"> 
    286                                 <xsl:value-of select="output"/> 
    287                         </td> 
    288                         <td style="padding-left:10px;"> 
    289                                 <xsl:value-of select="contact"/> 
    290                         </td> 
    291                         <td style="padding-left:10px;White-Space: Nowrap;"> 
    292                                 <xsl:value-of select="contact_cmd"/> 
    293                         </td> 
     269                        <td style="padding-left:5px;" class="ListColCenter"><xsl:value-of select="date"/></td> 
     270                        <td style="padding-left:5px;" class="ListColCenter"><xsl:value-of select="time"/></td> 
     271                        <td style="padding-left:5px;" ><xsl:value-of select="host_name"/></td> 
     272                        <td style="padding-left:5px;" ><xsl:value-of select="service_description"/></td> 
     273                        <td style="padding-left:5px;" class="ListColCenter"><xsl:attribute name="style">background-color:<xsl:value-of select="status/@color"/>;</xsl:attribute><xsl:value-of select="status"/></td> 
     274                        <td style="padding-left:5px;padding-right:5px;" class="ListColCenter"><xsl:value-of select="type"/></td> 
     275                        <td style="padding-left:5px;padding-right:5px;" class="ListColCenter"><xsl:value-of select="retry"/></td> 
     276                        <td style="padding-left:5px;white-space:nowrap;" ><xsl:value-of select="output"/></td> 
     277                        <td style="padding-left:5px;" ><xsl:value-of select="contact"/></td> 
     278                        <td style="padding-left:5px;White-Space: Nowrap;"><xsl:value-of select="contact_cmd"/></td> 
    294279                </tr> 
    295280                </xsl:for-each> 
    296281        </table> 
     282        </div> 
     283        <div class="pagination"> 
     284                <table> 
     285                        <tr> 
     286                                <xsl:if test="first/@show = 'true'"> 
     287                                        <td> 
     288                                                <xsl:element name='a'> 
     289                                                        <xsl:attribute name="href">#</xsl:attribute> 
     290                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="first"/>'); return false;</xsl:attribute> 
     291                                                        <xsl:element name='img'> 
     292                                                                <xsl:attribute name="title">first</xsl:attribute>                                                
     293                                                                <xsl:attribute name="alt">first</xsl:attribute>                                          
     294                                                                <xsl:attribute name="src">./img/icones/16x16/arrow_left_blue_double.gif</xsl:attribute>                                          
     295                                                        </xsl:element> 
     296                                                </xsl:element> 
     297                                        </td> 
     298                                </xsl:if> 
     299                                <xsl:if test="prev/@show = 'true'"> 
     300                                        <td> 
     301                                                <xsl:element name='a'> 
     302                                                        <xsl:attribute name="href">#</xsl:attribute> 
     303                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="prev"/>'); return false;</xsl:attribute> 
     304                                                        <xsl:element name='img'> 
     305                                                                <xsl:attribute name="title">previous</xsl:attribute>                                             
     306                                                                <xsl:attribute name="alt">previous</xsl:attribute>                                               
     307                                                                <xsl:attribute name="src">./img/icones/16x16/arrow_left_blue.gif</xsl:attribute>                                                 
     308                                                        </xsl:element> 
     309                                                </xsl:element> 
     310                                        </td> 
     311                                </xsl:if> 
     312                                <xsl:for-each select="//page"> 
     313                                <td> 
     314                                        <xsl:element name='a'> 
     315                                                <xsl:attribute name="href">#</xsl:attribute> 
     316                                                <xsl:if test="selected = 0"> 
     317                                                        <xsl:attribute name="class">otherPageNumber</xsl:attribute> 
     318                                                </xsl:if> 
     319                                                <xsl:if test="selected = 1"> 
     320                                                        <xsl:attribute name="class">currentPageNumber</xsl:attribute> 
     321                                                </xsl:if> 
     322                                                <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="num"/>'); return false;</xsl:attribute> 
     323                                                <xsl:value-of select="label_page"/> 
     324                                        </xsl:element> 
     325                                </td> 
     326                                </xsl:for-each> 
     327                                <xsl:if test="next/@show = 'true'"> 
     328                                        <td> 
     329                                                <xsl:element name='a'> 
     330                                                        <xsl:attribute name="href">#</xsl:attribute> 
     331                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="next"/>'); return false;</xsl:attribute> 
     332                                                        <xsl:element name='img'> 
     333                                                                <xsl:attribute name="title">next</xsl:attribute>                                                 
     334                                                                <xsl:attribute name="alt">next</xsl:attribute>                                           
     335                                                                <xsl:attribute name="src">./img/icones/16x16/arrow_right_blue.gif</xsl:attribute>                                                
     336                                                        </xsl:element> 
     337                                                </xsl:element> 
     338                                        </td> 
     339                                </xsl:if> 
     340                                <xsl:if test="last/@show = 'true'"> 
     341                                        <td> 
     342                                                <xsl:element name='a'> 
     343                                                        <xsl:attribute name="href">#</xsl:attribute> 
     344                                                        <xsl:attribute name="onClick">log_4_host_page('<xsl:value-of select="//opid"/>', this.form,'<xsl:value-of select="last"/>'); return false;</xsl:attribute> 
     345 
     346                                                        <xsl:element name='img'> 
     347                                                                <xsl:attribute name="title">last</xsl:attribute>                                                 
     348                                                                <xsl:attribute name="alt">last</xsl:attribute>                                           
     349                                                                <xsl:attribute name="src">./img/icones/16x16/arrow_right_blue_double.gif</xsl:attribute>                                                 
     350                                                        </xsl:element> 
     351                                                </xsl:element> 
     352                                        </td> 
     353                                </xsl:if> 
     354                        </tr> 
     355                </table> 
    297356        </div> 
    298357</div> 
  • trunk/centreon/www/include/eventLogs/viewLog.ihtml

    r5859 r5912  
    44<div id="div1"> 
    55<form name="formu"> 
    6                 <table class="period"> 
     6        <table class="period"> 
    77        <tr> 
    8                 <td> 
    9                         <input type="radio" name="period_choice" value="auto"> 
    10  
    11                        {$form.period.label} 
    12                                 &nbsp; 
    13                                 {$form.period.html} 
    14                                  
    15                         </td> 
    16                          
     8                <td><input type="radio" name="period_choice" value="auto">&nbsp;&nbsp;<b>{$form.period.label}</b>&nbsp;&nbsp;{$form.period.html}</td> 
    179                        <td> 
    1810                                <input type="radio" name="period_choice" value="custom" CHECKED> 
    19                                 {$From} 
     11                                &nbsp;&nbsp;<b>{$From}</b> 
     12                                &nbsp;&nbsp;<input id="StartDate" name="StartDate" type="text" value="" onclick="displayDatePicker('StartDate', this)" size="8" /> 
     13                                &nbsp;<input id="StartTime" name="StartTime" type="text" value="" onclick="displayTimePicker('StartTime', this)" size="5" /> 
    2014                                &nbsp; 
    21                                 <input id="StartDate" name="StartDate" type="text" value="" onclick="displayDatePicker('StartDate', this)" size="8" /> 
    22                                 &nbsp; 
    23                                 <input id="StartTime" name="StartTime" type="text" value="" onclick="displayTimePicker('StartTime', this)" size="5" /> 
    24                                 &nbsp; 
    25                                 {$To} 
    26                                 &nbsp; 
    27                                 <input id="EndDate" name="EndDate" type="text" value="" onclick="displayDatePicker('EndDate', this)" size="8" /> 
    28                                 &nbsp; 
    29                                 <input id="EndTime" name="EndTime" type="text" value="" onclick="displayTimePicker('EndTime', this)" size="5" /> 
     15                                <b>{$To}</b> 
     16                                &nbsp;<input id="EndDate" name="EndDate" type="text" value="" onclick="displayDatePicker('EndDate', this)" size="8" /> 
     17                                &nbsp;<input id="EndTime" name="EndTime" type="text" value="" onclick="displayTimePicker('EndTime', this)" size="5" /> 
    3018                                &nbsp; 
    3119                        </td>                    
     
    3422                        </td> 
    3523                        <td> 
    36                                 &nbsp; 
    37                                 &nbsp; 
    38                                 <a href="javascript:log_4_host(this, '', 'CSV')"><img src="./img/icones/16x16/text_binary_csv.gif" alt="export CSV"/></a> 
    39                                 &nbsp; 
    40                                 <a href="javascript:log_4_host(this, '', 'Xml')"><img src="./img/icones/16x16/text_binary_xml.gif" alt="export XML"/></a> 
     24                                &nbsp;&nbsp;<a href="javascript:log_4_host(this, '', 'CSV')"><img src="./img/icones/16x16/text_binary_csv.gif" alt="export CSV"/></a> 
     25                                &nbsp;<a href="javascript:log_4_host(this, '', 'Xml')"><img src="./img/icones/16x16/text_binary_xml.gif" alt="export XML" target="_blank"/></a> 
    4126                        </td> 
    4227                </tr> 
     
    4429</form> 
    4530</div> 
    46 <div id="logView4xml">..select a log..</div> 
     31<div id="logView4xml">....</div> 
  • trunk/centreon/www/include/eventLogs/viewLog.php