Exemplo n.º 1
0
        void recommeded_value()
        {
            Tool_Class.IO_tool tool   = new IO_tool();
            string             l61    = tool.readconfig("jb", "netwarn");
            string             disk_c = tool.readconfig("jb", "Cwarn");
            string             disk_d = tool.readconfig("jb", "Dwarn");
            string             disk_e = tool.readconfig("jb", "Ewarn");
            string             disk_f = tool.readconfig("jb", "Fwarn");
            string             cpu    = tool.readconfig("jb", "cpuwarnvalue");
            string             memery = tool.readconfig("jb", "memwarnvalue");

            label61.Text = "连通不通次数少于" + l61 + "次";
            label62.Text = "C>" + disk_c + "G;" + "D>" + disk_d + "G;" + "\n\r" + "E>" + disk_e + "G;" + "F>" + disk_f + "G;";
            label63.Text = "使用率低于" + cpu + "%";
        }
Exemplo n.º 2
0
        public void Check_database_para(bool is_first, int exec)
        {
            if (io.execute_or_not("para_check", db_dir, Convert.ToInt32(io.readconfig("IT3K_OPTION", "OPTION_CHECK")), is_first, exec))
            {
                int              ini_diff = 0, table_diff = 0;
                string           result = "错误", output = "";
                OracleConnection conn = ROD.NewConn();
                DataSet          Table_DataSet;

                for (int i = 0; i < 9; i += 2)
                {
                    Table_DataSet = ROD.ReadDataToDataSet(conn, SQL_stat[i], "");
                    if ((i == 6 || i == 8) && Table_DataSet.Tables[0].Rows[0].ItemArray[0].ToString() == "")
                    {
                        table_diff = -1;
                    }
                    else
                    {
                        if (Table_DataSet != null && !Table_DataSet.HasErrors && Table_DataSet.Tables.Count == 1)
                        {
                            table_diff = Convert.ToInt32(Table_DataSet.Tables[0].Rows[0].ItemArray[0]);
                        }
                    }
                    Table_DataSet.Reset();
                    Table_DataSet = ROD.ReadDataToDataSet(conn, SQL_stat[i + 1], "");
                    if (Table_DataSet != null && !Table_DataSet.HasErrors && Table_DataSet.Tables.Count == 1)
                    {
                        ini_diff = Convert.ToInt32(Table_DataSet.Tables[0].Rows[0].ItemArray[0]);
                    }
                    if (table_diff < ini_diff)
                    {
                        result = "正常";
                    }
                    output += output_stat[i] + "在数据表中存在" + table_diff + "天的数据,但参数设置的是小于" + ini_diff + "天, 检测结果:" + result + ".\r\n";
                    Table_DataSet.Reset();
                    result     = "错误";
                    table_diff = ini_diff = 0;
                }
                conn.Close();
                if (output.Length > 255)
                {
                    output = output.Substring(0, 254);
                }
                if (result == "正常")
                {
                    show_flag = 'N';
                }
                else
                {
                    show_flag = 'E';
                }
                in_or_up = insert_or_update("para_check");
                if (in_or_up)
                {
                    insert_sql = "insert into Status_Now(para_name,para_value,para_group,flag,description,create_date,para_title,details) values ('para_check','" + result + "','IT3K_Para','" + show_flag + "','','" + DateTime.Now.ToString() + "','IT3K_para','" + output + "')";
                    io.AccessDbclass(insert_sql, db_dir);
                }
                else
                {
                    insert_sql = "insert into Status_Histroy select * from (select para_name,para_value,para_group,flag,description,create_date,para_title,details from Status_Now where para_name = 'para_check')";
                    io.AccessDbclass(insert_sql, db_dir);
                    insert_sql = "update Status_Now set para_value='" + result + "',flag = '" + show_flag + "',create_date = '" + DateTime.Now.ToString() + "',details = '" + output + "' where para_name = 'para_check'";
                    io.AccessDbclass(insert_sql, db_dir);
                }
            }
        }