home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Rpm / ViewMemoryStatus.asp < prev    next >
Encoding:
Text File  |  2003-06-24  |  31.7 KB  |  904 lines

  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>MemoryWatch Monitoring</title>
  6. <link rel="stylesheet" type="text/css" href="css/rpmstyle.css">
  7.  
  8. <style type="text/css"> 
  9. .GTabBox {  height : 400; width : 630; border: none; background-color : activeborder }
  10.  
  11. .VAMainBox { position:absolute; margin:0; padding:0; border: solid thin; background-color : activeborder }
  12. .VAMainBox { border-top-color : #E0E0E0; border-left-color : #E0E0E0; border-bottom-color : #555555; border-right-color : #555555 }
  13.  
  14. .EventLog { border-style : solid; margin:0; padding:0; border-width : 1;  background-color:white }
  15. .EventLog { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  16.  
  17. .STabSel { border-left:solid thin white; border-top:solid thin white; border-right:solid thin black }
  18. .STabSel { height : 28px; width : 110px; background-color : activeborder; color : windowtext}
  19. .STabSel { font-size : 13pt; font-weight:bold; text-align:center; vertical-align:middle }
  20.  
  21. .STabUnsel { height : 28px; width : 110px; background-color : graytext; color : captiontext}
  22. .STabUnsel { font-size : 10pt;  text-align:center; cursor:hand; vertical-align:middle}
  23. .STabUnsel { border-bottom:solid thin white; border-top:solid thin #e8e8e8;  border-left:solid thin #e8e8e8 }
  24.  
  25. .RptStatusTextBox {  background-color: white; color: infotext; }
  26. .RptStatusTextBox { border-style : solid; border-width : thin; overflow : scroll}
  27. .RptStatusTextBox { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white}
  28.  
  29. .devtext { font-size: 9pt; font-weight: 500; background-color: threedhighlight; color: windowtext; border: solid thin; }
  30. .devtext { border-top-color : graytext; border-left-color : graytext; border-bottom-color : white; border-right-color : white }
  31.  
  32. </style>
  33. </head>
  34.  
  35. <body class="bodyc" language="JavaScript" RPMHostIP="!BreakoutBot:MonitorIP!" RPMHostPort="!BreakoutBot:MonitorPort!" RPMUserName="!BreakoutBot:UserName!" BOBDone="!BreakoutBot:Done!" onload="top.banner.savePageCoord(event,document.body,'ViewMemoryStatus'); SR_Init()" onunload="DiscoRpmCC_AR()" onresize="processSizeChange()" onclick="checkClick()" onkeydown="processBSP()">
  36.  
  37. <script LANGUAGE="JavaScript">
  38. <!--
  39. var    AR_CompIDArray = ""; // Computer Id Array
  40. var    Lb = "<BR>"; // Line break
  41. var    Tid = null;
  42. var    GTid = null;
  43. var    CTid = null;
  44. var   ignoreDBChangeEvent = false;
  45. var    RMode = ""; // Mode of Operation, New, Edit, Delete, Lookup
  46. var    CmpLupRecCount = 0; // Computer Lookup record count
  47. var    CmpRecLth = 7; // Computer Loopkup record length
  48. var   CurCmpStoreIdx = 0; // index into Computer Store for Selected Computer Name
  49. var     ReconnectEvent = false;
  50. var     Hp = 82;
  51. var     AR_CmpStoreArr = new Array();
  52. var     AR_GroupStoreArr = new Array();
  53. var     MostRecentHours = 6;
  54. var   DetailsArr = new Array();
  55. var    DetailsArrIx = 0;
  56. var     ELBgFlg = 0; // Log Background color toggle
  57.  
  58. // Capture and ignore script errors
  59.     window.onerror = wwScrErr;
  60. function wwScrErr() {
  61.     return true;
  62. }
  63.  
  64. /* Process OnLoad */
  65. function SR_Init() {
  66.     top.MainLoaded = true; // Flag that Main is now loaded
  67.     initButtonState(); // set initial button state for all buttons
  68.  
  69.     Hp = parseInt(document.body.RPMHostPort,10);
  70.     RpmCC_AR.Connect(document.body.RPMHostIP,Hp, "");
  71.     processSizeChange();
  72.     processLogWindow();
  73. }
  74.  
  75. function processRepReconnect() {
  76.     Tid = null;
  77.     if ( RpmCC_AR.IsConnected() ) {
  78.         Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  79.         return;
  80.     }
  81.     RpmCC_AR.Connect(document.body.RPMHostIP,Hp, ""); 
  82. }
  83. function processRepConnectConfirmed() {
  84.     // Restore Filter and Computer Store    
  85.     if ( ReconnectEvent == false ) {
  86.         ReconnectEvent = true;
  87.         InitComputerLookup();
  88.     }
  89.     else {
  90.           //RpmCC_AR.NetStatFunction("GetServerInfoMemory");
  91.     }
  92.     
  93.     top.Rstatus.Pstat("Connected");
  94.     if ( Tid != null ) {
  95.         clearTimeout(Tid); // stop timeout routine
  96.     }
  97.     Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  98. }
  99. function processRepConnectionCheck() {
  100.     Tid = null;
  101.     RpmCC_AR.SendKeepAlive("Check");
  102.     Tid = setTimeout("processRepConnectionCheck()",30000); // Delay 30 secs then check connection
  103. }
  104.  
  105. /* On Unload tell the Comm control to Disconnect from the Server */
  106. function DiscoRpmCC_AR() {
  107.     RpmCC_AR.Disconnect();
  108.     top.banner.processStopCommX();
  109.     if ( Tid != null ) {
  110.         clearTimeout(Tid); // stop timeout routine
  111.     }
  112.     if ( GTid != null ) {
  113.         clearTimeout(GTid); // stop timeout routine
  114.     }
  115.     if ( CTid != null ) {
  116.         clearTimeout(CTid); // stop timeout routine
  117.     }
  118.     SaveCurrentDisplayState();
  119. }
  120.  
  121. function SaveCurrentDisplayState() {
  122.     // Save current display state
  123.     var cc = (CurSelTab == "GroupTab") ? "0," : "1,";
  124.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  125.         if ( AR_GroupStoreArr[GIndx+4] == 1 ) { // if Expanded
  126.             cc += AR_GroupStoreArr[GIndx+1] + ",";
  127.         }
  128.     }
  129.     top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"MemoryWatchDisplayState",cc);     
  130. }
  131.  
  132. function processDBChanged() {
  133.     CTid = null;
  134.     top.banner.processStartComm(); 
  135.     top.Rstatus.StatDB.style.display = "none";
  136.     InitComputerLookup();
  137.     Tid = setTimeout("finishDBChange()",1000); // Delay 
  138. }
  139. function finishDBChange() {
  140.     Tid = null; // reset
  141.     top.banner.processStopCommX();
  142. }
  143.  
  144. /* Get Report Name from Store based on Report ID */
  145. function InitComputerLookup() {
  146.     CmpLupRecCount = 0; // initialize record counter
  147.     AR_CmpStoreArr.length = 0;
  148.     
  149.     if ( RpmCC_AR.ComputerLookup("*","*") ) {
  150.         top.Rstatus.Pstat("Unable to start the COMPUTER LOOKUP request",true);
  151.         processResetButton();
  152.     }
  153.     else { // waiting for OperationCompleteEvent
  154.           SetCursor("wait");
  155.         top.Rstatus.Pstat("One moment while COMPUTER LOOKUP request completes");
  156.     }
  157. }
  158.  
  159. /* Process Computer LOOKUP RECORD Event */
  160. function processComputerLookupRecord(Cid,Gid,Name,Desc,OSVer,Addr) {
  161.     var wrkarr = new Array();
  162.      CmpRecLth = 10; // Storage record length
  163.     var i = CmpLupRecCount * CmpRecLth;
  164.     AR_CmpStoreArr[i] = Name;
  165.     AR_CmpStoreArr[i+1] = Gid;
  166.     AR_CmpStoreArr[i+2] = Desc;
  167.     AR_CmpStoreArr[i+3] = Cid;
  168.     wrkarr = OSVer.split("[]");; // map OS version to Generic OS types
  169.     AR_CmpStoreArr[i+4] = wrkarr[0];
  170.     AR_CmpStoreArr[i+5] = Addr;
  171.     AR_CmpStoreArr[i+6] = 0; // status: 0=normal; 1=caution; 2=critical
  172.     AR_CmpStoreArr[i+7] = 0; // expanded 0=no; 1=yes    
  173.     AR_CmpStoreArr[i+8] = -1; // Display Index    
  174.     AR_CmpStoreArr[i+9] = ""; // Drive Info    
  175.     ++CmpLupRecCount;
  176. }
  177.  
  178. /* Process Computer Lookup Op Complete Event */
  179. function processComputerOpComplete() {
  180.     SetCursor("auto");
  181.     top.Rstatus.Pstat("Request Completed");
  182.     if (CmpLupRecCount == 0) { // check if any records found
  183.         top.Rstatus.Pstat("No record matches found for COMPUTER LOOKUP request",true);
  184.         processResetButton();
  185.     }
  186.  
  187.     GrpLupRecCount = 0; // initialize record counter
  188.     AR_GroupStoreArr.length = 0;
  189.     if ( RpmCC_AR.GroupLookup("","","") ) {
  190.         top.Rstatus.Pstat("Unable to start the GROUP LOOKUP request",true);
  191.         processResetButton();
  192.     }
  193.     else { // waiting for OperationCompleteEvent
  194.         top.Rstatus.Pstat("One moment while GROUP LOOKUP request completes");
  195.     }
  196. }
  197.  
  198. var   GrpLupRecCount = 0; // Count of records returned from Group Lookup operation
  199. var    GroupRecLength = 6; // Length of a Group Lookup record in the Store
  200. /* Process Group LOOKUP RECORD Event */
  201. function processGroupLookupRecord(Gid,GrpName,GrpDesc) {
  202.     // place data from Lookup Record into specified Store
  203.     // Add to Storage
  204.     var i = GrpLupRecCount * GroupRecLength;
  205.     AR_GroupStoreArr[i++] = GrpName;
  206.     AR_GroupStoreArr[i++] = Gid;
  207.     AR_GroupStoreArr[i++] = GrpDesc;
  208.     AR_GroupStoreArr[i++] = 0; // status: 0=normal; 1=caution; 2=critical
  209.     AR_GroupStoreArr[i++] = 0; // expanded 0=no; 1=yes    
  210.     AR_GroupStoreArr[i++] = 0; // Display Index
  211.     ++GrpLupRecCount;
  212. }
  213. /* Process DB Error in Group Lookup Operation */
  214. function processGroupOpError() {
  215.     top.Rstatus.Pstat("An error occurred during GROUP LOOKUP operation",true);
  216.     goResetWait();
  217. }
  218. function processGroupOpComplete() {
  219.     if ( GrpLupRecCount == 0 ) {
  220.         top.Rstatus.Pstat("No GROUP record matches found for LOOKUP request",true);    
  221.         processGeneralClick(GroupTab);
  222.     }
  223.     else {
  224.         var cc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"MemoryWatchDisplayState");     
  225.         var wrkarr = new Array();
  226.         var Gid = "";
  227.         wrkarr = cc.split(",");
  228.         for ( var j=1; j<wrkarr.length; j++ ) {
  229.             Gid = wrkarr[j]; // ID of Expanded Group    
  230.             for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  231.                 AR_GroupStoreArr[GIndx+3] = 0;
  232.                 if ( AR_GroupStoreArr[GIndx+1] == Gid ) { // if Match
  233.                     AR_GroupStoreArr[GIndx+4] = 1; // Set Expanded
  234.                     for ( var m=0, n=0; m<CmpLupRecCount; m++, n+=CmpRecLth ) {
  235.                         if ( AR_CmpStoreArr[n+1] == Gid ) {
  236.                            AR_CmpStoreArr[n+7] = 1; // Expanded State
  237.                         }
  238.                     }
  239.                 }
  240.             }
  241.         }        
  242.           processGeneralClick(GroupTab);
  243.         if ( wrkarr[0] == "1" ) {
  244.            processGeneralClick(DeviceTab);
  245.        }
  246.         processGetServerInfo();
  247.     }
  248. }
  249.  
  250. function processGetServerInfo() {
  251.     GTid = null;
  252.       RpmCC_AR.NetStatFunction("GetServerInfoMemory");
  253.     GTid = setTimeout("processGetServerInfo()",120000); // Delay 5 Minutes 
  254. }
  255.  
  256. /* Process Click on Enable Report Status Tab or Schedule Report Tab*/
  257. function enableDeviceStatus() {
  258.     processGeneralClick(DeviceTab);
  259. }
  260.  
  261. function enableGroupStatus() {
  262.     processGeneralClick(GroupTab);
  263. }
  264.  
  265.  
  266. // Process to Toggle the Hide and Show of the Banner & Menu Frames
  267. var hideToggle = 0;
  268. var TitleDivSize = 117;
  269. function processBannerMenu() {
  270.     if ( hideToggle == 0 ) {
  271.         top.BannerMenuHide(); hideToggle = 1;
  272.         NetStatusTitleDiv.style.display = "none"; 
  273.         TitleDivSize = 72; 
  274.     }
  275.     else {
  276.         top.BannerMenuShow(); hideToggle = 0;   
  277.         NetStatusTitleDiv.style.display = "";  
  278.         TitleDivSize = 117;
  279.     }   
  280. }
  281.  
  282. /* Set initial button state for all buttons */
  283. function initButtonState() {
  284. }
  285. function sButtonState(bObj,bst) {
  286.     bObj.disabled = (bst == "0") ? "" : "disabled";
  287.     //bObj.className = (bst == "0") ? "SBoxButton" : "SBoxButtonD";
  288. }
  289. function ButtonState(bObj,bst) {
  290.     bObj.disabled = (bst == "0") ? "" : "disabled";
  291.     //bObj.className = (bst == "0") ? "BoxButton" : "BoxButtonD";
  292. }
  293.  
  294. var SCbsy = false;
  295. var borderSz = 20; // Thin Bord is 2pixels
  296. function processSizeChange() {
  297.     if ( SCbsy ) 
  298.         return;
  299.     SCbsy = true;
  300.     // Display Height and Width
  301.     bCh = document.body.clientHeight;
  302.     bCw = document.body.clientWidth;
  303.     
  304.     // Minimums
  305.     bCh = (bCh < 240) ? 240 : bCh;
  306.     bCw = (bCw < 330) ? 330 : bCw;
  307.    document.body.scroll = (bCw <= 330 || bCh <= 240) ? "yes" : "no";
  308.    
  309.       //PopUpContext Menu
  310.    PopUpContextSize(bCw);
  311.   
  312.    // Set Height/Widths for Chart and Button areas
  313.     GTabBx.style.height = bCh-2;
  314.     GTabBx.style.width = bCw-borderSz;
  315.     GTab.style.top = bCh-borderSz-90;
  316.     DeviceUI.style.height = GroupUI.style.height = GTabBx.style.posHeight-TitleDivSize;
  317.     DeviceUI.style.width = GroupUI.style.width = GTab.style.width = GTabBx.style.posWidth-4;
  318.     Groupwin.style.height = GroupUI.style.posHeight-50;
  319.     Devicewin.style.height = GroupUI.style.posHeight-71;
  320.     GTabBx.style.display = "";
  321.     
  322.     GroupTab.className="STabUnsel";
  323.     DeviceTab.className="STabUnsel";
  324.     document.all[CurSelTab].className="STabSel";
  325.     
  326.     SCbsy = false;
  327. }
  328.  
  329. /* Process Click on selected Tab */
  330. var CurSelTab = "GroupTab"; // current selected tab
  331. var RTid = null;
  332. function processGeneralClick(th) {
  333.     if ( th.style.cursor =="auto" ) 
  334.         return; // ignore disabled
  335.  
  336.     top.Rstatus.Pstat("");
  337.     GroupUI.style.display="none";
  338.     DeviceUI.style.display="none";
  339.     GroupTab.className="STabUnsel";
  340.     DeviceTab.className="STabUnsel";
  341.     th.className="STabSel";
  342.     CurSelTab = th.id;
  343.     switch ( th.id ) {
  344.    case "GroupTab" : 
  345.       GroupUI.style.display=""; // Enable this Tab's view
  346.        outputGroupStatusDisplay(); 
  347.      break;
  348.    case "DeviceTab" : 
  349.          DeviceUI.style.display="";
  350.        outputDeviceStatusDisplay(); 
  351.     break;
  352.     }
  353. }
  354.  
  355. function outputGroupStatusDisplay() {
  356.     /* Format Details for output */
  357.     var GDispArr = new Array();
  358.     GDispArr.length = 0;
  359.     for ( var i=0, j=0; i<GrpLupRecCount; i++, j+=GroupRecLength ) {
  360.           GDispArr[i] = AR_GroupStoreArr[j].toLowerCase()+"    [+]"+j;
  361.     }
  362.     GDispArr.sort();
  363.  
  364.     var percent=10, rowcount=10, ExpImg="plus", StatImg="Normal";
  365.     if ( GrpLupRecCount < 10 ) { percent = 33; rowcount = 3; }
  366.     else if ( GrpLupRecCount < 20 ) { percent = 25; rowcount = 4; }
  367.     else if ( GrpLupRecCount < 30 ) { percent = 20; rowcount = 5; }
  368.     else if ( GrpLupRecCount < 40 ) { percent = 14; rowcount = 7; }
  369.     
  370.     var warr = new Array();
  371.     Groupwin.innerHTML = ""; // clear details
  372.       sob = "<center><table border='0' cellpadding='1' cellSpacing='2' width='100%'>";
  373.       for ( var j=0; j<GrpLupRecCount;  ) {
  374.         sob += "<tr>";
  375.         for ( var i=0; i<rowcount && j<GrpLupRecCount; i++, j++ ) {
  376.             warr = GDispArr[j].split("[+]");
  377.             var GIndx = parseInt(warr[1],10);
  378.             ExpImg = ( AR_GroupStoreArr[GIndx+4] ) ? "minus" : "plus";
  379.             if ( AR_GroupStoreArr[GIndx+3] == 0 ) { 
  380.                 StatImg = "Normal";
  381.             }
  382.             else if ( AR_GroupStoreArr[GIndx+3] == 1 ) { 
  383.                 StatImg = "Caution";
  384.             }
  385.             else { 
  386.                 StatImg = "Critical";
  387.             }
  388.             AR_GroupStoreArr[GIndx+5] = j; // Display Index
  389.             
  390.             sob += "<td width='"+percent+"%' align='center' class='statuslabel'>";
  391.             sob += "<img id='GroupStatus_"+j+"' src='images/"+StatImg+".gif' align='absmiddle' height='12' width='12'>";
  392.              sob += "<img id='Expand_"+j+"' src='images/"+ ExpImg+".gif' width='11' height='11' style='cursor:hand'";
  393.              sob += " onclick='processGroupExpand(this.id)' ";
  394.              sob += "title='Click to show or hide the Group`s associated servers/workstations in the `Servers` tab view'><br>";
  395.             sob += "<span title='" + AR_GroupStoreArr[GIndx+2] +"'>"+ AR_GroupStoreArr[GIndx]+"</span></td>";
  396.         }
  397.         for ( ; i<rowcount; i++ ) {
  398.              sob += "<td width='"+percent+"%' align='center' class='statuslabel'> </td>";
  399.         }
  400.         sob += "</tr>";    
  401.     }
  402.     sob += "</table></center>";
  403.     Groupwin.insertAdjacentHTML("beforeEnd",sob);
  404. }
  405.  
  406. function processGroupExpand(isx) {
  407.     if ( isx.charAt(0) != "E" ) 
  408.                 return;
  409.     var ix = isx.substring(7,isx.length); // Strip off index
  410.     var GIndx = ix * GroupRecLength;
  411.     AR_GroupStoreArr[GIndx+4] ^= 1; // toggle expand state
  412.     var Gid = AR_GroupStoreArr[GIndx+1];
  413.     var State = AR_GroupStoreArr[GIndx+4]; // Expand State
  414.     ExpImg = ( AR_GroupStoreArr[GIndx+4] ) ? "minus" : "plus";
  415.     document.all[isx].src="images/"+ ExpImg+".gif";
  416.     for ( var i=0, j=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  417.         if ( AR_CmpStoreArr[j+1] == Gid ) {
  418.            AR_CmpStoreArr[j+7] = State;
  419.         }
  420.     }
  421. }
  422.  
  423. var CDispArr = new Array();
  424. function outputDeviceStatusDisplay() {
  425.     var warr = new Array();
  426.     var darr = new Array();
  427.     var PctFree = 0;
  428.  
  429.     // Reset Group Status
  430.       for ( var n=0; n<GrpLupRecCount; ++n  ) {
  431.         AR_GroupStoreArr[(n*GroupRecLength)+3] = 0;
  432.     }
  433.     // Find how many to display
  434.     CDispArr.length = 0;
  435.     for ( var i=0, j=0, k=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  436.         AR_CmpStoreArr[j+8] = -1; // Reset Display Index
  437.         AR_CmpStoreArr[j+6] = 0; // Reset Status
  438.         if ( AR_CmpStoreArr[j+7] == 1 ) { // if Display
  439.            CDispArr[k++] = AR_CmpStoreArr[j].toLowerCase()+"    [+]"+j;
  440.         }
  441.         else {
  442.             darr = AR_CmpStoreArr[j+9].split("~");
  443.             PctFree = Math.round( (darr[10]*100)/darr[9] );
  444.             if ( PctFree <= 10 ) {
  445.                 AR_CmpStoreArr[j+6] = 2;
  446.             }
  447.             else if ( PctFree <= 20 && AR_CmpStoreArr[j+6] == 0) {
  448.                 AR_CmpStoreArr[j+6] = 1;
  449.             }
  450.         }
  451.     }
  452.     CDispArr.sort();
  453.     
  454.     Devicewin.innerHTML = ""; // clear details
  455.     var FOps = "";
  456.      for ( var j=0; j<CDispArr.length; ++j ) {
  457.         warr = CDispArr[j].split("[+]");
  458.         var CI = parseInt(warr[1],10);
  459.         darr = AR_CmpStoreArr[CI+9].split("~");
  460.         if ( darr.length < 14 ) continue;
  461.         
  462.         
  463.             FOps += "<table border='0' cellpadding='1' cellSpacing='1' width='100%' ";    
  464.             if ((ELBgFlg ^= 1) == 0) {
  465.                 FOps += "id='Logline"+CI+"' style='background-color:white'><tr>";
  466.             }
  467.             else {
  468.                 FOps += "id='Logline"+CI+"' style='background-color:e8e8e8'><tr>";
  469.             }
  470.             FOps += "<td width='140' colspan='1' class='optext'>";
  471.             FOps += AR_CmpStoreArr[CI+0] + "</td>";
  472.             FOps += "<td width='85' colspan='1' class='optext' align='right'>";
  473.             FOps += InsertCommas(darr[7]) + "</td>";        
  474.             FOps += "<td width='85' colspan='1' class='optext' align='right'>";
  475.             FOps += InsertCommas(darr[8]) + "</td>";
  476.             
  477.             FOps += "<td width='85' colspan='1' class='optext' align='right'>";
  478.             FOps += InsertCommas(darr[9]) + "</td>";
  479.             FOps += "<td width='85' colspan='1' class='optext' align='right'>";
  480.             FOps += InsertCommas(darr[10]) + "</td>";
  481.     
  482.             PctFree = Math.round( (darr[10]*100)/darr[9] );
  483.             FOps += "<td width='50' colspan='1' class='optext' align='center'>";
  484.             FOps += PctFree + "</td>";
  485.         
  486.             // set percentages 
  487.             if ( PctFree == 0 ) { PctFree = 1; }
  488.             Cavg = (100-PctFree)+"%";
  489.             Bavg = PctFree+"%";
  490.             Aavg = Davg = "0%";
  491.              FOps += "<td width='*' colspan='1' class='optext'>"
  492.             FOps += "<table border='0' cellpadding='0' cellSpacing='0' height='12' width='100%'><tr>";
  493.             if ( PctFree <= 10 ) {
  494.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:red'></td>";
  495.                 AR_CmpStoreArr[CI+6] = 2;
  496.             }
  497.             else if ( PctFree <= 20 ) {
  498.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:yellow'></td>";
  499.                 if ( AR_CmpStoreArr[CI+6] == 0 ) {
  500.                     AR_CmpStoreArr[CI+6] = 1;
  501.                 }
  502.             }
  503.             else {
  504.                 FOps += "<td width='"+Bavg+"' align='center' style='background-color:green'></td>";
  505.             }
  506.             FOps += "<td width='"+Cavg+"'></td>";
  507.             FOps += "</tr></table>";    
  508.             FOps += "</td>";
  509.             FOps += "</tr></table>";        
  510.     }
  511.     Devicewin.insertAdjacentHTML("beforeEnd",FOps);
  512.     SaveCurrentDisplayState();
  513.     
  514.     var GStat = 0;        
  515.     for ( var p=0, GIndx=0; p<GrpLupRecCount; p++, GIndx+=GroupRecLength ) {
  516.         for ( var m=0, n=0; m<CmpLupRecCount; m++, n+=CmpRecLth ) {
  517.             if ( AR_GroupStoreArr[GIndx+1] == AR_CmpStoreArr[n+1] ) { // if match on Gid
  518.                 if ( AR_CmpStoreArr[n+6] == 2 ) {
  519.                     GStat = 2;
  520.                     break;
  521.                 }
  522.                 if ( AR_CmpStoreArr[n+6] == 1 ) {
  523.                     GStat = 1;
  524.                 }
  525.             }
  526.         }
  527.           if ( AR_GroupStoreArr[GIndx+3] != GStat ) { // Status changed
  528.             AR_GroupStoreArr[GIndx+3] = GStat;
  529.             // Update Group icon 
  530.             if ( GStat == 0 ) StatImg = "Normal";
  531.             else if ( GStat == 1 ) StatImg = "Caution";
  532.             else StatImg = "Critical";
  533.             document.all["GroupStatus_"+AR_GroupStoreArr[GIndx+5]].src="images/"+StatImg+".gif";
  534.         }
  535.         GStat = 0;
  536.     }
  537. }
  538.  
  539. /* Initialize the Log and Filter Windows */
  540. function processLogWindow() {
  541.     // Format Output to Log Window 
  542.     FOps = "<table border='0' cellpadding='1' cellSpacing='1' width='100%'><tr>";
  543.     FOps += "<td width='140' align='center' style='background-color:activeborder' class='optextb'>";
  544.     FOps += "Server Name" + "</td>";
  545.     FOps += "<td width='85' align='center' style='background-color:activeborder' class='optextb'>";
  546.     FOps += "Total Phys(Kb)" + "</td>";
  547.     FOps += "<td width='85' align='center' style='background-color:activeborder' class='optextb'>";
  548.     FOps += "Avail Phys(Kb)" + "</td>";
  549.     FOps += "<td width='85' align='center' style='background-color:activeborder' class='optextb'>";
  550.     FOps += "Total Page(Kb)" + "</td>";
  551.     FOps += "<td width='85' align='center' style='background-color:activeborder' class='optextb'>";
  552.     FOps += "Avail Page(Kb)" + "</td>";
  553.     FOps += "<td width='50' align='center' style='background-color:activeborder' class='optextb'>";
  554.     FOps += "% Avail" + "</td>";
  555.     FOps += "<td width='*' align='center' style='background-color:activeborder' class='optextb'>";
  556.     FOps += "Avail Meter" + "</td>";
  557.     FOps += "</tr></table>";
  558.     ELogWin.insertAdjacentHTML("afterBegin",FOps);
  559. }
  560.  
  561. function GetGrpNameFromID(Gid) {
  562.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  563.         if ( AR_GroupStoreArr[GIndx+1] == Gid ) {
  564.             return AR_GroupStoreArr[GIndx];
  565.         }
  566.     }
  567.     return "";
  568. }
  569.  
  570. function processSelect(Type) {
  571.     State = ( Type == "0" ) ? 1 : 0;
  572.     for ( var i=0, GIndx=0; i<GrpLupRecCount; i++, GIndx+=GroupRecLength ) {
  573.         AR_GroupStoreArr[GIndx+4] = State; // set state
  574.         var Gid = AR_GroupStoreArr[GIndx+1];
  575.         ExpImg = ( State ) ? "minus" : "plus";
  576.         document.all["Expand_"+i].src="images/"+ ExpImg+".gif";
  577.     }
  578.     for ( var j=0, k=0; j<CmpLupRecCount; j++, k+=CmpRecLth ) {
  579.         AR_CmpStoreArr[k+7] = State;
  580.     }
  581.     if ( State ) {
  582.         enableDeviceStatus();
  583.         outputDeviceStatusDisplay();
  584.     }
  585. }
  586. function processMemoryInfo(csArg) {
  587.     var wrkarr = new Array();
  588.     wrkarr = csArg.split("~");
  589.     
  590.     if ( wrkarr[1] == "Done" ) {
  591.        outputDeviceStatusDisplay();
  592.        return;
  593.     }
  594.     for ( var i=0, j=0; i<CmpLupRecCount; i++, j+=CmpRecLth ) {
  595.         if ( AR_CmpStoreArr[j+3] == wrkarr[1] ) { // Match on Computer ID
  596.             AR_CmpStoreArr[j+9] = csArg;
  597.             break;
  598.         } // end If match
  599.     } // end For on Computer search
  600. }
  601.  
  602. function InsertCommas( szNum ) {
  603.     var csInt = "";
  604.     var csRemainder = "";
  605.     var cs = "";
  606.  
  607.     var Decimal = szNum.indexOf( "." );
  608.     if ( -1 != Decimal )    {
  609.         csInt       = szNum.substr( 0, Decimal );
  610.         csRemainder = szNum.substr( Decimal+1 );
  611.     }
  612.     else
  613.         csInt = szNum;
  614.         
  615.     switch ( csInt.length )    {
  616.         case 9:
  617.             cs = csInt.charAt(0)+""+csInt.charAt(1)+""+csInt.charAt(2)+",";
  618.             cs += csInt.charAt(3)+""+csInt.charAt(4)+""+csInt.charAt(5)+",";
  619.             cs += csInt.charAt(6)+""+csInt.charAt(7)+""+csInt.charAt(8);
  620.             break;
  621.  
  622.         case 8:
  623.             cs = csInt.charAt(0)+""+csInt.charAt(1)+","+csInt.charAt(2)+"";
  624.             cs += csInt.charAt(3)+""+csInt.charAt(4)+","+csInt.charAt(5)+"";
  625.             cs += csInt.charAt(6)+""+csInt.charAt(7);
  626.             break;
  627.  
  628.         case 7:
  629.             cs = csInt.charAt(0)+","+csInt.charAt(1)+""+csInt.charAt(2)+"";
  630.             cs += csInt.charAt(3)+","+csInt.charAt(4)+""+csInt.charAt(5)+"";
  631.             cs += csInt.charAt(6);
  632.             break;
  633.  
  634.         case 6:
  635.             cs = csInt.charAt(0)+""+csInt.charAt(1)+""+csInt.charAt(2)+",";
  636.             cs += csInt.charAt(3)+""+csInt.charAt(4)+""+csInt.charAt(5);
  637.             break;
  638.  
  639.         case 5:
  640.             cs = csInt.charAt(0)+""+csInt.charAt(1)+","+csInt.charAt(2)+"";
  641.             cs += csInt.charAt(3)+""+csInt.charAt(4);
  642.             break;
  643.  
  644.         case 4:
  645.             cs = csInt.charAt(0)+","+csInt.charAt(1)+""+csInt.charAt(2)+"";
  646.             cs += csInt.charAt(3);
  647.             break;
  648.  
  649.         case 3:
  650.         case 2:
  651.         case 1:
  652.         case 0:
  653.         default:
  654.             cs = csInt;
  655.     }
  656.     cs += csRemainder;
  657.  
  658.     return cs;
  659. }
  660.  
  661. function processResetButton() {
  662.       SetCursor("auto");
  663. }
  664.  
  665. function PopUpContextOpen() {
  666. }
  667. function PopUpContextClose() {
  668. }
  669.  
  670. function processKeyPress() {
  671.     /* get KeyCode and check if invalid */
  672.     kc = event.keyCode;
  673.     stat = 1; // default to OK
  674.  
  675.     // Keys:   ~            %           [           ]           #           !
  676.     if (kc == 126 ||    kc == 37 || kc == 91 ||    kc == 93 || kc == 35 || kc == 33) { // Not acceptable 
  677.         stat = 0;
  678.     } // Keys:        *           ?
  679.     else if ( (kc == 42 || kc == 63) &&  event.srcElement.name != "AR_Rpt" ) { //Not acceptable
  680.         stat = 0;
  681.     }
  682.     if (stat == 0) { // if Not Acceptable
  683.         event.returnValue=false;
  684.         top.Rstatus.Pstat("Keys ~%*?[]#! are not accepted for this field");    
  685.         alert("Keys ~%*?[]#! are not accepted for this field");    
  686.     }
  687.     else {
  688.         top.Rstatus.Pstat(""); // clear status line
  689.     }
  690. }    
  691. // Print Display
  692. var DiscStatWindow = null;
  693. function processPrintStatus() {
  694.     if ( !top.banner.IE55orBetter ) {
  695.         alert("Print requires IE 5.5/SP1 or greater. Download current, free IE update from Microsoft's web site");
  696.         return;
  697.     }
  698.     FakeBut.click();    // simulate event to call "savePageCoord(...)"
  699.     var wprop = "height="+top.banner.bCh+",width="+top.banner.bCw
  700.     wprop += ",top="+(top.banner.bY-28)+",left="+(top.banner.bX-4)+",scrollbars";
  701.     var rName = ""+Math.random(); // use Random number to get unique Window name
  702.     rName = rName.substring(2,rName.length);
  703.     DiscStatWindow = window.open("",rName,wprop);
  704.     if ( DiscStatWindow == null ) {
  705.         return;   
  706.     }
  707.     var dh = "<html><head><title>MonitorIT - Server Memory Status Report</title>";
  708.     dh += "<link rel='stylesheet' type='text/css' href='css/rpmstyle.css'></head><body";
  709.     dh += " title='Exit to Close Window when Printing is complete'>"; 
  710.     dh += ELogWin.innerHTML;
  711.     dh += Devicewin.innerHTML;
  712.     dh += '<script LANGUAGE="JavaScript">window.focus();';
  713.     dh += ' </script></body></html>';
  714.     DiscStatWindow.document.open();
  715.     DiscStatWindow.document.write(dh)
  716.     DiscStatWindow.document.close();
  717.     DiscStatWindow.print();
  718. }
  719. //-->
  720. </script>
  721.  
  722. <script LANGUAGE="JavaScript" src="js/MiscFunc.js"></script>
  723. <script LANGUAGE="JavaScript" src="js/ButtonFunc.js"></script>
  724. <script LANGUAGE="JavaScript" src="js/AlertFunc.js"></script>
  725.  
  726. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="NetStatNotify(csArg)">
  727. <!--
  728. var wrkarr = new Array();
  729. wrkarr = csArg.split("~");
  730. if ( wrkarr[0] == "SIMemory" ) {
  731.     processMemoryInfo(csArg);
  732. }
  733. //-->
  734. </script> 
  735.  
  736. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="Connected()">
  737. <!--
  738. processRepConnectConfirmed();
  739. //-->
  740. </script> 
  741.  
  742. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="Disconnected()">
  743. <!--
  744. top.Rstatus.Pstat("Disconnected",true);
  745. if ( Tid != null ) {
  746.     clearTimeout(Tid); // stop timeout routine
  747. }
  748. Tid = setTimeout("processRepReconnect()",10000); // Delay 10 secs then try reconnnect
  749. //-->
  750. </script>
  751.  
  752. <script
  753. LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="DBChanged(cdata)">
  754. <!--
  755. var warr = new Array();
  756. warr = cdata.split("~"); // parse the event data
  757. // process only if Computer, Watch/Alert or Group Table change
  758. if ( (warr[0] == "1" || warr[0] == "2" || warr[0] == "5") && ignoreDBChangeEvent == false ) {
  759.     top.Rstatus.StatDB.style.display = "";
  760.     if ( CTid == null ) {
  761.         CTid = setTimeout("processDBChanged()",30000); // Delay 30 secs then process
  762.     }
  763. }
  764. //-->
  765. </script>
  766.  
  767. <script FOR="RpmCC_AR" EVENT="ComputerLookupRecord(Cid,Gid,Sid,Nme,Desc,Pswd,OSVer,Addr,Port)">
  768. <!--
  769. processComputerLookupRecord(Cid,Gid,Nme,Desc,OSVer,Addr);
  770. //-->
  771. </script>
  772.  
  773. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="ComputerOpComplete()">
  774. <!--
  775. processComputerOpComplete();
  776. //-->
  777. </script>
  778.  
  779. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="ComputerOpError()">
  780. <!--
  781. processComputerOpError();
  782. //-->
  783. </script> 
  784.  
  785. <script FOR="RpmCC_AR" EVENT="GroupLookupRecord(Gid,GNme,GDesc)">
  786. <!--
  787. processGroupLookupRecord(Gid,GNme,GDesc);
  788. //-->
  789. </script> 
  790.  
  791. <script FOR="RpmCC_AR" EVENT="GroupOpComplete()">
  792. <!--
  793. processGroupOpComplete();
  794. //-->
  795. </script> 
  796. <script FOR="RpmCC_AR" EVENT="GroupOpError()">
  797. <!--
  798. processGroupOpError();
  799. //-->
  800. </script>
  801.  
  802. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="StartCommunication()">
  803. <!--
  804. top.banner.processStartComm();
  805. //-->
  806. </script> 
  807.  
  808. <script LANGUAGE="JavaScript" FOR="RpmCC_AR" EVENT="StopCommunication()">
  809. <!--
  810. top.banner.processStopComm();
  811. //-->
  812. </script> 
  813.  
  814. <script LANGUAGE="JavaScript" src="js/PopUpMenuFunc.js"></script>
  815.  
  816. <object ID="RpmCC_AR" NAME="RpmCC_AR" WIDTH="14" HEIGHT="1" style="display:none" CLASSID="CLSID:D88C2358-FC83-11D1-BF49-00104B2D6F80" CODEBASE="controls/RPMComm.cab#version=5,2,0,0">
  817.   <param name="_Version" value="65536">
  818.   <param name="_ExtentX" value="2646">
  819.   <param name="_ExtentY" value="1341">
  820.   <param name="_StockProps" value="0">
  821. </object>
  822.  
  823. <!-- Invisible Object to Support Simulated Click Event -->
  824. <button id="FakeBut" style="display:none" onclick="top.banner.savePageCoord(event,document.body,'ViewMemoryStatus')">
  825. </button>
  826.  
  827. <select ONCHANGE="processAlertName()" SIZE="1" NAME="AL_AlertSel" id="AL_AlertSel" class="idis" style="width: 185pt" style="display: none"></select> 
  828.  
  829. <!-- Define Images used in dynamic HTML generation to force loading and caching now -->
  830. <div style="display:none">
  831. <img src="images/sViewAlerts.gif"><img src="images/selectall.gif"><img src="images/Unchecked.gif">
  832. <img src="images/unselectall.gif"><img src="images/Computer.gif"><img src="images/Printer.gif">
  833. <img src="images/Checked.gif"><img src="images/CloseImg.gif"><img src="images/NetStatusSm.bmp">
  834. <img src="images/FullView.gif"><img src="images/Normal.gif"><img src="images/Caution.gif">
  835. <img src="images/Critical.gif">
  836. </div>
  837.  
  838. <div id="GTabBx" class="GTabBox" border="0" align="left" style="display:none">
  839.  <div id="NetStatusTitleDiv" align="left" width="98%">
  840.  <table border="1"  borderColor="activeborder" align="left">
  841.     <tr><td borderColorDark="graytext" borderColorLight="white" style="font-weight:800; font-size:12pt; background-color:threedhighlight; color:windowtext"> <img src="images/MemoryWatch.gif" align="absmiddle" height="18" width="18"> MemoryWatch Monitoring </td>         
  842.    </tr>
  843.  </table><BR CLEAR=ALL><HR align="left">
  844.  </div>
  845.  
  846.  
  847. <div id="GTab" align="left" >
  848.     <table width="100%" border="0" cellspacing="0" cellpadding="0">
  849.         <tr>
  850.         <td valign="center" id="GroupTab"  class="STabSel" onclick="processGeneralClick(this)">Groups</td>
  851.         <td valign="center" id="DeviceTab"  class="STabUnsel" onclick="processGeneralClick(this)">Servers</td>
  852.         <td width="*" style="border-bottom: solid thin white"> </td>
  853.       </tr>
  854.     </table>
  855.  
  856. <div id="GroupUI" class="Lbr_border" style="border-left:solid thin white; border-bottom:solid thin graytext; border-right:solid thin graytext" SelDate="" align="center">
  857.  
  858.   <table width="100%" height="100%" border="0" cellspacing="3" cellpadding="2" >
  859.     <tr>
  860.           <td height="25px" align="center" class="inputlabel">Group Memory Status</td>
  861.       </tr>
  862.        <tr>
  863.         <td height="*" width="92%">      
  864.         <div align="center" class="RptStatusTextBox" Name="Groupwin" ID="Groupwin" ></div>
  865.       </td>
  866.      </tr>
  867.    
  868.      <tr>
  869.        <td height="30px" width="92%">
  870.           <div classFlag="idis" ><table border="1" cellspacing="1" cellpadding="1" height="30" width="100%"><tr><td width="23%" align="left" class="inputlabel"> </td><td width="54%" align="center"><button title="Show status of all servers/devices for all the Groups in the 'Devices' tab view" onclick="processSelect('0')" style="width:95px; height:24px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" id="bSelC" ><img src="images/FullView.gif" align="absmiddle" height="16" width="16"> Expand All</button>  <button title="Hide status of all servers/devices for all the Groups in the 'Devices' tab view" onclick="processSelect('1')" style="width:95px; height:24px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand" id="bUselC" ><img src="images/Collapse.gif" align="absmiddle" height="14" width="16">Collapse All</button></td><td width="23%" align="right" class="inputlabel"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr></table></div>
  871.         </td>
  872.        </tr>
  873.     </table>
  874.             
  875. </div>
  876.  
  877. <div id="DeviceUI" class="Lbr_border" style="display:none; border-left:solid thin white; border-bottom:solid thin graytext; border-right:solid thin graytext" SelDate="" align="center">
  878.  
  879.   <table width="100%" height="100%" border="0" cellspacing="3" cellpadding="2" >
  880.     <tr>
  881.           <td height="25px" align="center" class="inputlabel">Server/Workstation Memory Status</td>
  882.       </tr>
  883.        <tr>
  884.         <td height="*" width="92%">  
  885.          <div class="EventLog" ID="ELogWin" style="width:100%" align="center" ></div>
  886.             
  887.         <div align="center" class="RptStatusTextBox" Name="Devicewin" ID="Devicewin" classFlag ="idis" ></div>
  888.       </td>
  889.      </tr>
  890.    
  891.      <tr>
  892.        <td height="30px" width="92%">
  893.           <div classFlag="idis" ><table border="1" cellspacing="1" cellpadding="1" height="30" width="100%"><tr><td width="40%" align="left" class="inputlabel"> </td><td width="20%" align="center"><button id="StatusPrintButton" title="Print Memory Status Display" onclick="if (this.bdis == '0') processPrintStatus();" bdis="0" style="width:85px; height:24px" style="font-family:arial; font-size : 8pt; font-weight : 600; cursor:hand"><img src="images/Printer.gif" align="absmiddle" height="15" width="17"> Print</button></td><td width="40%" align="right" class="statuslabel"><button onclick="processBannerMenu()" title="Press to Toggle Hide/Show of Menu and Banner Frames"><img src="images/FullView.gif" align="absmiddle" height="16" width="16"></button></td></tr></table></div>
  894.         </td>
  895.        </tr>
  896.     </table>
  897. </div>
  898.  
  899. </div>
  900.  
  901. </div>
  902. </body>
  903. </html>
  904.