354 lines
12 KiB
HTML
Executable File
354 lines
12 KiB
HTML
Executable File
<HTML>
|
|
<HEAD>
|
|
<TITLE>SGI Embedded Support Partner - ver.1.0</TITLE>
|
|
<SCRIPT LANGUAGE="JavaScript">
|
|
<!--
|
|
function showMap()
|
|
{ var map=window.open('/help_repavailability.html', 'help',
|
|
'width=650,height=350,status=yes,scrollbars=yes,resizable=yes');
|
|
map.main=self;
|
|
map.main.name="sss_main";
|
|
map.focus();
|
|
}
|
|
|
|
function Is ()
|
|
{ // convert all characters to lowercase to simplify testing
|
|
var agt=navigator.userAgent.toLowerCase()
|
|
// *** BROWSER VERSION ***
|
|
this.major = parseInt(navigator.appVersion)
|
|
this.minor = parseFloat(navigator.appVersion)
|
|
|
|
this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
|
|
|
|
this.nav2 = (this.nav && (this.major == 2))
|
|
this.nav3 = (this.nav && (this.major == 3))
|
|
this.nav4 = (this.nav && (this.major == 4))
|
|
this.nav4up = this.nav && (this.major >= 4)
|
|
this.navonly = (this.nav && (agt.indexOf(";nav") != -1))
|
|
|
|
this.ie = (agt.indexOf("msie") != -1)
|
|
this.ie3 = (this.ie && (this.major == 2))
|
|
this.ie4 = (this.ie && (this.major == 4))
|
|
this.ie4up = this.ie && (this.major >= 4)
|
|
|
|
this.opera = (agt.indexOf("opera") != -1)
|
|
}
|
|
|
|
var is;
|
|
var isIE3Mac = false;
|
|
if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.appVersion.indexOf("MSIE"!=-1)) && (parseInt(navigator.appVersion) == 3))
|
|
isIE3Mac = true;
|
|
else
|
|
is = new Is();
|
|
if (!isIE3Mac && (is.nav3 || is.nav4up || is.ie4up))
|
|
{ if (!Date.prototype.getFullYear)
|
|
{ Date.prototype.getFullYear = new Function ("var y = this.getYear();" + "return y < 100 ? y + 1900 : y;");
|
|
Date.prototype.setFullYear = Date.prototype.setYear;
|
|
}
|
|
}
|
|
|
|
function getFullYear(dateObject)
|
|
{ var y = dateObject.getYear();
|
|
if (y < 1000) y += 1900;
|
|
return y;
|
|
}
|
|
|
|
function get_sysdate()
|
|
{ var thisdate = new Date();
|
|
var sysmon = thisdate.getMonth() + 1;
|
|
sysmon = "" + sysmon;
|
|
var sysday = "" + thisdate.getDate();
|
|
var sysyear = getFullYear(thisdate);
|
|
return format_date(sysmon, sysday, sysyear);
|
|
}
|
|
|
|
function isDate1gtDate2(in_startdate, in_enddate)
|
|
{ var datearr = new Array;
|
|
datearr = in_startdate.split('/');
|
|
var start_mthval = datearr[0];
|
|
if (start_mthval < 10 && start_mthval.length == 2)
|
|
start_mthval = start_mthval.substring(1);
|
|
start_mthval = start_mthval - 1;
|
|
var start_dayval = datearr[1];
|
|
if (start_dayval < 10 && start_dayval.length == 2)
|
|
start_dayval = start_dayval.substring(1);
|
|
var start_yearval = datearr[2];
|
|
var startdate = new Date(start_yearval, start_mthval, start_dayval);
|
|
datearr = in_enddate.split('/');
|
|
var end_mthval = datearr[0];
|
|
if (end_mthval < 10 && end_mthval.length == 2)
|
|
end_mthval = end_mthval.substring(1);
|
|
end_mthval = end_mthval - 1;
|
|
var startdate = new Date(start_yearval, start_mthval, start_dayval);
|
|
datearr = in_enddate.split('/');
|
|
var end_mthval = datearr[0];
|
|
if (end_mthval < 10 && end_mthval.length == 2)
|
|
end_mthval = end_mthval.substring(1);
|
|
end_mthval = end_mthval - 1;
|
|
var end_dayval = datearr[1];
|
|
if (end_dayval < 10 && end_dayval.length == 2)
|
|
end_dayval = end_dayval.substring(1);
|
|
var end_yearval = datearr[2];
|
|
var enddate = new Date(end_yearval, end_mthval, end_dayval);
|
|
var datediff = enddate - startdate;
|
|
if (datediff < 0)
|
|
{ alert("Start date is greater than end date.");
|
|
return true;
|
|
}
|
|
else return false;
|
|
}
|
|
|
|
function isValidNum(in_val)
|
|
{ var i;
|
|
for (i=0; i < in_val.length; i++)
|
|
{ if (isNaN(parseInt(in_val.substring(i,i+1)))) return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
function format_date(inmth, inday, inyear)
|
|
{ var outmth;
|
|
var outday;
|
|
outmth = ((inmth.length == 1) ? "0" : "") + inmth;
|
|
outday = ((inday.length == 1) ? "0" : "") + inday;
|
|
return (outmth + "/" + outday + "/" + inyear);
|
|
}
|
|
|
|
function format_time(inhour, inmin, insec)
|
|
{ var outhour;
|
|
var outmin;
|
|
var outsec;
|
|
var ansr;
|
|
outhour = ((inhour.length == 1) ? "0" : "") + inhour;
|
|
outmin = ((inmin.length == 1) ? "0" : "") + inmin;
|
|
outsec = ((insec.length == 1) ? "0" : "") + insec;
|
|
return (outhour + ":" + outmin + ":" + outsec);
|
|
}
|
|
|
|
function validate_date(indate, date_type) {
|
|
var slashchk = indate.indexOf('/');
|
|
if (slashchk != -1) {
|
|
var slashchk1 = indate.indexOf('/', slashchk + 1);
|
|
if (slashchk1 != -1) {
|
|
var slashchk2 = indate.indexOf('/', slashchk1 + 1);
|
|
if (slashchk2 != -1) {
|
|
alert("Invalid "+ date_type + " format- too many . Please use: mm/dd/yyyy. Example: 01/03/1999");
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (slashchk == -1 || slashchk1 == -1) {
|
|
alert("Invalid "+ date_type + " format- please use: mm/dd/yyyy. Example: 01/03/1999");
|
|
return 0;
|
|
}
|
|
datearr = indate.split('/');
|
|
var mthval = datearr[0];
|
|
var dayval = datearr[1];
|
|
var yearval = datearr[2];
|
|
if (!isValidNum(mthval) || mthval.length > 2 || mthval < 1 || mthval > 12) {
|
|
alert("Invalid month specified for " + date_type + ".");
|
|
return 0;
|
|
}
|
|
|
|
// Verify that day entered for month is valid
|
|
if (!isValidNum(dayval) || dayval.length > 2 || dayval < 1) {
|
|
alert("Invalid day specified for "+ date_type + ".");
|
|
return 0;
|
|
}
|
|
|
|
if (!checkMonthLength(mthval, dayval, date_type)) {
|
|
return 0;
|
|
}
|
|
|
|
if (mthval == 2) {
|
|
if (!checkLeapMonth(mthval,dayval,yearval, date_type)) {
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
if (!isValidNum(yearval)) {
|
|
alert("Invalid year specified for "+ date_type + ".");
|
|
return 0;
|
|
}
|
|
if (yearval.length != 4) {
|
|
alert("Year must be 4 digits.");
|
|
return 0;
|
|
}
|
|
if (yearval.substring(0,2) != "19" && yearval.substring(0,2) != "20") {
|
|
ansr = confirm("Suspicious "+ date_type + " year entered. Is this year correct?");
|
|
if (! ansr) {
|
|
return 0;
|
|
}
|
|
}
|
|
return format_date(mthval, dayval, yearval);
|
|
}
|
|
|
|
function checkMonthLength(mm,dd,date_type) {
|
|
var months = new Array("","January","February","March","April","May","June","July","August","September","October","November","December");
|
|
|
|
if (mm.length == 2) {
|
|
mm = mm.substring(1,2);
|
|
}
|
|
|
|
if ((mm == 4 || mm == 6 || mm == 9 || mm == 11) && dd > 30) {
|
|
alert(date_type + ": "+months[mm] + " has only 30 days.");
|
|
return false;
|
|
}
|
|
else if (dd > 31) {
|
|
alert(date_type + ": "+months[mm] + " has only 31 days.");
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
function checkLeapMonth(mm,dd,yyyy,date_type) {
|
|
|
|
if (yyyy % 4 > 0 && dd > 28) {
|
|
alert(date_type + ": February of " + yyyy + " has only 28 days.");
|
|
return false;
|
|
}
|
|
else if (dd > 29) {
|
|
alert (date_type + ": February of " + yyyy + " has only 29 days.");
|
|
return false;
|
|
}
|
|
return true;
|
|
|
|
}
|
|
|
|
function process_allcheck() {
|
|
|
|
if (document.SystemAvail.sys_id[0].checked) {
|
|
for(i = 1; i < document.SystemAvail.sys_id.length; i++) {
|
|
document.SystemAvail.sys_id[i].checked = 0;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function process_submit() {
|
|
var ansr;
|
|
var choice;
|
|
var datechk;
|
|
var dflt_enddate = 0;
|
|
var dflt_startdate = 0;
|
|
var valid_startdate;
|
|
var valid_enddate;
|
|
var sysyear;
|
|
var thisdate = new Date();
|
|
var start_date = document.SystemAvail.av_start_time.value;
|
|
var end_date = document.SystemAvail.av_end_time.value;
|
|
var sysdate = get_sysdate();
|
|
|
|
if (start_date == "")
|
|
{ alert("A start date and an end date must be entered.");
|
|
return false;
|
|
}
|
|
if(end_date == "")
|
|
{ document.SystemAvail.av_end_time.value = sysdate;
|
|
return false;
|
|
}
|
|
|
|
// validate the start date
|
|
valid_startdate = validate_date(document.SystemAvail.av_start_time.value, "start date");
|
|
if (valid_startdate == "0") {
|
|
document.SystemAvail.av_start_time.focus();
|
|
return false;
|
|
}
|
|
|
|
// validate the end date
|
|
valid_enddate = validate_date(document.SystemAvail.av_end_time.value, "end date");
|
|
if (valid_enddate == "0") {
|
|
document.SystemAvail.av_end_time.focus();
|
|
return false;
|
|
}
|
|
|
|
// make sure that start_date is smaller than end date
|
|
if (valid_startdate != "" && valid_enddate != "") {
|
|
if (isDate1gtDate2(valid_startdate, valid_enddate)) {
|
|
document.SystemAvail.av_start_time.focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// assign validated/formatted dates
|
|
document.SystemAvail.av_start_time.value = valid_startdate;
|
|
document.SystemAvail.av_end_time.value = valid_enddate;
|
|
|
|
choice= -1;
|
|
for (i = 0; i < document.SystemAvail.sys_id.length; i++) {
|
|
if (document.SystemAvail.sys_id[i].checked) {
|
|
choice = i;
|
|
}
|
|
}
|
|
if(choice == -1) {
|
|
alert("Please choose a system or set of systems for which you would like to see system event information.");
|
|
return false;
|
|
}
|
|
|
|
choice=-1;
|
|
for (i = 0; i < document.SystemAvail.avail_sel.length;i++) {
|
|
if (document.SystemAvail.avail_sel[i].checked) {
|
|
choice = i;
|
|
}
|
|
}
|
|
if (choice == -1)
|
|
{ alert("Please choose type of system event information to view.");
|
|
return false;
|
|
}
|
|
document.SystemAvail.av_start_time.value = valid_startdate;
|
|
document.SystemAvail.av_end_time.value = valid_enddate;
|
|
return true;
|
|
}
|
|
|
|
function dflt_vals()
|
|
{ var sysdate = get_sysdate();
|
|
document.SystemAvail.av_end_time.value = sysdate;
|
|
}
|
|
//-->
|
|
</SCRIPT>
|
|
</HEAD>
|
|
<BODY bgcolor="#ffffcc" link="#333300" vlink="#333300" onLoad="dflt_vals();">
|
|
<form method=POST name="SystemAvail" action="/$sss/rg/amrserver" onSubmit="return process_submit();">
|
|
<table border=0 cellpadding=0 cellspacing=0 width=100%>
|
|
<tr><td bgcolor="#cccc99" width="15"> </td>
|
|
<td bgcolor="#cccc99"><font face="Arial,Helvetica">SYSTEM INFORMATION > Availability</font></td></tr>
|
|
<tr><td colspan=2> </td></tr>
|
|
<tr><td align="right" colspan=2><font face="Arial,Helvetica"><input TYPE="button" onClick="showMap()" Value=" Help "></font></td></tr>
|
|
<tr><td colspan=2> </td></tr>
|
|
<tr><td></td>
|
|
<td><a href="/$sss/rg/amrserver~0~1">0</a><p><hr><p>
|
|
<font face="Arial,Helvetica">Enter the time period for which you want availability information:<p>
|
|
<table border=0 cellpadding=0 cellspacing=0>
|
|
<tr><td><font face="Arial,Helvetica">From: </font></td>
|
|
<td><font face="Arial,Helvetica"><input type="text" name="av_start_time" size=10></font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">To: </font></td>
|
|
<td><font face="Arial,Helvetica"><input type="text" name="av_end_time" size=10></font></td></tr>
|
|
<tr><td> </td>
|
|
<td align=center><font face="Arial,Helvetica">(mm/dd/yyyy)</font></td>
|
|
<td> </td><td> </td>
|
|
<td align=center><font face="Arial,Helvetica">(mm/dd/yyyy)</font></td></tr>
|
|
</table><p>
|
|
Display availability information for the following systems:<p>
|
|
<a href="/$sss/rg/libsgmserver~SGM_GENERATE_SYSTEMS?multiselect=1">SGM_GENERATE_SYSTEMS</a>
|
|
<p> <br>Choose one of the following options:<p>
|
|
<table border=0 cellpadding=0 cellspacing=0 width="100%">
|
|
<tr valign="top"><td><input type="radio" name="avail_sel" value="2" checked></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">Site Level Overall Availability Summary</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">Displays all statistical availability information for the selected system or group of systems. This report provides information regarding MTBI, Average Uptime, etc.</font></td></tr>
|
|
<tr><td colspan=3> </td></tr>
|
|
<tr valign="top"><td><input type="radio" name="avail_sel" value="3"></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">Availability Summary List for Individual Hosts</font></td>
|
|
<td> </td>
|
|
<td><font face="Arial,Helvetica">Displays detailed information of all availability events for the selected system or group of systems. Selection of each event is also allowed if more detail is required.</font></td></tr>
|
|
</table><p>
|
|
<INPUT TYPE="SUBMIT" VALUE=" Accept "></font>
|
|
</td></tr></table>
|
|
</form></BODY></HTML>
|