code of longterm performance alerts

//performanceOptions.php
<?
  require('../inc/auth.inc');
  loggedin(1);

  remember_page("../Option/performanceOptions.php");
  remember_selector("StorageSystem");

$xtime=`/usr/sbin/daperf -showinterval`;
$xtime = str_replace("\n","",$xtime);
$pageTitle = "Performance monitoring options";
$isltopen=false;
exec("ps -ef|grep -v \"grep\"|grep perfd_lt",$a,$rtn);
if($rtn==0)$isltopen=true;


require("../inc/topBlank.php");
?>

<div class="contentContainer">
  <div class="contentMain">
    <div class="contentHeading">
        <img src="../inc/color/icons/iconSpacer.gif" />
        <h1><? echo convert("performance_data");?></h1>
    </div>
    <hr />
    <div class="contentBody">
        <form name="form0" action="processPerformance.php" method=post>
          <p><? echo convert("change_performance_data");?></p>
          <div class="module">
            <div class="row">
                <div class="value"><input type=radio id="cache0" name="cache" value="on" <?php if (is_numeric($xtime)) echo "checked"?> onClick="if(this.checked)document.getElementById('longterm').disabled=false;" > <? echo convert("start_recording_data");?> <select name="xtime" id="xtime">
                    <option value="500" <?php if ($xtime==500) echo "selected" ?>>0.5</option>
                    <option value="1000" <?php if ($xtime==1000) echo "selected" ?>>1</option>
                    <option value="2000" <?php if ($xtime==2000) echo "selected" ?>>2</option>
                    <option value="5000" <?php if ($xtime==5000) echo "selected" ?>>5</option>
                </select> <? echo convert("second");?></div>
                <div class="value" style="padding-left:20px;"><input type=checkbox id="longterm" name="longterm" value="on" <?php echo $isltopen?"checked":""; ?> <?php if (!is_numeric($xtime))echo "disabled"?>>Enable Long Term Recording</div>
            </div>
            <div class="row">
                <div class="value"><input type=radio id="cache1" name="cache" value="off" <?php if (!is_numeric($xtime))echo "checked"?> onClick="if(this.checked)document.getElementById('longterm').disabled=true;"> <? echo convert("stop_data");?></div>
            </div>    
          </div>
            <div class="row">
                <div class="spacer"></div>
            </div>
            <div class="row">
                <div class="spacer" ></div>
            </div>
        </form>
    </div>
</div>
<div class="contentButton">
       <div id=divBtn>
        <script language="JavaScript">
          createBtn("divBtn", new Array("<? echo convert("cancel");?>","<? echo convert("save_change");?>","<? echo convert("help");?>"), new Array( "Cancel()","SaveChanges()","PageHelp(\"performanceOptionHelp.php\",608,608)"), "570px")
        </script>
        </div>
    </div>
</div>
<?
require("../inc/bottomBlank.php");
?>
<script language=javascript>
    function SaveChanges()
    {

        var bRet = true;

        bRet = confirm("<? echo convert("sure_setting");?>?");
        if (bRet)
        document.forms[0].submit();
    }

    function Cancel()
    {
        //alert(2);
        var sURL, sConfirm
        sURL = "optionstart.php";
        sConfirm = "";
        document.location.href = sURL;

    }
</script>
//processPerformance.php
<?php //add server api
  require('../inc/diskarray.inc');
  require('../inc/auth.inc');
  loggedin(1);  

    if ($cache == "off") {
        `/usr/sbin/daperf -stop`;
    } else {
        `/usr/sbin/daperf -stop`;
        `/usr/sbin/daperf -start -writinginterval $xtime`;
    }   
    if (!strcmp($longterm, "on") && !strcmp($cache, "on"))
        `/usr/sbin/daperf -start -writinginterval 500 -longterm`;
    else
        `/usr/sbin/daperf -stop -longterm`;
    // ----------------------------
  header("Location: optionstart.php");
?>

1.date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"


2.php

number_format()

 ImageLine($this->image, $x1, $y1, $x2[$j], $y2[$j], $this->barCol[$j % 9]);

 $col_ellipse = imagecolorallocate($this->image, 255, 0, 0);

imageellipse($this->image, $x1, $y1, 10, 10, $col_ellipse);


调试·echo 1>>/tmp/test·


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值