home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ====================================================================== DESC: Common Alert Functions for the Administer/Analyze Operations PLATFORMS: >= MS IE 4.0 USAGE NOTES: ====================================================================== */ // Process and Display the IP Services:Computer Tree function processServiceTree() { Tid = null; // clear timeout ID /* Format and Output Service tree list */ setOutHeader("IP Service : Server/Computer Tree"); // define output table header var SelT = "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; SelT += "<tr><td width='100%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Selections</td></tr></table>"; CCEs = SelT+CCEs; for ( var i=0; i<ServicesArray.length; i++) { CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'><tr><td width='25'> </td>"; Iprefx = ( i+1 >= ServicesArray.length ) ? "L" : "T"; if ( ServicesArray[i] == curSrvcName ) { CCEs += "<td width='19' align='center'><img id='sima" + i + "' expanded='0' src='images/" + Iprefx + "minus.gif' style='cursor:hand' onclick='procSrvImgClick(this)' width='19' height='20'></td>"; CurExpServIx = i; // Save Current Service Index } else { CCEs += "<td width='19' align='center'><img id='sima" + i + "' expanded='0' src='images/" + Iprefx + "plus.gif' style='cursor:hand' onclick='procSrvImgClick(this)' width='19' height='20'></td>"; } CCEs += "<td width='19' align='center'><img id='simb" + i + "' src='images/sAdminServers.gif' style='cursor:hand' onclick='procSrvImgClick(this)' width='16' height='16' title='"; CCEs += "'></td><td width='*' class='optext'>" + ServicesArray[i] + "</td></tr></table>"; CCEs += "<div id='sexp" + i + "' compcount='0' compchkcount='0'></div>"; } AL_CCOneServ.insertAdjacentHTML("beforeEnd",CCEs); if ( ALMode == "New" ) { SrvcHint.style.visibility ="visible"; SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); } SrvcHint.style.visibility ="visible"; /* If a Service is Expanded, Initiate processing for Its Associated Computers */ if ( curSrvcName != null ) { // Expand Service procSrvImgClick(document.all["sima"+CurExpServIx]); } else { SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); } } // Process and Display the Object:Counter:Computer Tree var ObjTreeIndex = 0; var OCCEstrg = ""; function processAATree() { Tid = null; // clear timeout ID /* Format and Output Object tree list */ setOutHeader("Object : Counter : Server/Computer Tree"); // define output table header var SelT = "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; SelT += "<tr><td width='100%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Selections</td></tr></table>"; OCCEstrg = SelT+CCEs; ObjTreeIndex = 0; if ( ALMode == "New" || ALMode == "Edit") { CounterHint.style.visibility ="visible"; } SetCursor("wait"); top.banner.processStartComm(); processObjectTreeOutput(); } function processObjectTreeOutput() { Tid = null; var i = ObjTreeIndex; var j = ObjTreeIndex * ObjectRecLength; var loopcount = 0; for ( ; i<ObjectLupRecCount && loopcount < 25; loopcount++, i++, j+=ObjectRecLength) { OCCEstrg += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; OCCEstrg += "<tr><td width='25'> </td>"; if ( LastObjectName == AL_OCStoreArr[j] ) { // if last Object Iprefx = "L"; } else { Iprefx = "T"; } if ( AL_OCStoreArr[j] == CurObjName ) { OCCEstrg += "<td width='19' align='center'><img id='oima" + i + "' expanded='1' src='images/" + Iprefx + "minus.gif' style='cursor:hand' onclick='procObImgClick(this)' width='19' height='20'></td>"; CurObjIx = i; // Save Current Object Index } else { OCCEstrg += "<td width='19' align='center'><img id='oima" + i + "' expanded='0' src='images/" + Iprefx + "plus.gif' style='cursor:hand' onclick='procObImgClick(this)' width='19' height='20'></td>"; } OCCEstrg += "<td width='19' align='center'><img id='oimb" + i + "' src='images/Objects.gif' style='cursor:hand' onclick='procObImgClick(this)' width='16' height='16' title='"; Odsc = AL_OCStoreArr[j+1]; // get description if ( Odsc.charAt(0) == "{" ) { // if instance var k = j; // get/preserve Object index while ( (k-=ObjectRecLength) >= 0 ) { // find decription for the instance if ( AL_OCStoreArr[k+1] == Odsc ) { continue; // if another instance } else { Odsc = AL_OCStoreArr[k+1]; break; } } // end While } OCCEstrg += Odsc + "'></td>"; OCCEstrg += "<td width='*' class='optext'>" + AL_OCStoreArr[j] + "</td>"; OCCEstrg += "</tr></table>"; OCCEstrg += "<div id='oexp" + i + "' cntrcount='0'></div>"; } AL_CCOne.insertAdjacentHTML("beforeEnd",OCCEstrg); ObjTreeIndex = i; OCCEstrg = ""; if ( i >= ObjectLupRecCount ) { Tid = setTimeout("processObjectTreeOutputDone()",50); // delay 50 ms. then process Tree } else { Tid = setTimeout("processObjectTreeOutput()",50); // delay 50 ms. then process Tree } } function processObjectTreeOutputDone() { Tid = null; /* If an Object is Expanded, Initiate Read for its Counters */ if ( CurObjName != "") { // Expand Object /* Lookup Counter Name and Description */ //CLOs = getObjIDArr(CurObjIx); var Wrk = new Array(); var OCA = AL_OCStoreArr[(ObjectRecLength*CurObjIx)+2].split(";"); //ObjID,CmpID Wrk = OCA[0].split(","); // get Object ID from pair of "ObjID,CompID" if ( RpmCC_AL.CounterLookupForObjCntrArray("ObjectID,"+Wrk[0]) ) { ALupMode = ""; top.Rstatus.Pstat("Unable to start the Counter lookup request",true); } else { CCEs = ""; // initialize output string and counter CurCntrIx = 0; ALupMode = "CounterLookupEdit"; // set Mode of operation top.Rstatus.Pstat("One moment while Counter lookup request completes"); } } else { SetCursor("auto"); top.banner.processStopCommX(); SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); } } /* Process Click on Service in Service Tree */ var CurExpServIx = null; // Index to Current Expanded Service var CmpAgrpIdAr = new Array(); function procSrvImgClick(SIm) { isx = SIm.id; if ( isx.charAt(0) != "s" || ALupMode != "" ) // if not a "simaxx" return; var cx = isx.substring(4,isx.length); // Strip off index // Close current expanded service first CObj = document.all["sima"+CurExpServIx]; EObj = document.all["sexp"+CurExpServIx]; if ( CObj.expanded == "1" ) { // if currently expanded if (EObj.compchkcount != 0) { // Are computers checked? alert("You currently have one or more servers/devices selected for the expanded IP Service.\nReset these first before expanding another IP Service and selecting its servers/devices."); return; } Cpfx = (CurExpServIx+1 >= ServicesArray.length) ? "L" : "T"; CObj.src = "images/" + Cpfx + "plus.gif"; EObj.style.display = "none"; EObj.innerHTML = ""; // Contract CObj.expanded = "0"; // Set contracted LastCmpSelectedSuffix = null; CmpsSelectedCount = 0; // reset count if ( CObj == document.all["sima"+cx]) { return; } } CurExpServIx = parseInt(cx,10); CObj = document.all["sima"+cx]; EObj = document.all["sexp"+cx]; Cpfx = (CurExpServIx+1 >= ServicesArray.length) ? "L" : "T"; if ( CObj.expanded == "1" ) { // if currently expanded CObj.src = "images/" + Cpfx + "plus.gif"; EObj.style.display = "none"; EObj.innerHTML = ""; // Contract CObj.expanded = "0"; // Set contracted if (EObj.compchkcount != 0) { // Are computers checked? LastCmpSelectedSuffix = null; CmpsSelectedCount = 0; // reset count } } else { // otherwise Expand CObj.src = "images/" + Cpfx + "minus.gif"; CObj.expanded = "1"; // Set expanded // Create Array of Computers for this Selected Service CIDArr = ""; // initialize Array SType = ServicesArray[CurExpServIx]; // Service Type if ( SType == "AGENT" ) { AgentOptions.style.visibility = "visible"; } else { AgentOptions.style.visibility = "hidden"; } CmpAgrpIdAr.length = 0; // reset for ( var i=0,j=0,k=0; i<AC_ServicesStoreArr.length; i+=ServicesRecLength ) { if ( AC_ServicesStoreArr[i+2] == SType ) { if ( CIDArr != "" ) { CIDArr += ","; } CIDArr += AC_ServicesStoreArr[i]; // Add Computer ID CmpAgrpIdAr[k++] = AC_ServicesStoreArr[i]; // save CompID Value CmpAgrpIdAr[k++] = AC_ServicesStoreArr[i+1]; // save associated AGrpID Value ++j; // bump computer count } } ALupMode = ""; // reset mode if ( (CmpsExpected = j) == 0 ) { top.Rstatus.Pstat("No Servers/Devices defined for "+SType+" Service"); } else { /* Lookup Computer Names and Descriptions */ if ( RpmCC_AL.ComputerLookupByIDArray(CIDArr) ) { top.Rstatus.Pstat("Unable to start the Computer lookup request",true); } else { CCEs = ""; CurCmpIx = 0; ALupMode = "SrvComputerLookupEdit"; // set Mode of operation top.Rstatus.Pstat("One moment while lookup request completes"); } } } } function processEditSrvComputer(CmpNme,CmpDesc,CID) { Opfx = (CurExpServIx+1 >= ServicesArray.length) ? "White" : "I"; Mpfx = (CurCmpIx+1 == CmpsExpected) ? "L" : "T"; CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; CCEs += "<tr><td width='25'> </td><td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>"; CCEs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>"; var CimgSel = "Computer.gif";// preset if ( IsCompChked(CID) ) { CCEs += "<td width='11' align='center'><img id='vima" + CurExpServIx + "_" + CurCmpIx; CCEs += "' checked='1' src='images/Checked.gif' compid='" + CID; CCEs += "' inuse='0' style='cursor:hand' onclick='procCmpImgClick(this)' width='9' height='9'></td>"; CimgSel = selectImage; LastCmpSelectedSuffix = CurExpServIx; // Save as last selected suffix ++CmpsSelectedCount; // Bump count of selected computers } else { var CmpImg = "Unchecked.gif' width='9' height='9'"; var inuseflg = "0"; var clkHnd = "procCmpImgClick(this)"; // preset available for ( var i=0; i<CmpAgrpIdAr.length; i+=2 ) { if ( CmpAgrpIdAr[i] == CID ) { // if match on Computer ID if ( CmpAgrpIdAr[i+1] != 0 && CmpAgrpIdAr[i+1] != curAGRPID ) { CmpImg = "sAdminAlerts.gif' width='16' height='16'"; inuseflg = "1' title='Assigned to Watch: "+getOnlyAlertName(CmpAgrpIdAr[i+1]); clkHnd = "procDoNothing()"; // no click handler } break; } } CCEs += "<td width='11' align='center'><img id='vima" + CurExpServIx + "_" + CurCmpIx; CCEs += "' checked='0' src='images/" + CmpImg + " compid='" + CID; CCEs += "' inuse='" + inuseflg + "' style='cursor:hand' onclick='" + clkHnd + "'></td>"; } CCEs += "<td width='19' align='center'><img id='pimb" + CurExpServIx + "_" + CurCmpIx + "' src='images/"+CimgSel+"' style='cursor:hand' onclick='" + clkHnd + "' width='14' height='16' title='"; CCEs += CmpDesc + "'></td>"; CCEs += "<td width='*' class='optext'>" + CmpNme + "</td>"; CCEs += "</tr></table>"; ++CurCmpIx; // bump index } /* Read of Computers complete; Output formatted Computers */ function processEditSrvComputerComplete() { EObj = document.all["sexp"+CurExpServIx]; EObj.insertAdjacentHTML("beforeEnd",CCEs); EObj.style.display = ""; EObj.compcount = CurCmpIx; // Count of Computers EObj.compchkcount = CkCArr.length; // Count of checked computers document.all["sima"+CurExpServIx].scrollIntoView(true); CkCArr.length = 0; // reset Checked computer array ALupMode = ""; top.Rstatus.Pstat("Request Completed"); if (ALMode == "Edit") { SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); } } /* Compute an ObjectID string array from the ObjId,CompID array in the Store */ function getObjIDArr(COix) { var Wrk0 = new Array(); var OCA = AL_OCStoreArr[(ObjectRecLength*COix)+2].split(";"); //ObjID,CmpID /* Compute Array of Computer IDs */ var scid = ""; // Object ID Array var smax = --OCA.length; // adjust for null last entry for ( var i=0; i<smax; i++ ) { Wrk0 = OCA[i].split(","); // get Object ID from pair of "ObjID,CompID" if ( i > 0) { scid += ","; // array id separator } scid += Wrk0[0]; } return scid; } var CmpsExpected = 0; // number of computers in the array being looked up // /* Process Counter's ComputerID Array; Initiate Read for Computer Info */ function processCompIDs(CntrNme,CIDArr) { var fArr = new Array(); var tArr = new Array(); var oca = ""; /* weed out duplicate Computer IDs */ fArr = CIDArr.split(","); fP = null; // previous for ( var i=0, j=0; i<fArr.length-1; i+=3 ) { if ( fArr[i] != fP) { // if not duplicate, add to ToArray fP = fArr[i]; // set new previous tArr[j++] = fP; oca += fArr[i+1]+","+fArr[i+2]+";"; } } // Update the ObjId,CntrID array in the Counter display document.all["cima"+CurExpCntrIx].ocarray = oca; CmpsExpected = tArr.length-1; CIDArr = tArr.join(","); // form array string /* Lookup Computer Names and Descriptions */ if ( RpmCC_AL.ComputerLookupByIDArray(CIDArr) ) { ALupMode = ""; top.Rstatus.Pstat("Unable to start the Computer lookup request",true); } else { CCEs = ""; CurCmpIx = 0; ALupMode = "ComputerLookupEdit"; // set Mode of operation top.Rstatus.Pstat("One moment while lookup request completes"); } } /* Process Read of Computers; Format One line of Computer Output*/ function processEditComputer(CmpNme,CmpDesc,CID) { Opfx = (CurObjName == LastObjectName) ? "White" : "I"; Cpfx = (CurExpCntrIx == CurObjIx + "_" + (CurCntrIx-1)) ? "White" : "I"; Mpfx = (CurCmpIx == CmpsExpected) ? "L" : "T"; CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'>"; CCEs += "<tr><td width='25'> </td><td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>"; CCEs += "<td width='19' height='20' align='center'><img src='images/" + Cpfx + ".gif' width='19' height='20'></td>"; CCEs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>"; var CimgSel = "Computer.gif";// preset if ( IsCompChked(CID) ) { CCEs += "<td width='11' align='center'><img id='pima" + CurExpCntrIx + "_" + CurCmpIx; CCEs += "' checked='1' src='images/Checked.gif' compid='" + CID; CCEs += "' style='cursor:hand' onclick='procCmpImgClick(this)' width='9' height='9'></td>"; CimgSel = selectImage; LastCmpSelectedSuffix = CurExpCntrIx; // Save as last selected suffix ++CmpsSelectedCount; // Bump count of selected computers } else { CCEs += "<td width='11' align='center'><img id='pima" + CurExpCntrIx + "_" + CurCmpIx; CCEs += "' checked='0' src='images/Unchecked.gif' compid='" + CID; CCEs += "' style='cursor:hand' onclick='procCmpImgClick(this)' width='9' height='9'></td>"; } CCEs += "<td width='19' align='center'><img id='pimb" + CurExpCntrIx + "_" + CurCmpIx + "' src='images/"+CimgSel+"' style='cursor:hand' onclick='procCmpImgClick(this)' width='14' height='16' title='"; CCEs += CmpDesc + "'></td>"; CCEs += "<td width='*' class='optext'>" + CmpNme + "</td>"; CCEs += "</tr></table>"; ++CurCmpIx; // bump index } /* Determine if Specified Computer Should Be Checked */ function IsCompChked(Cd) { for ( var i=0; i<CkCArr.length; i++ ) { if ( Cd == CkCArr[i] ) { return true; } } return false; } /* Read of Computers complete; Output formatted Computers */ function processEditComputerComplete() { EObj = document.all["cexp"+CurExpCntrIx]; EObj.insertAdjacentHTML("beforeEnd",CCEs); EObj.style.display = ""; EObj.compcount = CurCmpIx; // Count of Computers EObj.compchkcount = CkCArr.length; // Count of checked computers document.all["cima"+CurExpCntrIx].scrollIntoView(true); CkCArr.length = 0; // reset Checked computer array ALupMode = ""; SetCursor("auto"); top.banner.processStopCommX(); top.Rstatus.Pstat("Request Completed"); if (ALMode == "Edit" || DuplicateFlag) { SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); } } /* Uncheck computers from previous Counter */ function goResetSelectedComps(dp,cp) { var dx = LastCmpSelectedSuffix; FObj = document.all[dp+"exp"+dx]; // DIV containing other selected computers for ( var i=0; i<FObj.compcount; i++ ) { CmpObj = document.all[cp+"ima"+dx+"_"+i]; CmpObjImg = document.all["pimb"+dx+"_"+i]; if ( CmpObj.checked == "1" ) { CmpObj.src = "images/Unchecked.gif"; CmpObj.checked = "0"; // Set Unchecked CmpObjImg.src = "images/Computer.gif"; } } FObj.compchkcount = 0; // clear count of computers checked CmpsSelectedCount = 0; LastCmpSelectedSuffix = null; } /* Create Array of Service Computers */ var SrvCIDArr = ""; function createServiceIDArray() { SrvCIDArr = ""; // default no computers selected var cx = LastCmpSelectedSuffix; if (cx == null) { return false; } curSrvcName = ServicesArray[cx]; // get current Service type /* Create an array of selected computers */ CXObj = document.all["sexp"+cx]; // DIV object for Computer expansion for ( var i=0, j=0; i<CXObj.compcount; i++ ) { // Test each computer for Checked if ( document.all["vima"+cx+"_"+i].checked == "1" ) { if ( SrvCIDArr != "" ) { // if not first, add comma separator SrvCIDArr += ","; } SrvCIDArr += document.all["vima"+cx+"_"+i].compid; // save Computer ID } } if ( SrvCIDArr == "" ) return false; else return true; } var Tops = ""; // output string var OObj = null; // Object output var OCArray = new Array(); // ComputerID,ObjectID pair array var CkCArr = new Array(); // "Checked" Computers array var curAGRPID = null; // Current Alert Grp ID selected var curSrvcName = null; // Current Service Name selected var PINP_Bsy = false; var AGerr = false; // Alert Group error flag function populateInput(idx) { AGerr = false; PINP_Bsy = true; var srvcarr = new Array(); var wnarr = new Array(); var wrk = new Array(); var pwrka = new Array(); curAGRPID = AlertStoreArr[idx+1]; // Alert Group ID AL_Alert.value = AlertStoreArr[idx+0]; // Synchronize name field with Store name field AL_Desc.value = (AlertStoreArr[idx+2].length == 0) ? "" : AlertStoreArr[idx+2]; AL_Thrsh.value = (AlertStoreArr[idx+3].length == 0) ? "" : AlertStoreArr[idx+3]; AL_TUnder.checked = (AlertStoreArr[idx+4] == "1") ? "checked" : ""; AL_EveryT.checked = (AlertStoreArr[idx+5] == "1") ? "checked" : ""; AL_Dur.value = (AlertStoreArr[idx+6].length == 0) ? "" : AlertStoreArr[idx+6]; /* Determine Schedule */ var Ia = new Array(); var i = (AlertStoreArr[idx+7].length == 0) ? "" : AlertStoreArr[idx+7]; Ia = i.split(","); if ( (CDCount = Ia[1]) != 0 ) { CDUnits = 2; // default to hours } else { if ( (CDCount = Ia[3]) == 0 ) { ++CDCount; } CDUnits = Ia[2]; } AL_Sched.value = " " + CDCount + " " + SchedTxtArray[CDUnits]; // Determine Severity var Sev = AlertStoreArr[idx+23]; pwrka = Sev.split("]["); // parse out Severity var SevDefault = ( pwrka.length > 5 ) ? false : true;; AL_WASeveritySel.selectedIndex = ( pwrka.length > 5 ) ? parseInt(pwrka[5],10) : 1; AL_WASeverity.value = SeverityArray[ AL_WASeveritySel.selectedIndex ]; pwrka.length = 0; // reset // If Counter Type, get Computers,Object,Counter (COC) to an Array OCIx = 0; // initialize index OCArray.length = 0; if ( AlertStoreArr[idx+10] != "" && AlertStoreArr[idx+10].length > 1 ) { OCArray = AlertStoreArr[idx+10].split(";"); } var StartDT = (AlertStoreArr[idx+8].length == 0) ? "" : AlertStoreArr[idx+8]; if ( StartDT == "01/01/1999 11:30:00" || StartDT == "1/1/1999 11:30:0" ) { // Service type CurrentAT = ServiceType; OObj = AL_CCOneServ; /* Compute Array of Computer IDs */ CompIdLupArr = ""; // Computer Id Array CkCArr.length = 0; // reset Checked computer array if ( SevDefault ) { AL_WASeveritySel.selectedIndex = 2; AL_WASeverity.value = "Critical"; } for ( var i=0,j=0,srvcix; i<AC_ServicesStoreArr.length; i+=ServicesRecLength ) { if ( AC_ServicesStoreArr[i+1] == curAGRPID ) { srvcix = i; // save found index for typical entry CkCArr[j] = AC_ServicesStoreArr[i]; // save in Array of Checked computers if ( j > 0) { CompIdLupArr += ","; // array id separator } else { // check if Suspended srvcarr = AC_ServicesStoreArr[i+3].split("~"); AL_Suspend.checked = ( srvcarr[11] == "1" ) ? "checked" : ""; } CompIdLupArr += CkCArr[j]; ++j; // bump computer count } } SrvcNmeRow.style.visibility = "visible"; if ( j == 0 ) { // if no computers, invalid AlertGroup top.Rstatus.Pstat("No Services Found Error!",true); processPopInError(); return; } // Determine if scroll bars required AL_CCOneServ.style.overflow = ( j > 9 ) ? "scroll" : ""; // Set up Dependency info if any var did = AlertStoreArr[idx+23]; pwrka = did.split("]["); // parse out Suppress Monitoring parameters did = pwrka[0]; // Dependency // initialize the Suppress Monitoring parameters for ( var i=0; i<6; i++ ) { Suppress1[i] = Suppress2[i] = 0; } if ( pwrka.length > 1 ) { if (pwrka[1] != "" ) { Suppress1 = pwrka[1].split("^"); } } processInactPer1Value(); // go set value if ( pwrka.length > 2 ) { if (pwrka[2] != "" ) { Suppress2 = pwrka[2].split("^"); } } processInactPer2Value(); // go set value AL_Dependency.value = ""; // preset AL_DependencySel.options[0].selected = "selected"; if ( did != "" ) { for (var i=0; i < AlertStoreArr.length; i+=AlertRecLength) { if ( AlertStoreArr[i+1] == did ) { AL_Dependency.value = AlertStoreArr[i]; for ( var j=1; j<AL_DependencySel.length; j++ ) { if ( AL_DependencySel.options[j].text == AL_Dependency.value ) { AL_DependencySel.options[j].selected = "selected"; break; } } break; } } } AL_SrvcNme.value = curSrvcName = AC_ServicesStoreArr[srvcix+2]; // Service name if ( AL_SrvcNme.value == "AGENT" ) { AgentOptions.style.visibility = "visible"; } else { AgentOptions.style.visibility = "hidden"; } var freqar = new Array(); freqar = AC_ServicesStoreArr[srvcix+3].split("~"); // Parse Services string if ( freqar[7] != "0" ) { SrvUnits = 0; SrvCount = parseInt(freqar[7],10); } else if ( freqar[8] != "0" ) { SrvUnits = 1; SrvCount = parseInt(freqar[8],10); } else if ( freqar[9] != "0" ) { SrvUnits = 2; SrvCount = parseInt(freqar[9],10); } else if ( freqar[10] != "0" ) { SrvUnits = 3; SrvCount = parseInt(freqar[10],10); } AL_SrvFreq.value = " " + SrvCount + " " + SchedTxtArray[SrvUnits]; AL_MaxAlerts.value = MaxAlertsCount = AL_Thrsh.value; if ( AL_SrvcNme.value == "AGENT" ) { var ckarr = new Array(); ckarr = freqar[13].split(","); AL_MemCheck.value = ckarr[0]; AL_HDDCheck.value = ckarr[1]; } formatComputerDisplay(); // format display for computer output processPopulateCounterInputComplete(); // Start lookup for Computer Names/Descriptions } else if ( StartDT == "01/01/1999 11:50:00" || StartDT == "1/1/1999 11:50:0" ) { // User type CurrentAT = UserType; OObj = null; // Object output SetButtonState(UNewButton,"0"); SetButtonState(UEditButton,"0"); SetButtonState(UDupButton,"0"); SetButtonState(UDeleteButton,"0"); PINP_Bsy = false; if (AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden" && !AL_AlertSel.disabled) { AL_AlertSel.focus(); } top.Rstatus.Pstat(""); } else if ( StartDT == "01/01/1999 11:40:00" || StartDT == "1/1/1999 11:40:0" ) { // EventLog type CurrentAT = EventLogType; OObj = AL_CCOneEventLog; // Object output formatComputerDisplay(); // format display for computer output processPopulateELComputers(); } else if ( StartDT == "01/01/1999 11:20:00" || StartDT == "1/1/1999 11:20:0" ) { // SNMP Trap type CurrentAT = SNMPTrapType; OObj = AL_CCOneSNMPTrap; // Computer output formatComputerDisplay(); // format display for computer output ALMode = ""; // reset mode processPopulateSNMPTrapComputers(); } else if ( StartDT == "01/01/1999 11:10:00" || StartDT == "1/1/1999 11:10:0" ) { // Win Srvcs type CurrentAT = WinServicesType; OObj = AL_CCOneWinServ; // Computer output formatComputerDisplay(); // format display for computer output ALMode = ""; // reset mode processPopulateWSTComputers(); } else if ( StartDT == "01/01/1999 11:00:00" || StartDT == "1/1/1999 11:0:0" ) { // File Check type CurrentAT = FileCheckType; OObj = AL_CCOneFileCheck; // Computer output formatComputerDisplay(); // format display for computer output ALMode = ""; // reset mode processPopulateFileCheckComputers(); } else if ( StartDT == "01/01/1999 11:12:00" || StartDT == "1/1/1999 11:12:0" ) { // File Check type CurrentAT = ProcessCheckType; OObj = AL_CCOneProcessCheck; // Computer output formatComputerDisplay(); // format display for computer output ALMode = ""; // reset mode processPopulateProcessCheckComputers(); } else if ( StartDT == "01/01/1999 11:15:00" || StartDT == "1/1/1999 11:15:0" ) { // Syslog Check type CurrentAT = SyslogCheckType; OObj = AL_CCOneSyslogCheck; // Computer output formatComputerDisplay(); // format display for computer output ALMode = ""; // reset mode processPopulateSyslogCheckComputers(); } else { CurrentAT = CounterType; OObj = AL_CCOne; // Fix up EveryTime check box AL_EveryT.checked = (CDUnits == 0 && CDCount == 1) ? "checked" : ""; // Set suspened checkbox if S/D/T indicates it AL_Suspend.checked = ""; // preset not suspended var did = AlertStoreArr[idx+23]; var pwrka = new Array(); pwrka = did.split("]["); // parse out Dependency, Suppress Monitoring parameters, & Counter MaxAlerts AL_MaxAlerts.value = MaxAlertsCount = (pwrka.length >= 4) ? pwrka[3] : ""; var cwr = (pwrka.length >= 5) ? pwrka[4] : "0"; AL_CWRestore.checked = (cwr == "0") ? "" : "checked"; if ( OCArray == "" ) { // if COC Array empty top.Rstatus.Pstat("No Servers Found Error!",true); processPopInError(); return; } var WrkArr = new Array(); // working array var nd = ""; // Name,Description string // get Obj ID from first triplet of "CompId.ObjId,CntrId" WrkArr = OCArray[0].split(","); CurObjID = WrkArr[1]; // Get Object ID; Set CurObjIx CurCntrID = WrkArr[2]; // Get Counter ID nd = getObjectName(CurObjID); if ( nd == null ) { PINP_Bsy = false; top.Rstatus.Pstat("Invalid ObjectID from Object Entry",true); return; } WrkArr = nd.split(","); // Split Name and Description CurObjName = WrkArr[0]; // Current Object expanded CurObjDesc = WrkArr[1]; // Object Description CurCntrName = ""; // Init Open Counter name /* Lookup Counter Name and Description */ if ( RpmCC_AL.CounterLookupForObjCntrArray("CounterID,"+CurCntrID) ) { ALupMode = ""; top.Rstatus.Pstat("Unable to start the Counter lookup request",true); SetButtonState(UNewButton,"0"); } else { ALupMode = "CounterLookupPopIn"; // set Mode of operation top.Rstatus.Pstat("One moment while Counter lookup request completes"); } } if ( OObj != null ) { OObj.style.backgroundColor = "threedlightshadow"; OObj.style.height = CCOneBoxHeight; OObj.innerHTML = ""; // clear current display } AL_RunIt.checked = (AlertStoreArr[idx+11] == "1") ? "checked" : ""; AL_ExecP.style.display = ""; AL_ArgsP.style.display = ""; var rpn = (AlertStoreArr[idx+12].length == 0) ? "" : AlertStoreArr[idx+12]; if ( rpn == '>"RESTART"' ) { // execute remote reboot? document.RunPrgmRadio.AL_PLoc[0].checked = ""; document.RunPrgmRadio.AL_PLoc[1].checked = ""; document.RunPrgmRadio.AL_PLoc[2].checked = "checked"; rpn = ""; processPLocClick(); } else if ( rpn.charAt(0) == ">" ) { // execute remotely? document.RunPrgmRadio.AL_PLoc[0].checked = ""; document.RunPrgmRadio.AL_PLoc[1].checked = "checked"; document.RunPrgmRadio.AL_PLoc[2].checked = ""; rpn = rpn.substring(1,rpn.length); // strip off ">" } else { document.RunPrgmRadio.AL_PLoc[0].checked = "checked"; document.RunPrgmRadio.AL_PLoc[1].checked = ""; document.RunPrgmRadio.AL_PLoc[2].checked = ""; } AL_ExecP.value = rpn; AL_ArgsP.value = (AlertStoreArr[idx+13].length == 0) ? "" : AlertStoreArr[idx+13]; AL_ENotify.checked = (AlertStoreArr[idx+14] == "1") ? "checked" : ""; AL_EAddr.value = (AlertStoreArr[idx+15].length == 0) ? "" : AlertStoreArr[idx+15]; var est = (AlertStoreArr[idx+16].length == 0) ? "" : AlertStoreArr[idx+16]; var estarr = new Array(); estarr = est.split("[+]"); AL_ESubj.value = estarr[0]; EmailText.value = ( estarr.length > 1 ) ? estarr[1] : ""; EmailTextDefined.style.display = ( EmailText.value != "" ) ? "" : "none"; AL_Phone.checked = (AlertStoreArr[idx+17] == "1") ? "checked" : ""; var wnbr = (AlertStoreArr[idx+18].length == 0) ? "" : AlertStoreArr[idx+18]; // Analyze Pager string to parse correctly AL_PhoneNbr.value = wnbr; // preset if ( wnbr.indexOf("^") >= 0 ) { wnarr = wnbr.split("^"); estarr = wnarr[0].split("[+]"); AL_AccessNbr.value = estarr.join(";"); if ( wnarr[1].indexOf(";") >= 0 ) { wnarr = wnarr[1].split(";"); estarr = wnarr[0].split("[+]"); AL_PagePswd.value = estarr.join(";"); } estarr = wnarr[1].split("[+]"); AL_PhoneNbr.value = estarr.join(";"); } else if ( wnbr.indexOf(";") >= 0 ) { wnarr = wnbr.split(";"); estarr = wnarr[0].split("[+]"); AL_AccessNbr.value = estarr.join(";"); AL_PhoneNbr.value = wnarr[1]; estarr = wnarr[1].split("[+]"); AL_PhoneNbr.value = estarr.join(";"); } AL_TTSpeak.value = (AlertStoreArr[idx+19].length == 0) ? "" : AlertStoreArr[idx+19]; AL_Beeper.checked = (AlertStoreArr[idx+20] == "1") ? "checked" : ""; AL_BeeperNbr.value = (AlertStoreArr[idx+21].length == 0) ? "" : AlertStoreArr[idx+21]; AL_TTSend.value = (AlertStoreArr[idx+22].length == 0) ? "" : AlertStoreArr[idx+22]; AL_Sched.value = (AL_EveryT.checked) ? "" : AL_Sched.value; wrk = SmtpServerAddress.split("~"); AL_Smtp.value = wrk.join("; "); processTypeClick(); } function processPopInError() { AGerr = true; // set state OObj.innerHTML = ""; // clear SetButtonState(UNewButton,"0"); SetButtonState(UEditButton,"0"); SetButtonState(UDupButton,"0"); SetButtonState(UDeleteButton,"0"); processTypeClick(); curSrvcName = null; // Reset durrent Service Name LastCmpSelectedSuffix = null; CmpsSelectedCount = 0; // reset count AL_CCOneServ.style.backgroundColor = "threedlightshadow"; AL_CCOneServ.style.height = CCOneBoxHeight; AL_CCOneServ.style.overflow = ""; AL_AlertSel.disabled = ""; if (AL_AlertSel.style.display == "" && AL_AlertSel.style.visibility != "hidden") { AL_AlertSel.focus(); } PINP_Bsy = false; return; } /* Initiate read for Event Log Monitored Computers */ function processPopulateELComputers() { if ( RpmCC_AL.ELMonitorLookupByAlertGroup(curAGRPID) ) { ALupMode = ""; PINP_Bsy = false; top.Rstatus.Pstat("Unable to start the Server lookup request",true); } else { CountOfComps = CountOfCompsRcvd = 0; CompIdLupArr = ""; // Computer Id Array ALupMode = "ELComputerLookupPopIn"; // Mode top.Rstatus.Pstat("One moment while Server lookup request completes"); } } function processELMonitorLookupRecord(ELCrec) { var wrkarr = new Array(); ++CountOfCompsRcvd; wrkarr = ELCrec.split("~"); // parse the computer record if ( CountOfCompsRcvd == 1 ) { // if first // Set specifications for ( var i=0; i<LogTable.length; i++ ) { if ( LogTable[i] == wrkarr[4] ) { AL_EvLogName.options[i].selected = "selected"; // Select log AL_LogNmeDisp.value = wrkarr[4]; break; } } if (wrkarr[5] == "0") wrkarr[5] = ""; for ( var i=0; i<TypeTable.length; i++ ) { if ( TypeTable[i] == wrkarr[5] ) { AL_EvLogType.options[i].selected = "selected"; // Select type AL_LogTypeDisp.value = AL_EvLogType.options[i].text; break; } } AL_EvSrc.value = (wrkarr[11] == "0") ? "": wrkarr[6]; AL_EvCat.value = (wrkarr[12] == "0") ? "": wrkarr[7]; AL_EvID.value = (wrkarr[13] == "0") ? "": wrkarr[8]; var warr = new Array(); AL_EvMsg.value = (wrkarr[14] == "0") ? "": wrkarr[9]; warr = AL_EvMsg.value.split("\x09"); if ( warr.length > 1 ) { AL_EvMsg.value = warr.join("&T"); } AL_LogNot.checked = (wrkarr[15] == "1") ? "": "checked"; AL_LogAnd.checked = (wrkarr[16] == "0") ? "": "checked"; AL_LogExclude.checked = (wrkarr.length >= 19 && wrkarr[18] == "1") ? "checked" : ""; AL_Suspend.checked = (wrkarr[1] == "1") ? "": "checked"; if ( wrkarr.length >= 18 ) { AL_ELPrec.selectedIndex = parseInt(wrkarr[17],10); } } else { CompIdLupArr += ","; // Computer Id Array } CompIdLupArr += wrkarr[2]; // Computer Id Array } // Common format for Computers Output Display function formatComputerDisplay() { Tops = "<table border='0' cellpadding='0' cellSpacing='1' width='492'>"; Tops += "<tr><td colspan='2' width='100%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Selections</td></tr>"; Tops += "<tr><td width='50%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Server/Computer Name</td>"; Tops += "<td width='50%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Description</td></tr>"; } var CountOfComps = 0; var CountOfCompsRcvd = 0; var CompIdLupArr = ""; function processPopulateInputCounter(CntrNme,CntrDesc,OCA) { if ( CurCntrName != "" ) { // If Current Open Counter Name define return; // exit since already found } var OCWrkArr = new Array(); // working array var WrkArr = new Array(); // working array OCWrkArr = OCA.split(";"); // Get ObjID,CounterID pair smax = --OCWrkArr.length; // adjust for null last entry for ( var i=0; i<smax; i++ ) { WrkArr = OCWrkArr[i].split(","); // get Cntr ID from pair of "ObjID,CntrID" if (CurCntrID == WrkArr[1]) // if match on CntrID break; } if ( i >= smax ) { // if no match PINP_Bsy = false; return; } CntrObNmeRow.style.visibility = "visible"; AL_CntrNme.value = CurCntrName = CntrNme; // Current Open Counter CurCntrDesc = CntrDesc; AL_ObjNme.value = CurObjName; CntrObNmeRow.style.visibility = "visible"; formatComputerDisplay(); // format display for computer output /* Compute Array of Computer IDs */ CompIdLupArr = ""; // Computer Id Array CkCArr.length = 0; // reset Checked computer array smax = --OCArray.length; // adjust for null last entry for ( i=0; i<smax; i++ ) { // get Computer ID from triplet of "CompId.ObjId,CntrId" WrkArr = OCArray[i].split(","); CkCArr[i] = WrkArr[0]; // save in Array of Checked computers if ( i > 0) { CompIdLupArr += ","; // array id separator } CompIdLupArr += WrkArr[0]; } // Determine if scroll bars required AL_CCOne.style.overflow = ( CkCArr.length > 9 ) ? "scroll" : ""; } /* OpComplete for the CounterLookupForObjCounterArray */ function processPopulateCounterInputComplete() { /* Lookup Computer Names and Descriptions */ if ( RpmCC_AL.ComputerLookupByIDArray(CompIdLupArr) ) { ALupMode = ""; PINP_Bsy = false; top.Rstatus.Pstat("Unable to start the Server lookup request",true); } else { CountOfComps = CountOfCompsRcvd = 0; ALupMode = "ComputerLookupPopIn"; // Mode top.Rstatus.Pstat("One moment while Server lookup request completes"); } } function processPopulateInputComputer(CmpNme,CmpDesc,Cid) { /* Format Computer Name and Description */ var tw = ( CurrentAT == WinServicesType ) ? "optextb" : "optext"; Tparm = ( AL_Suspend.checked ) ? "optextr" : tw; Tops += "<tr><td width='50%' class='"+Tparm+"' title='"+CmpNme+"'>"; var CmpNmeN = ( CmpNme.length > 40 ) ? CmpNme.substring(0,40)+"..." : CmpNme; Tops += CmpNmeN + "</td>"; Tops += "<td width='50%' class='"+Tparm+"' title='"+CmpDesc+"'>"; var CmpDescN = ( CmpDesc.length > 40 ) ? CmpDesc.substring(0,40)+"..." : CmpDesc; Tops += CmpDescN + "</td></tr>"; // If Windows Services if ( CurrentAT == WinServicesType ) { var SrvId, SrvcName, DispName, WAix; for ( var i=0; i<WSrvcsLinkIDRecs.length; i+=WSrvcsLinkIDRecsLength ) { if ( WSrvcsLinkIDRecs[i+1] == Cid ) { SrvId = parseInt(WSrvcsLinkIDRecs[i],10); WAix = GetWinServicesArrEntryIndex( SrvId ); SrvcName = WinServicesArr[WAix+1]; // get Service Name DispName = WinServicesArr[WAix+2]; // get Display Name Tops += "<tr><td width='100%' colspan='2' class='optext'> -"; Tops += DispName + " ("+SrvcName+")</td></tr>"; } } } } function processPopulateInputComplete() { /* Final Format and Output */ Tops += "</table></center>"; OObj.insertAdjacentHTML("beforeEnd",Tops); OObj.scrollIntoView(true); ALupMode = ""; top.Rstatus.Pstat("Request Completed"); SetButtonState(UNewButton,"0"); SetButtonState(UEditButton,"0"); SetButtonState(UDupButton,"0"); SetButtonState(UDeleteButton,"0"); SetButtonState(WatchReportButton,"0"); if (AL_AlertSel.style.display == "" && !AL_AlertSel.disabled && AL_AlertSel.style.visibility != "hidden") { AL_AlertSel.focus(); } PINP_Bsy = false; if ( top.QuickStartProcessing ) { showHelp('Help/QuickStart_Help.htm#ConfigureWatches'); CurrentAT = ServiceType; processTypeClick(); processNewContinue(); window.focus(); } } /* Process Counter and Computer OP Complete Event */ function processCounterOpComplete() { /* If PopulateInputCounter, Go process */ if (ALupMode == "CounterLookupPopIn") { processPopulateCounterInputComplete() } /* If PopulateInputComputer, Go process */ else if (ALupMode == "ComputerLookupPopIn") { processPopulateInputComplete(); } /* If Counter Edit, Go process */ else if (ALupMode == "CounterLookupEdit") { processEditCounterComplete(); } /* If Computer Edit, Go process */ else if (ALupMode == "ComputerLookupEdit") { processEditComputerComplete(); } /* If Computer Edit, Go process */ else if (ALupMode == "SrvComputerLookupEdit") { processEditSrvComputerComplete(); } } var ELM_Ar = new Array(); function createElmArray() { ELM_Ar.length = 0; // reset array // Find & create array of selected computers for ( var i=0, j=0, k=0; i<CompRecCount; ++i ) { j = (i*CompRecLength); // index to Computer entry in store if ( AC_CompStoreArr[j+4] == "1" ) { // if selected ELM_Ar[k++] = AC_CompStoreArr[j]; // save computer ID } } return ((k==0) ? false : true); } var TypeTable = new Array("","1","2","4","8","16","24"); var LogTable = new Array("Application","Security","System","Directory Service","DNS Server","File Replication Service"); function processELMonitorAdd() { // Get parameters var LogSus = (AL_Suspend.checked) ? "0" :"1"; var LogSel = LogTable[AL_EvLogName.selectedIndex]; var TypeSel = TypeTable[AL_EvLogType.selectedIndex]; var cType = (TypeSel == "")? "0" : "1"; var cSrc = (AL_EvSrc.value == "") ? "0": "1"; var cCat = (AL_EvCat.value == "") ? "0": "1"; var cID = (AL_EvID.value == "") ? "0": "1"; var cMsg = (AL_EvMsg.value == "") ? "0": "1"; var cAnd = (AL_LogAnd.checked) ? "1": "0"; var pMsg = (AL_LogNot.checked) ? "0": "1"; //"1"; pMsg = "1" -> Inclusion var eMsg = (AL_LogExclude.checked) ? "1": "0"; var pStrg = curAGRPID;// Alert Group ID var Precedence = AL_ELPrec.selectedIndex; var warr = new Array(); warr = AL_EvMsg.value.split("&T"); if ( warr.length > 1 ) { AL_EvMsg.value = warr.join("\x09"); } // Build Argument string for all computers selected for ( var i=0; i<ELM_Ar.length; i++ ) { pStrg += "~"+LogSus+"~"+ELM_Ar[i]+"~"+LogSel+"~"+TypeSel+"~"+AL_EvSrc.value; pStrg += "~"+AL_EvCat.value+"~"+AL_EvID.value+"~"+AL_EvMsg.value; pStrg += "~"+cType+"~"+cSrc+"~"+cCat+"~"+cID+"~"+cMsg+"~"+pMsg+"~"+cAnd+"~"+Precedence+"~"+eMsg; } // if unable to initiate request if ( RpmCC_AL.ELMonitorAdd(pStrg) ) { top.Rstatus.Pstat("Unable to start the UPDATE request",true); processResetButton(); } else { // waiting for OperationCompleteEvent top.Rstatus.Pstat("One moment while UPDATE request completes"); processGeneralClick(CounterTab); } } function processELMonitorOpComplete() { if ( ALupMode == "ELComputerLookupPopIn" ) { if ( CountOfCompsRcvd > 0 ) { processPopulateELComputersComplete(); // Complete, delay 100 ms. then finish } else { ALMode = ""; // reset mode top.Rstatus.Pstat("No associated Servers found for this EventLogWatch",true); processPopInError(); // go reset } } else if ( ALupMode == "ELMonitorAdd" ) { ALupMode = ""; if ( ALMode == "New" ) { ALMode = ""; // reset mode processAlLookupReset(); } else if ( ALMode == "Edit" ) { // Insure Service Checking is Enabled //if ( RpmCC_AL.StartStopServicesCheck("1") ) { // if unable to initiate request // top.Rstatus.Pstat("Unable to restart the SERVICES Checking",true); //} ALMode = ""; // reset mode finishEditComplete(); } } else if ( ALupMode == "ELMDelAll" ) { if ( ALMode == "Edit" ) { ALupMode = "ELMonitorAdd"; processELMonitorAdd(); } } } function processPopulateELComputersComplete() { AL_CCOneEventLog.style.overflow = ( CountOfCompsRcvd > 9 ) ? "scroll" : ""; processPopulateCounterInputComplete(); } function processELMonitorOpError() { top.Rstatus.Pstat("Error updating EventLogWatcht",true); processResetButton(); } //----------------------------------------------------------------------- /* Windows Services Monitoring Routines */ // function processWinSrvcsDisplayChoice() { var wsdc = (document.WinSrvcRadio.AL_WinSrvcDisp[1].checked ) ? "1" : "0"; top.banner.RpmCC_Ban.RegSetKey(top.banner.ServerID+"WinServicesDisplayChoice",wsdc); // set state processGroupOpComplete(); } // Process and Display the Windows Services Tree function processWinServicesTree() { AL_CCOneWinServ.innerHTML = ""; // clear var wsdc = top.banner.RpmCC_Ban.RegGetKey(top.banner.ServerID+"WinServicesDisplayChoice"); // set state document.WinSrvcRadio.AL_WinSrvcDisp[1].checked = ( wsdc == "1" ) ? "checked" : ""; if ( WinServciesMonitorLookupRequired ) { // force reread of Monitor records? GetWinServicesMonitorRecords(); ALupMode = "WinSrvsTreeSetup"; } else { processWinServicesTreeContinue(); } } function processWinServicesTreeContinue() { processInitialLookup("WinSrvcCompLookup"); } var WCSrvcsDispCount = 0; var LWCSDispIx = 0; function processWinServicesByService() { AL_CCOneWinServ.innerHTML = ""; // clear setOutHeader("Windows Services : Server/Computer Tree"); // define output table header var SelT = "<table border='0' cellpadding='0' cellSpacing='1' width='490'>"; SelT += "<tr><td width='100%' height='2' align='center' valign='top' class='optextb' style='background-color:graytext; color:captiontext'>Selections</td></tr></table>"; CCEs = SelT+CCEs; WCSrvcsDispCount = 0; LWCSDispIx = 0; wsbsIx = 0; processWinServicesByServiceContinue(); } var wsbsIx = 0; function processWinServicesByServiceContinue() { Tid = null; var WSAmax = WinServicesSortedArr.length, WSAix = 0; var loopcount = 0; for ( var i = wsbsIx; i<WSAmax && loopcount < 25; loopcount++, ++i) { WSAix = WinServicesSortedArr[i] * WinServicesArrEntrySz; Iprefx = ( i+1 >= WSAmax ) ? "L" : "T"; CCEs += "<table border='0' cellpadding='0' cellSpacing='0' width='490'><tr><td width='25'> </td>"; CCEs += "<td width='19' align='center'><img id='wsra" + WSAix + "' expanded='0' src='images/" + Iprefx + "plus.gif' style='cursor:hand' onclick='procWinSrvImgClick(this)' width='19' height='20'></td>"; CCEs += "<td width='19' align='center'><img id='wsrb" + WSAix + "' src='images/WinServices.gif' style='cursor:hand' onclick='procWinSrvImgClick(this)' width='18' height='18' title='"; CCEs += "'></td><td width='*' slid='' somechecked=0 class='optext' id='wsrc" + WSAix + "'>" + WinServicesArr[WSAix+2] + " ("+WinServicesArr[WSAix+1]+")</td></tr></table>"; CCEs += "<div id='wsrx" + WSAix + "' wslrec='' somechecked=0 checkedcomps=0 compcount=0 compchkcount=0></div>"; ++WCSrvcsDispCount; // bump count LWCSDispIx = (WSAix > LWCSDispIx) ? WSAix : LWCSDispIx; // save index to identify last service } AL_CCOneWinServ.insertAdjacentHTML("beforeEnd",CCEs); wsbsIx = i; CCEs = ""; if ( i >= WSAmax ) { Tid = setTimeout("processWinServicesByServiceDone()",50); // delay 50 ms. then process } else { Tid = setTimeout("processWinServicesByServiceContinue()",50); // delay 50 ms. then process } } function processWinServicesByServiceDone() { if ( ALMode == "New" ) { SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); top.Rstatus.Pstat("Done"); } else { // Edit WSCMAix = 0; // initialize WSrvcsCompLinkIDRecs.length = 0; WSrvcsCompLinkIDRecsIndex = 0; ALupMode = "WSrvcsCompLinkLookup"; processWSrvcsCompLinkIDLookup(); } } // Get Computer and Service for each Monitor Service record function processWSrvcsCompLinkIDLookup() { var i=0, ArgStr = ""; while ( i < WinServicesMonitorArr.length ) { if ( WinServicesMonitorArr[i+3] == curAGRPID ) { ArgStr += WinServicesMonitorArr[i+2]+"~"; } i += WinServicesMonitorArrEntrySz; // bump index } if ( RpmCC_AL.NTServicesLinkListLookupByID( ArgStr ) ) { // if unable to initiate request ALupMode = ""; // reset PINP_Bsy = false; top.Rstatus.Pstat("Unable to start the WinServicesWatch Server lookup request",true); } } // Process each NT services Link Record var WSrvcsCompLinkIDRecs = new Array(); var WSrvcsCompLinkIDRecsIndex = 0; var WSrvcsCompLinkIDRecsLength = 3; function processWSrvcsCompLinkIDLookupRecord(WSLIDrec) { var warr = new Array(); var warr1 = new Array(); WSrvcsCompLinkIDRecsIndex = 0; // reset warr1 = WSLIDrec.split(";"); for ( var i=0; i<warr1.length; i++ ) { warr = warr1[i].split("~"); WSrvcsCompLinkIDRecs[ WSrvcsCompLinkIDRecsIndex++ ] = warr[1]; //Services List ID WSrvcsCompLinkIDRecs[ WSrvcsCompLinkIDRecsIndex++ ] = warr[2]; //Computer ID WSrvcsCompLinkIDRecs[ WSrvcsCompLinkIDRecsIndex++ ] = warr[0]; //Services Link ID } WSCObjArr.length = 0; // reset WSCObjArrIx = 0; processWinSrvcCompLupDone(); } var WSCObjArr = new Array(); var WSCObjArrIx = 0; function processWinSrvcCompLupDone() { WSrvcsCompLinkIDRecsIndex = 0; // reset while ( WSrvcsCompLinkIDRecsIndex < WSrvcsCompLinkIDRecs.length ) { var SLid = WSrvcsCompLinkIDRecs[ WSrvcsCompLinkIDRecsIndex ]; var srvcid = GetWinServicesArrEntryIndex( parseInt(SLid,10) ); var WSObj = document.all["wsrc"+srvcid]; WSObj.className = "optextb"; WSObj.somechecked = 1; WSObj.slid = SLid; WSrvcsCompLinkIDRecsIndex += WSrvcsCompLinkIDRecsLength; // bump index } ALupMode = ""; WSCObjArr.length = 0; SetButtonState(UUpdateButton,"0"); SetButtonState(UResetButton,"0"); top.Rstatus.Pstat("Done"); } var curWinSrvsIx = null; function procWinSrvImgClick(WSimo) { var isx = WSimo.id; if ( isx.charAt(0) != "w" ) return; var cx = isx.substring(4,isx.length); // Strip off index cx = parseInt(cx,10); curWinSrvsIx = cx; var Cpfx = (cx >= LWCSDispIx) ? "L" : "T"; var CObj = document.all["wsra"+cx]; // Clicked Service Entry var EObj = document.all["wsrx"+cx]; if ( CObj.expanded == "1" ) { // if currently Expanded, Contract CObj.src = "images/"+Cpfx+"Plus.gif"; CObj.expanded = "0"; // Set contracted EObj.style.display = "none"; } else { // otherwise Expand Windows Services CObj.src = "images/"+Cpfx+"Minus.gif"; CObj.expanded = "1"; // Set expanded if ( EObj.wslrec != "" ) { EObj.style.display = ""; } else if ( RpmCC_AL.NTServicesLinkListLookup("",WinServicesArr[cx]) ) { // Lookup Computers for this Service top.Rstatus.Pstat("Unable to start the WinServicesWatch Server lookup request",true); goResetWait(); } else { ALupMode = "WinComputersLookup"; return; // exit and await Services Lookup } } } var WCDs = null; var WCMax = 0; // Max count of Computers var WinComputersIDArr = new Array(); var WCCount = 0; function processWinComputersLookupRecord(WSLrec) { var WinComputersSortArr = new Array(); var WCSACount = 0; var warr = new Array(); WinComputersIDArr.length = 0; // reset WinComputersIDArr = WSLrec.split("~"); // parse the string to get the Link List Computer IDs WCCount = 0, WCDs = ""; // initialize WCMax = WinComputersIDArr.length-2; // set number of computers for ( var i=1; i<WCMax; i+=2 ) { for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { if ( WinComputersIDArr[i] == AC_CompStoreArr[j] ) { // if found WinComputersSortArr[WCSACount++] = AC_CompStoreArr[j+2].toLowerCase()+"~"+i+"~"+j; } } } WinComputersSortArr.sort(); for ( var k=0; k<WCSACount; k++ ) { warr = WinComputersSortArr[k].split("~"); bLast = ((k+1) >= WCSACount) ? true : false; processWSCExp(parseInt(warr[1],10),parseInt(warr[2],10),bLast); // pass indices to Computer ID Arr & Computer Store } var EObj = document.all["wsrx"+curWinSrvsIx]; EObj.insertAdjacentHTML("beforeEnd",WCDs); EObj.style.display = ""; EObj.wslrec = WSLrec; // save EObj.compcount = WCCount; // save count of computers displayed EObj.checkedcomps = 1; ALupMode = ""; // reset } function processWSCExp(WCix,CSix,bLast) { var warr = new Array(); var Mpfx = (bLast) ? "L" : "T"; var Opfx = (curWinSrvsIx == LWCSDispIx) ? "White" : "I"; var CName = AC_CompStoreArr[CSix+2]; var Cid = AC_CompStoreArr[CSix]; var SLid = WinComputersIDArr[WCix+1]; var tAGid = findAGIDFromSLID(SLid); var EObj = document.all["wsrx"+curWinSrvsIx]; var inuse=""; var sDef = (tAGid == curAGRPID || tAGid == "0" ) ? true : false; // if AGID for this Service not found or is same as current AGID WCDs += "<table border='0' cellpadding='0' cellSpacing='0' width='490' >"; WCDs += "<tr><td width='25'> </td>"; WCDs += "<td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>" WCDs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>"; WCDs += "<td width='11' align='center'><img id='csma" + curWinSrvsIx + "_" + WCCount; WCDs += "' csix='"+CSix+"' cid='"+Cid+"' slid='" + SLid + "' src='images/"; if ( sDef ) { if ( EObj.checkedcomps != 1 && tAGid == curAGRPID ) { WCDs += "Checked.gif' checked='1'"; inuse = "b"; EObj.compchkcount++; } else { WCDs += "Unchecked.gif' checked='0'"; } WCDs += " width='9' height='9' onclick='procWCImgClick(this)' style='cursor:hand'"; } else { inuse = " title='Assigned to Watch: "+getOnlyAlertName(tAGid)+"'"; WCDs += "WinServicesInUse.gif' checked='0' width='18' height='18'"+inuse; } WCDs += "></td>"; WCDs += "<td width='*' id='csmb" + curWinSrvsIx + "_" + WCCount; if ( sDef ) { WCDs += "' style='cursor:hand' onclick='procWCImgClick(this)' class='optext"+inuse+"'> "; } else { WCDs += "' class='optext'"+inuse+"> "; } WCDs += CName + "</td>"; WCDs += "</tr></table>"; ++WCCount; // bump index } function procWCImgClick(WCIm) { var isx = WCIm.id; if ( isx.charAt(0) != "c" ) return; var cx = isx.substring(4,isx.length); // Strip off index lx = cx.lastIndexOf("_"); // derive suffix to the Computer DIV ID var dx = cx.substring(0,lx); var CObj = document.all["csma"+cx]; // Clicked Checkbox Entry var EObj = document.all["csmb"+cx]; var FObj = document.all["wsrx"+dx]; // Computers DIV entry var SNObj = document.all["wsrc"+dx]; // Service Name entry if ( CObj.checked == "1" ) { // if currently Checked, Uncheck CObj.src = "images/Unchecked.gif"; CObj.checked = "0"; // Set Unchecked EObj.className = "optext"; if ( --FObj.compchkcount == 0 ) { SNObj.className = "optext"; } } else { // otherwise Check CObj.src = "images/Checked.gif"; CObj.checked = "1"; // Set Checked EObj.className = "optextb"; SNObj.className = "optextb"; FObj.compchkcount++; } } // Windows services Add var WSM_ArIndex = 0; function processWSMonitorAdd(WSAddStat) { var wstat = new Array(); wstat = WSAddStat.split(":"); if ( wstat[0] == "Err" ) { top.Rstatus.Pstat("Error adding WinServicesWatch record: "+wstat[1],true); processResetButton(); return; } while ( WSM_ArIndex < WSM_Ar.length ) { // Get parameters var pStrg = (( AL_Suspend.checked ) ? "0" : "1")+"~"; pStrg += WSM_Ar[WSM_ArIndex++] + "~"; // NT Services Link ID pStrg += curAGRPID + "~";// Alert Group ID pStrg += (AL_WSRestart.checked) ? "0" : "1"; // notify only // if unable to initiate request if ( RpmCC_AL.NTServicesMonitorAdd(pStrg) ) { top.Rstatus.Pstat("Unable to start the UPDATE request",true); processResetButton(); } else { // waiting for OperationCompleteEvent top.Rstatus.Pstat("One moment while UPDATE request completes"); } return; } // Done with Adds var cStrg = CMN_Ar.join("~"); if ( RpmCC_AL.NTServicesMonitorNotify(cStrg) ) { top.Rstatus.Pstat("Request to update Agents failed",true); } WinServciesMonitorLookupRequired = true; // force reread of Monitor records ALupMode = ""; if ( ALMode == "New" ) { ALMode = ""; // reset mode processGeneralClick(CounterTab); processAlLookupReset(); } else if ( ALMode == "Edit" ) { ALMode = ""; // reset mode finishEditComplete(); } } // Edit Win Services Monitoring Records for AGID function processWSMonitorEdit() { WSrvcsIndex = 0; // Reset Monitor Records Array Index CurWSOp = "Edit"; // Go delete all old records, then add current settings processWServicesDeleteContinue(""); } // Delete Win Services Monitoring Records for AGID var WSAGdel = null; var CurWSCArr = ""; var CurWSOp = ""; function processWinServicesDelete(AlrtID) { WSAGdel = AlrtID; // save AGid to delete WSrvcsIndex = 0; // Reset Monitor Records Array Index CurWSOp = "Delete"; processWServicesDeleteContinue(""); } // Get Computer and Service for each NT services Link record function processWServicesDeleteContinue(WSDelStat) { var warr = new Array(); var wstat = new Array(); wstat = WSDelStat.split(":"); if ( wstat[0] == "Err" ) { top.Rstatus.Pstat("Error deleting WinServicesWatch record: "+wstat[1],true); ALupMode = ""; PINP_Bsy = false; return; } while ( WSrvcsIndex < WSrvcsMonitorRecs.length-1 ) { if ( RpmCC_AL.NTServicesMonitorRemove( WSrvcsMonitorRecs[WSrvcsIndex] ) ) { // if unable to initiate request ALupMode = ""; PINP_Bsy = false; top.Rstatus.Pstat("Unable to start the WinServicesWatch DELETE request",true); } else { WSrvcsIndex += WSrvcsMonitorRecLength; ALupMode = "WinSrvcsDelete"; // Mode top.Rstatus.Pstat("One moment while WinServicesWatch DELETE request completes"); } return; } // If Edit, now go do the Adds for current selections if ( CurWSOp == "Edit" ) { // Merege computers in CurWSCArr prior to edit with CMN_Ar after Edit warr = CurWSCArr.split("~"); for ( var i=0, aix=CMN_Ar.length; i<warr.length; i++ ) { // check each computer from CurWSCArr against CMN_Ar for ( var j=0; j < CMN_Ar.length; j++ ) { if ( warr[i] == CMN_Ar[j] ) { break; } } // Add any from CurWSCArr not in CMN_Ar if ( j >= CMN_Ar.length ) { CMN_Ar[aix++] = warr[i]; } } processWSMonitorAdd(""); return; } // otherwise Delete, finsih up if ( RpmCC_AL.NTServicesMonitorNotify(CurWSCArr) ) { top.Rstatus.Pstat("Request to update Agents failed",true); } WinServciesMonitorLookupRequired = true; // force reread of Monitor records // Done deleting records, now delete AG if ( RpmCC_AL.AlertGroupDelete(WSAGdel) ) { top.Rstatus.Pstat("Unable to start the DELETE request",true); processResetButton(); } else { // waiting for OperationCompleteEvent ignoreDBChangeEvent = true; top.Rstatus.Pstat("One moment while DELETE request completes"); } } // Process Win Services Edit // Expand all Groups that have Computers with selected services var WSTEditGIxAr = new Array(); var WSTEditGIxArReclength = 5; function processWSTEdit() { AL_CCOneWinServ.style.visibility = "hidden"; var cgid = "", GObj = null; var warr = new Array(); WSTEditGIxAr.length = 0; warr = CurWSCArr.split("~"); for ( var i=0, GpArIx=0; i < warr.length; ++i ) { // For each computer with services for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { if ( warr[i] == AC_CompStoreArr[j] ) { // if found cgid = AC_CompStoreArr[j+1]; // Group ID // Now find Group in the Tree and Open it for ( var k=0, l=0; k<AC_GroupStoreArr.length; k+=GroupRecLength, ++l ) { if ( cgid == AC_GroupStoreArr[k+1] ) { WSTEditGIxAr[GpArIx++] = j; // save this Computer's Index into CompStore WSTEditGIxAr[GpArIx++] = l; // save it's associated Group index in Tree GObj = document.all["lima"+l]; WSTEditGIxAr[GpArIx++] = ""; // reserve for Computer expand WSTEditGIxAr[GpArIx++] = ""; // reserve for Computer expand WSTEditGIxAr[GpArIx++] = warr[i]; // Computer ID if ( GObj.expanded == "0" ) { // expand group if necessary procGrpImgClick(GObj,true); } break; } } break; } } var CObj = document.all["zimc"+l+"_"+AC_CompStoreArr[j+5]]; CObj.className = "optextb"; } ALupMode = ""; // reset PopUpMoment.style.display = "none"; AL_CCOneWinServ.style.visibility = "visible"; return; } // Get Services Monitor Records by AGID function processPopulateWSTComputers() { CommObj = RpmCC_AL; if ( RpmCC_AL.NTServicesMonitorLookupAGID(curAGRPID) ) { // if unable to initiate request ALupMode = ""; PINP_Bsy = false; top.Rstatus.Pstat("Unable to start the WinServicesWatch Server lookup request",true); } else { CountOfComps = CountOfCompsRcvd = 0; CompIdLupArr = ""; // Computer Id Array ALupMode = "WSTComputerLookupPopIn"; // Mode top.Rstatus.Pstat("One moment while WinServicesWatch Server lookup request completes"); } } function processWinServicesClupDone() { AL_Suspend.checked = (WSrvcsMonitorRecs[1] == "0") ? "checked" :""; AL_WSRestart.checked = (WSrvcsMonitorRecs[4] == "0") ? "checked" :""; warr = CompIdLupArr.split(","); // save Array of Computer IDs for this AGID CurWSCArr = warr.join("~"); // Compute count of computers plus services and the display computers AL_CCOneWinServ.style.overflow = ( (CountOfCompsRcvd + (WSrvcsMonitorRecs.length-1)/WSrvcsMonitorRecLength) > 9 ) ? "scroll" : ""; if ( AC_CompStoreArr.length > 0 ) { // Get computer info from local store if available for ( var i=0; i < warr.length; ++i ) { // For each computer with services for ( var j=0; j<AC_CompStoreArr.length; j+=CompRecLength ) { if ( warr[i] == AC_CompStoreArr[j] ) { // if found processPopulateInputComputer(AC_CompStoreArr[j+2],AC_CompStoreArr[j+3],AC_CompStoreArr[j]); break; } } } processPopulateInputComplete(); } else { // otherwise read from the DB processPopulateCounterInputComplete() } } var WSDs = null; var CurExpGrpCompIx = null; // Index to Current Expanded Group/Computer var CurWSIx = 0; // Index to current Window Service var WSMax = 0; // Max count of services function processWinSrvcsLookupRecord(WSLrec) { var WinSrvcsIDArr = new Array(); WinSrvcsIDArr = WSLrec.split("~"); // parse the string to get the Link List services IDs WSDs = ""; // initialize CurWSIx = 0; // initialize count of services displayed WSMax = WinSrvcsIDArr.length-2; // set number of services for ( var i=1; i<WSMax; i+=2 ) { WSAix = GetWinServicesArrEntryIndex( parseInt(WinSrvcsIDArr[i],10) ); SrvcType = parseInt(WinServicesArr[WSAix+3],10); // get Service type processWSD(WSAix,WinSrvcsIDArr[i+1],i+1,SrvcType); } var EObj = document.all["sexp"+CurExpGrpCompIx]; EObj.insertAdjacentHTML("beforeEnd",WSDs); EObj.style.display = ""; EObj.wslrec = WSLrec; // save EObj.srvcsdisp = CurWSIx; // save count of services displayed ALupMode = ""; // reset if ( ALMode == "Edit" && EObj.checkedsrvcs == 0 ) { var SLid, SObj; CObj = document.all["xima"+CurExpGrpCompIx]; var Cid = AC_CompStoreArr[CObj.compix]; for ( i=0; i<WSrvcsLinkIDRecs.length; i+=WSrvcsLinkIDRecsLength ) { if (Cid != WSrvcsLinkIDRecs[i+1]) continue; SLid = WSrvcsLinkIDRecs[i+2]; // Service Link ID for ( var k=0; k<EObj.srvcsdisp; k++ ) { // find selected service SObj = document.all["wima"+CurExpGrpCompIx+"_"+k]; if ( SObj.slid == SLid ) { if ( SObj.checked == "0" ) { procWSImgClick(SObj); } break; } } } EObj.checkedsrvcs = 1; } } function processWSD(WSAix,SLid,SCnt,SrvcType) { if ( SrvcType < 16 ) { // filter out and don't display Driver services for now return; } var warr = new Array(); warr = CurExpGrpCompIx.split("_"); var Mpfx = (SCnt == WSMax) ? "L" : "T"; var Opfx = (parseInt(warr[0],10)+1 >= GrpLupRecCount) ? "White" : "I"; var OpSfx = (document.all["lexp"+warr[0]].compcount-1 == parseInt(warr[1],10)) ? "White" : "I"; var tAGid = findAGIDFromSLID(SLid); var sDef = (tAGid == curAGRPID || tAGid == "0" ) ? true : false; // if AGID for this Service not found or is same as current AGID WSDs += "<table border='0' cellpadding='0' cellSpacing='0' width='490' >"; WSDs += "<tr><td width='25'> </td><td width='19' height='20' align='center'><img src='images/" + Opfx + ".gif' width='19' height='20'></td>"; WSDs += "<td width='19' align='center'><img src='images/" + OpSfx + ".gif' width='19' height='20'></td>"; WSDs += "<td width='19' height='20' align='center'><img src='images/" + Mpfx + ".gif' width='19' height='20'></td>"; WSDs += "<td width='11' align='center'><img id='wima" + CurExpGrpCompIx + "_" + CurWSIx; WSDs += "' checked='0' slid='" + SLid + "' src='images/"; if ( sDef ) { WSDs += "Unchecked.gif' width='9' height='9' onclick='procWSImgClick(this)' style='cursor:hand'"; } else { var inuse = " title='Assigned to Watch: "+getOnlyAlertName(tAGid)+"'"; WSDs += "WinServicesInUse.gif' width='18' height='18'"+inuse; } WSDs += " checked='0'></td>"; WSDs += "<td width='*' id='wimb" + CurExpGrpCompIx + "_" + CurWSIx; if ( sDef ) { WSDs += "' style='cursor:hand' onclick='procWSImgClick(this)' class='optext'> "; } else { WSDs += "' class='optext'"+inuse+"> "; } WSDs += WinServicesArr[WSAix+2] + " ("+WinServicesArr[WSAix+1]+")</td>"; WSDs += "</tr></table>"; ++CurWSIx; // bump index } function procWSImgClick(WSIm) { var isx = WSIm.id; if ( isx.charAt(0) != "w" ) return; var cx = isx.substring(4,isx.length); // Strip off index lx = cx.lastIndexOf("_"); // derive suffix to the Services DIV ID var dx = cx.substring(0,lx); var CObj = document.all["wima"+cx]; // Clicked Checkbox Entry var EObj = document.all["wimb"+cx]; var CNObj = document.all["zimc"+dx]; // computer name var FObj = document.all["sexp"+dx]; // Services DIV entry if ( CObj.checked == "1" ) { // if currently Checked, Uncheck CObj.src = "images/Unchecked.gif"; CObj.checked = "0"; // Set Unchecked EObj.className = "optext"; if ( --FObj.srvcssel == 0 ) { CNObj.className = "optext"; } } else { // otherwise Check CObj.src = "images/Checked.gif"; CObj.checked = "1"; // Set Checked EObj.className = "optextb"; CNObj.className = "optextb"; FObj.srvcssel++; } } // Get and save the list of Windows Services var WinServicesArr = new Array(); var WinServicesArrEntrySz = 5; var WinServicesSortedArr = new Array(); function processWinServicesLookup(WinSvcs) { var wrkarr = new Array(); WinServicesArr = WinSvcs.split("~"); // parse out the Win Services GetWinServicesMonitorRecords(); var WSAmax = WinServicesArr.length - WinServicesArrEntrySz; for ( var i=0, j=0, k=0; i<WSAmax; i+=WinServicesArrEntrySz, k++) { if ( parseInt(WinServicesArr[i+3],10) < 16 ) continue; // get Display Name and Service ID WinServicesSortedArr[j++] = WinServicesArr[i+2].toLowerCase()+"~"+k; } // Sort based on display name WinServicesSortedArr.sort(); // Now parse back out the service ID and store that in the sorted array table for ( var k=0; k < j; k++ ) { wrkarr = WinServicesSortedArr[k].split("~"); WinServicesSortedArr[k] = parseInt(wrkarr[1],10); } } function GetWinServicesMonitorRecords() { var rstat = RpmCC_AL.NTServicesMonitorLookupAGID("0"); // Get All if ( rstat ) { // if unable to initiate request top.Rstatus.Pstat("Unable to start the WinServicesWatch lookup request",true); processResetButton(); } else { // waiting for OperationCompleteEvent top.Rstatus.Pstat("One moment while WinServicesWatch lookup request completes"); WinServciesMonitorLookupRequired = false; } } // Get and save the list of Servcies Being Monitored var WinServicesMonitorArr = new Array(); var WinServicesMonitorArrEntrySz = 5; var WinServciesMonitorLookupRequired = false; function processWinMonitoredServicesLookup(WinMonSvcs) { var wstat = new Array(); wstat = WinMonSvcs.split(":"); if ( wstat[0] == "Err" ) { top.Rstatus.Pstat("No WinServicesWatch records: "+wstat[1],true); } else { WinServicesMonitorArr = WinMonSvcs.split("~"); // parse out the Win Services being Monitored } WinServicesLUPreqd = false; if ( ALupMode == "WinSrvsTreeSetup" ) { processWinServicesTreeContinue(); } else if ( ALMode == "WinServicesLookup" ) { // if initial lookup GoStartIPServiceLookup(); // Go get the IP services } } function findAGIDFromSLID(tslid) { var ragid = "0"; // default not found for ( var i=0; i<WinServicesMonitorArr.length; i+= WinServicesMonitorArrEntrySz) { if ( tslid == WinServicesMonitorArr[i+2] ) { ragid = WinServicesMonitorArr[i+3]; break; } } return ragid; } function processInclDrvr() { } var WSM_Ar = new Array(); // Array of selected services Link IDs var CMN_Ar = new Array(); // Array of computers IDs with at least one service selected function getCheckedSrvcsArray() { WSM_Ar.length = 0; // reset array CMN_Ar.length = 0; var CompCount = 0, SSel = 0, SCnt = 0, ArIx=0, CMIx = 0; var CObj = null, SObj = null; if ( document.WinSrvcRadio.AL_WinSrvcDisp[1].checked ) { // Find & create array of selected services Link ID var WSAmax = WinServicesArr.length - WinServicesArrEntrySz; for ( var i=0; i<WSAmax; i+=WinServicesArrEntrySz) { if ( parseInt(WinServicesArr[i+3],10) < 16 ) continue; SObj = document.all["wsrx"+i]; // Service Object EObj = document.all["wsrc"+i]; if ( ALMode == "Edit" && SObj.checkedcomps != 1 ) { if ( EObj.somechecked != 1 ) continue; for ( var k=0; k < WSrvcsCompLinkIDRecs.length; k+=WSrvcsCompLinkIDRecsLength ) { if ( EObj.slid == WSrvcsCompLinkIDRecs[k] ) { // Match on Servcies List ID WSM_Ar[ArIx++] = WSrvcsCompLinkIDRecs[k+2]; // Service Link ID CMN_Ar[CMIx++] = WSrvcsCompLinkIDRecs[k+1]; // Computer ID } } } else { CompCount = SObj.compcount; // Count of computers in this Service if ( (SSel = SObj.compchkcount) == 0 ) // Count of computers selected continue; // if none for ( var j=0, k=0; j<CompCount && k<SSel; j++ ) { // For each Computer CObj = document.all["csma"+i+"_"+j]; if ( CObj.checked == "1" ) { // if selected CMN_Ar[CMIx++] = CObj.cid; WSM_Ar[ArIx++] = CObj.slid; ++k; // bump selected services } } // end check each Computer } } // end check each Service } else { // Find & create array of selected services Link ID for ( var i=0; i<GrpLupRecCount; ++i ) { // For Each Group CompCount = document.all["lexp"+i].compcount; // Count of computers in this Group for ( var j=0; j<CompCount; j++ ) { // For each Computer CObj = document.all["sexp"+i+"_"+j]; if ( ALMode == "Edit" && CObj.checkedsrvcs != 1 ) { var Cix = parseInt(document.all["xima"+i+"_"+j].compix,10); var Cid = AC_CompStoreArr[Cix]; var fAtLeastOne = false; for ( var k=0; k<WSrvcsLinkIDRecs.length; k+=WSrvcsLinkIDRecsLength ) { if (Cid != WSrvcsLinkIDRecs[k+1]) continue; WSM_Ar[ArIx++] = WSrvcsLinkIDRecs[k+2]; // Service Link ID fAtLeastOne = true; } if ( fAtLeastOne ) { CMN_Ar[CMIx++] = AC_CompStoreArr[Cix]; } } else { SSel = CObj.srvcssel; // count of selected services this computer if ( SSel > 0 ) { // if at least one CMN_Ar[CMIx++] = AC_CompStoreArr[ parseInt(document.all["xima"+i+"_"+j].compix,10) ]; } SCnt = CObj.srvcsdisp; // total count of services displayed this computer for ( var k=0, l=0; k<SCnt && l<SSel; k++ ) { // For each Service SObj = document.all["wima"+i+"_"+j+"_"+k]; if ( SObj.checked == "1" ) { WSM_Ar[ArIx++] = SObj.slid; // add to array if checked ++l; } } // end check each Service } } // end check each Computer } // end check each Group } return ((ArIx==0) ? false : true); } function GetWinServicesArrEntryIndex(cSLid) { var WSAmax = WinServicesArr.length - WinServicesArrEntrySz; for ( var i=0; i<WSAmax; i+=WinServicesArrEntrySz) { if ( parseInt(WinServicesArr[i],10) == cSLid ) { return i; } } return -1 }