Home About BC DR HA Support Training Download
You are here: Home/ GlobalSysAdmin/ Power5/ Please Login or Register

-
Current Location
-

js
  GlobalSysAdmin
    Power5
-
AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com


Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com

-
digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com


#!/usr/bin/ksh93
################################################################
function dst_header {
  FD="${1:?# ERROR: file descriptor number not specified}"
  DC="${2:?# ERROR: data center identifier not specified}"
  print -u ${FD} -- "<!-- Begin \"dst${DC}vioUpdates.content.shtml\" -->"
  print -u ${FD} -- "\n<P><H2>Daylight Savings Time (DST) System Compliance</H2></P>"
  print -u ${FD} -- "\n<P><H3>VIO Servers</H3></P>"
  print -u ${FD} -- "\n<P><TABLE Border=\"1\">"
  print -u ${FD} -- "<P><TR>"
  print -u ${FD} -- "<TH Bgcolor=\"lightgrey\"><A Href=\"dst${DC}byhostname.shtml\">Host Name</A></TH>"
  print -u ${FD} -- "<TH Bgcolor=\"lightgrey\"><A Href=\"dst${DC}byoslevel.shtml\">OS Level</A></TH>"
  print -u ${FD} -- "<TH Bgcolor=\"lightgrey\"><A Href=\"dst${DC}byfileset.shtml\">Fileset</A></TH>"
  print -u ${FD} -- "<TH Bgcolor=\"lightgrey\"><A Href=\"dst${DC}bycomply.shtml\">Compliance</A></TH>"
  print -u ${FD} -- "<TH Bgcolor=\"lightgrey\">Description</TH>"
  print -u ${FD} -- "</TR></P>"
}
################################################################
function dst_footer {
  FD="${1:?# ERROR: file descriptor number not specified}"
  DC="${2:?# ERROR: data center identifier not specified}"
  DATESTAMP="$( date )"

  print -u ${FD} -- "</TABLE></P>"
  print -u ${FD} -- "<P><I>${DATESTAMP}</I></P>"
  print -u ${FD} -- "\n<!-- End \"dst${DC}vioUpdates.content.shtml\" -->"
}
################################################################

typeset -L3 DC="${1:?# ERROR: 3 character lowercase datacenter identifier must be specified (mx0|mx1)}"
if [[ "${DC}" != @(mx0|mx1) ]]
then
  print -u 2 -- "# ERROR: invalid datacenter identifier \"${DC}\": valid identifiers are mx0|mx1"
  exit 1
fi

exec 3>/tmp/dstscriptvio${$}.out
FD="3"

####  amms.list is copied from NIMserver:/root/amms.list to users home directory
cut -d"|" -f2 ./vioserver.list |
while read -- CNAME
do
    OS=$( ssh -x root@${CNAME} '/usr/ios/cli/ioscli ioslevel' )

    print -u 2 -- "# ${CNAME} ${OS}"

    COMPLY="Compliant"
    [[ "_${OS}" < "_1.3.0.1-FP-8.1" ]] && COMPLY="<STRONG><FONT Color=\"red\">Non-Compliant</FONT></STRONG>"

      print -u ${FD} -n -- "<P><TR>"
      print -u ${FD} -n -- "<TD>${CNAME}</TD><!-- | -->"
      print -u ${FD} -n -- "<TD>${OS}</TD><!-- | -->"
      print -u ${FD} -n -- "<TD>&nbsp;</TD><!-- | -->"
      print -u ${FD} -n -- "<TD>${COMPLY}</TD><!-- | -->"
      print -u ${FD} -n -- "<TD>&nbsp;</TD><!-- | -->"
      print -u ${FD} -- "</TR></P>"

done

exec 3>&-

#### create HTML content file sorted by hostname
exec 3>/tmp/dst${DC}viobyhostname.content.shtml
  dst_header 3 ${DC}
    sort -f -t '|' +0 +2 /tmp/dstscriptvio${$}.out >&3
  dst_footer 3 ${DC}
exec 3>&-

#### create HTML content file sorted by fileset name
exec 3>/tmp/dst${DC}viobyfileset.content.shtml
  dst_header 3 ${DC}
    sort -f -t '|' +2 +0 /tmp/dstscriptvio${$}.out >&3
  dst_footer 3 ${DC}
exec 3>&-

#### create HTML content file sorted by whether it is DST compliant
exec 3>/tmp/dst${DC}viobycomply.content.shtml
  dst_header 3 ${DC}
    sort -f -t '|' +3 +2 +0 /tmp/dstscriptvio${$}.out >&3
  dst_footer 3 ${DC}
exec 3>&-

#### create HTML content file sorted by oslevel
exec 3>/tmp/dst${DC}viobyoslevel.content.shtml
  dst_header 3 ${DC}
    sort -f -t '|' +1 +0 /tmp/dstscriptvio${$}.out >&3
  dst_footer 3 ${DC}
exec 3>&-

rm -f /tmp/cat${$}.out
rm -f /tmp/dstscriptvio${$}.out

-
DST VIO Server Script
-
 

DST Updates at MX0
DST Updates at MX1
DST Updates at MX0
DST Updates at MX1


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com