Académique Documents
Professionnel Documents
Culture Documents
/bin/ksh
#set -x
export LANG=C
#-----------------------------------------------------------------
#------ Script d Audit -----------------------------------------
#------ par Jean Fran�ois Pinguet --------------------------
#--------- fichier : aixview.sh --------------------------------
VersionE=" version 2013-1.5.1 date: 03/06/2014"
#-----------------------------------------------------------------
# Utilisation :
# -------------
# ./aixviewxxx.sh
#
# debug="set -x"
# >module010.log
# exec 2>>module010.log ; set -x
# ----------------------------------------------------------------
#
# module d analyse
# type HHH : hard
# SSS : soft
# EEE : Environnement
#-----------------------------------------------------------------
$debug
echo "please wait........"
export LANG=C
# ---- init des variables ---------------------
file=$(date +%Od%OH%OM)
typeset NbModule
typeset -i NumSign=0
typeset -i NumNum=0
typeset -i NbLigneSomm=0
typeset -i NbLigneSommH=0
typeset -i NbLigneSommS=0
typeset -i NbLigneSommA=0
typeset -i NbLigneSommF=0
NomScript=$0
CmdLancer=$0' '$*
Rept=$(pwd)
tpvar=$Rept"/AIXJFPAUD"$file"0101"
tpsort=$Rept"/AIXJFPVIEW"
> $tpsort"HARDLoc"
prtconf > $tpvar"jfp_prtconf" &
pid=$!
sleep 2
kill -0 $pid 1>$tpvar"0" 2>$tpvar"0"
if [ $? = '0' ]
then
sleep 30
kill -0 $pid 1>$tpvar"0" 2>$tpvar"0"
[ $? = '0' ] && (kill -9 $pid ; echo "--- kill prtconf after time out of
command ---" >> $Modu ; echo ' kill after time out command: prtconf' >>
$tpsort"KILL9" )
fi
information()
{
$debug
cat << top
Utilisation du script d audit :
Un fichier audit_NomMachine_Mod�le_S.N_.html sera g�n�r� dans le r�pertoire
de lancement du script aixaudit
-c : fichier compress�.
-s : valide l execution du snap -gc
-S : Specific Stephen Corporation !
-d : date dans le nom du fichier
-n : l argument suivant devra contenir le nom du client
entre double quote.
-m : l argument suivant devra contenir le nom du module a executer
-L : permet de choisir le level d execution du script. Les differents
levels sont :
0 : execution standard du script
1 : execution de tous les modules sauf les modules reper�
de level 1
2 : execution de tous les modules sauf les modules reper�
de level 2
12 :execution de tous les modules sauf les modules rep�r�
de level 1 et level 2
etc... maximum de 9 levels.
-x <nomFichier> : le fichier indique contient une liste de modules a
executer.
EXEMPLE :
exemple uniquement avec le nom du client :
$NomScript -n "ClientTon et fils"
audit="aixview"$NomLabel"_"$NomPart"_nbID-"$NumPart"_"$NomAudit$DateAudit$Extension
fi
cat $tpvar"presentation" > $audit
cat $tpvar"Resume" >> $audit
cat $tpvar"corpaudit" >> $audit
cat $tpvar"finaudit" >> $audit
cat $tpvar"sommaire" >> $audit
fi
return 0
}
ExecutionMod()
{
$debug
typeset -i a=0
typeset -i j=0
typeset temp
typeset TypeModule
temp=$tpvar"ExM"
TypeModule=$1
>$temp"jfp"
grep xxxx $NomScript > $tpvar"listemodule"
mv $tpvar"listemodule" $temp"jfp"
grep $TypeModule $temp"jfp" > $tpvar"listemodule"
for i in $(grep Mod $tpvar"listemodule" | awk '{print $2}')
do
((j+=1))
k="xxxx $i"
ListeModule[$j]=$i # nom du module
ListeModule[$j+3000]=$(grep "$k" $tpvar"listemodule" | awk '{print $3}') #
validation du module
if [ $(grep "$k" $tpvar"listemodule" | awk '{print $4}' | sed
's/['$LevelExec']/n/g' | grep n) ]
then
ListeModule[$j+3000]=non
fi
done
NbModule=$j
let j=0
while (( $j < $NbModule ))
do
((j+=1))
if [[ "${ListeModule[$j+3000]}" = "oui" ]]
then
${ListeModule[$j]} conf
echo "Executing : ${ListeModule[$j]} $j $NbModule --> $TitreMod"
echo "Executing : ${ListeModule[$j]} $j $NbModule --> $TitreMod" >>
$tpsort"ModExecAudit"
((NumSign+=1))
((NumNum+=1))
((NbLigneSomm+=1))
# ${ListeModule[$j]} $j $NbModule
${ListeModule[$j]} $j $NbModule 2>$temp"jfp"
fi
done
rm -f $tpvar$j$NomMod"jfp"*
return $a
}
SuppModulVide() # $TypeModule
{
$debug
typeset -i a=0
typeset TypeModule aa bb temp long position
TypeModule=$1
temp=$tpvar"SuppModulVide"
>$temp"jfp1"
# Somm=$tpsort"Som"$NomMod
# Modu=$tpsort"Mod"$NomMod
ls $tpsort"Mod"$TypeModule* | while read aa bb ; do
if [[ ! -s $aa ]]
then
long=$(ls $aa | wc -m)
let position=long-6
bb=$(echo $aa | cut -c $position- )
rm -f $aa 2>$temp"jfp1"
rm -f $tpsort"Som"$bb 2>$temp"jfp1"
rm -f $tpsort"Res"$bb 2>$temp"jfp1"
fi
done
return $a
}
Module() # type module HHH ou SSS ou EEE ou AAA
{
$debug
typeset -i a=0
typeset TypeModule
TypeModule=$1
ExecutionMod "$TypeModule"
SuppModulVide "$TypeModule"
return $a
}
# --- Presentation HTML audit
Presentation() # NomClient
{
$debug
typeset -i a=0
typeset NomClient
NomClient=$1
typeset UtilModule temp NomMod NumPart NomPart sn
presentation=$tpvar"presentation"
echo "presentation"
/usr/ios/cli/ioscli lsmap 2>$tpvar"jfp3"
if [ $? = 127 ]
then
partitype=" AIX system"
backcolor="f2f2f2"
else
partitype=" VIOS partition"
backcolor="e5e8a8"
fi
# --- debut de l affichage HTML
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' > $presentation
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >' >> $presentation
echo '<head>' >> $presentation
echo '<meta name="Lyon" content="RS6000"/>' >> $presentation
echo '<title>Audit :'$(hostname)' --- Welcome to JF Pinguet s audit --- Version :
'$VersionE' --</title>' >> $presentation
echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'
>> $presentation
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />' >>
$presentation
echo '<style type="text/css">' >> $presentation
echo 'html, body {overflow:hidden;margin:0px;padding:0px;font-
family:Arial,Verdana,Helvetica;width:800px;margin:auto;margin-
bottom:20px;color:black;}' >> $presentation
echo '#bloc-fixe
{position:fixed;overflow:auto;right:0px;left:0px;top:0px;height:69px;border:solid
2px;border-color:#c7d6e2;background-repeat: no-repeat;background: -moz-linear-
gradient(top, #303031, #274059);background: -webkit-gradient(linear, left top, left
bottom, from(#303031), to(#274059));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#303031',
endColorstr='#274059');font-family:Arial,Verdana,Helvetica;font-
size:240%;color:#a0a8ad;} ' >> $presentation
echo '#bloc-fixe-ver
{position:fixed;overflow:auto;right:0px;left:8px;top:37px;height:69px;font-
family:Arial,Verdana,Helvetica;font-size:60%;color:#a0a8ad;}' >> $presentation
echo '#bloc-fixe-infoversion
{position:fixed;left:200px;right:0px;top:14px;height:35px;}' >> $presentation
echo '#bloc-fixe-pub {position:fixed;left:3px;right:4px;top:102px;height:17px;font-
family:Arial,Verdana,Helvetica;font-size:60%;color:#000000;} ' >> $presentation
echo '#bloc-fixe-serveur
{position:fixed;left:250px;right:0px;top:21px;height:20px;font-
family:Arial,Verdana,Helvetica;font-size:80%;color:#87cefa;} ' >>
$presentation
echo '#bloc-fixe-partition
{position:fixed;left:10px;right:0px;top:49px;height:20px;font-
family:Arial,Verdana,Helvetica;font-size:80%;color:#87cefa;}' >> $presentation
echo '#bloc-fixe-date
{position:fixed;left:800px;right:0px;top:49px;height:20px;font-
family:Arial,Verdana,Helvetica;font-size:80%;color:#87cefa;} ' >> $presentation
echo '#bloc-fixe-customer
{position:fixed;left:250px;right:0px;top:4px;height:20px;font-
family:Arial,Verdana,Helvetica;font-size:80%;color:#87cefa;}' >> $presentation
echo '#bloc-fixe-user
{position:fixed;left:750px;right:0px;top:4px;height:20px;font-
family:Arial,Verdana,Helvetica;font-size:80%;color:#87cefa;} ' >> $presentation
echo '.model {font-family:Arial,Verdana,Helvetica;font-size:90%;color:#ffffff;} '
>> $presentation
echo '#bloc-fixe3trait
{position:fixed;right:0px;left:0px;top:72px;height:4px;background-repeat: no-
repeat;background: -moz-linear-gradient(top, #91a3b8, #c4d3e0);background: -webkit-
gradient(linear, left top, left bottom, from(#91a3b8), to(#c4d3e0));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#91a3b8',
endColorstr='#c4d3e0');} ' >> $presentation
echo '#bloc-fixe4trait
{position:fixed;right:0px;left:0px;top:96px;height:4px;background-repeat: no-
repeat;background: -moz-linear-gradient(top, #7b858d, #ffffff);background: -webkit-
gradient(linear, left top, left bottom, from(#7b858d), to(#ffffff));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#7b858d',
endColorstr='#ffffff');}' >> $presentation
echo '#bloc-fixe-menu {position:fixed;right:0px;left:0px;top:76px;height:20px; /*
valeur normal 20 */background-repeat: no-repeat;background: -moz-linear-
gradient(top, #c7d6e2, #98a0a7); /* pour Firefox 3.6+ */ background: -webkit-
gradient(linear, left top, left bottom, from(#c7d6e2), to(#98a0a7)); /* pour webkit
*/filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c7d6e2',
endColorstr='#98a0a7'); /* pour IE */font-size:90%;} ' >> $presentation
echo '#position-menu {width:900px;height: 0px;margin-bottom: 0px;position: fixed;}
' >> $presentation
echo '#bloc-menu {height:20px; /* valeur normal 20 */background-repeat: no-
repeat;background: -moz-linear-gradient(top, #e1e9ef, #b1b8bc); /* pour Firefox
3.6+ */ background: -webkit-gradient(linear, left top, left bottom, from(#e1e9ef),
to(#b1b8bc)); /* pour webkit */filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#e1e9ef,
endColorstr=#b1b8bc); /* pour IE */font-size:90%;} ' >> $presentation
echo '#position-menuf {margin-bottom: 0px;} ' >> $presentation
echo '#menuf {padding : 0;margin : 0;list-style : none;line-height : 18px;}' >>
$presentation
echo '#menuf li a {font-weight : bold;font-family : Arial,Verdana,Helvetica;font-
size : 80%;text-align : center;display : block;color : #2f4576;text-decoration :
none;width : 300px;}' >> $presentation
echo '#menuf ul li {list-style:none;}' >> $presentation
echo '#menuf ul li a {line-height:15px;text-align:left;width:235px;padding:0;text-
decoration:none;display:block;color:#2f4576;}' >> $presentation
echo '#menuf li {float:left;}' >> $presentation
echo '#menuf li ul li {border-top:1px solid #91a3b8;}' >> $presentation
echo '#menuf li ul {position:absolute;width:253px;left:-999em;max-
height:400px;background:#bdcedc;padding-left:10px;overflow:auto;}' >> $presentation
echo '#menuf a:hover {color:#000;background:#a5bbcd;}' >> $presentation
echo '#menuf li:hover ul, #menu li li:hover ul, #menu li.sfhover ul, #menu li
li.sfhover ul {left:auto;min-height:0;}' >> $presentation
echo '#menu {padding : 0;margin : 0;list-style : none;line-height : 18px;} ' >>
$presentation
echo '#menu li a {font-weight : bold;font-family : Arial,Verdana,Helvetica;font-
size : 80%;text-align : center;display : block;color : #2f4576;text-decoration :
none;width : 150px;} ' >> $presentation
echo '#menu ul li {list-style:none;} ' >> $presentation
echo '#menu ul li a {line-height:15px;text-align:left;width:235px;padding:0;text-
decoration:none;display:block;color:#2f4576;} ' >> $presentation
echo '#menu li {float:left;} ' >> $presentation
echo '#menu li ul li {border-top:1px solid #91a3b8;} ' >> $presentation
echo '#menu li ul {position:absolute;width:253px;left:-999em;max-
height:400px;background:#bdcedc;padding-left:10px;overflow:auto;} ' >>
$presentation
echo '#menu a:hover {color:#000;background:#a5bbcd;} ' >> $presentation
echo '#menu li:hover ul, #menu li li:hover ul, #menu li.sfhover ul, #menu li
li.sfhover ul {left:auto;min-height:0;} ' >> $presentation
echo '.menumod {font-weight : bold;font-family : Arial,Verdana,Helvetica;font-
size : 75%;color : #2f4576; background-color: #c7d6e2;text-decoration :
none;width : 150px;border-width : 1px;border-style : solid;}' >> $presentation
echo '.menumod:hover {font-weight : bold;font-family :
Arial,Verdana,Helvetica;font-size : 75%;color : #2f4576; background-color:
#98a0a7;text-decoration : none;width : 150px;border-width : 1px;border-style :
solid;}' >> $presentation
echo '.menumod1 {font-weight : bold;font-family : Arial,Verdana,Helvetica;font-size
: 75%;color : #2f4576; text-decoration : none;width : 150px;}' >> $presentation
echo '#contenu
{position:fixed;overflow:auto;right:0px;left:0px;bottom:0px;top:101px;background-
color:#ffffff;margin-left: 10px;font-size:90%;} ' >> $presentation
echo 'h1 {font-size:140%;text-align:center;background-repeat: no-repeat;background:
-moz-linear-gradient(top, #afb1b2, #dce9ee);background: -webkit-gradient(linear,
left top, left bottom, from(#afb1b2), to(#dce9ee));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#afb1b2,
endColorstr=#dce9ee);font-family:Arial,Verdana,Helvetica;font-
size:200%;color:#4d3e7f;}' >> $presentation
echo 'h2 {background-color:#'$backcolor';color:#333333;font-size:100%;} ' >>
$presentation
echo 'h2 strong {background-color:#ffffff;color:#2825b0;border:solid 1px;border-
color:#c7d6e2;font-family:courier new,monospaced,courier;font-size:100%;}' >>
$presentation
echo 'h2 pre {margin-left:70px;} ' >> $presentation
echo '.alert {background-color:#ff0000;color:#ffffff;} ' >> $presentation
echo '.alert0 {background-color:#283f56;color:#ffffff;} ' >> $presentation
echo '.alert1 {background-color:#f1eded;color:#000000;} ' >> $presentation
echo '.alert2 {background-color:#cacf8d;color:#000000;} ' >> $presentation
echo '.alert3 {background-color:#fd9503;color:#000000;} ' >> $presentation
echo '.alert4 {background-color:#cecfd0;color:#000000;} ' >> $presentation
echo '.alert5 {background-color:#ffff00;color:#000000;} ' >> $presentation
echo '.alert6 {background-color:#00ff00;color:#000000;} ' >> $presentation
echo 'h3 {font-family : Arial,Verdana,Helvetica;background-repeat: no-
repeat;background: -moz-linear-gradient(top, #ffffff, #c3d2df);background: -webkit-
gradient(linear, left top, left bottom, from(#ffffff), to(#c3d2df));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
endColorstr='#c3d2df');font-size:110%;color : #2f4576;} ' >> $presentation
echo 'h3 strong {margin-left:250px;} ' >> $presentation
echo 'p {width: 850px;margin: auto;white-space:pre-wrap;word-wrap: break-word;} '
>> $presentation
echo 'table {background:#FFFFFF} ' >> $presentation
echo 'table th {font-size: 100%;font-
family:Arial,Verdana,Helvetica;background:#dbd8d1;} ' >> $presentation
echo 'table td {font-size: 100%;padding-left:10px;} ' >> $presentation
echo 'PRE TABLE b {font-size: 100%;font-
family:Arial,Verdana,Helvetica;background:#FFFFBB;}' >> $presentation
echo 'PRE {font-size: 100%;font-family:courier new,monospaced,courier;} ' >>
$presentation
echo 'PRE b {font-size: 100%;font-
family:Arial,Verdana,Helvetica;background:#dbd8d1;} ' >> $presentation
echo 'PRE em {font-size: 100%;font-
family:Arial,Verdana,Helvetica;background:#f7ff41;font-style: normal;}' >>
$presentation
echo '#back a {font-family:Arial,Verdana,Helvetica;text-decoration:none;color:
#1e4191;border:solid 1px;border-color:#c7d6e2;font-weight:bold;} ' >> $presentation
echo '#back:hover a {color: #d6843e;background: #f2f2f2;} </STYLE> ' >>
$presentation
echo '<!--[if lt IE 7]> ' >> $presentation
echo ' <STYLE type=text/css> ' >> $presentation
echo ' html, body {height:100%;} ' >> $presentation
echo ' html {padding-top:85px} ' >> $presentation
echo ' #bloc-fixe, #contenu { ' >> $presentation
echo ' position:absolute; ' >> $presentation
echo ' width:100%; ' >> $presentation
echo ' }' >> $presentation
echo ' #contenu {' >> $presentation
echo ' position:absolute; ' >> $presentation
echo ' height:100%; ' >> $presentation
echo ' } ' >> $presentation
echo ' </STYLE>' >> $presentation
echo '<![endif]-->' >> $presentation
echo '</head>' >> $presentation
# --- debut du corp HTML
echo '<body>' >> $presentation
echo '<div id="bloc-fixe"><b>AIX VIEW</b></div>' >> $presentation
echo '<div id="bloc-fixe-ver"><b> '$VersionE' </b></div>' >> $presentation
NmSript=$(echo $0 | tr '/' '
' | grep aixview)
echo '<script type="text/javascript"
src="http://galetiere.fr/aufildeaix/telechargement/version.txt"></script>' >>
$presentation
echo '<SCRIPT language=javascript>if (version == "'$NmSript'")
{document.write("vous avez la bonne version");} ' >> $presentation
echo 'else {document.write('\''<div id="bloc-fixe-infoversion"><a
href="http://galetiere.fr/aufildeaix/telechargement/'\''+version+'\''"
title="download : '\''+version+'\''"><img
src="http://galetiere.fr/aufildeaix/Info/alerteversion.gif"
border="0"></a></div>'\'');}</SCRIPT>' >> $presentation
ModelMachine
a=$?
FormTypeSerie $a
echo '<div id="bloc-fixe-serveur"><b>Serveur name : </b><span class="model"><span
id="db-srvname">'$(hostname)'</span> ;</span><b>Type et S/N : </b><span
class="model" id="db-srvmodel">'$(cat $tpvar"ModelMachine")'</span>' >>
$presentation
#cat $tpvar"FormTypeSerie" | read sn
#cat $tpvar"FormTypeSerie" >> $presentation
echo '<span class="model" id="db-srvserial">'$(cat $tpvar"NumSerie")'</span></div>'
>> $presentation
uname -L | read NumPart NomPart
[ $NomPart != "NULL" ] && echo '<div id="bloc-fixe-partition"><b>Partition n�:
</b><span class="model" id="db-srvpartnum">'$NumPart';</span><b> Partition name :
</b><span class="model" id="db-srvpartname">'$NomPart';</span><b> Domaine name :
</b><span class="model">'$(domainname 2> /dev/null)';</span></div>' >>
$presentation
echo '<div id="bloc-fixe-date"><b>DATE: </b><span class="model" id="db-srvdate">'$
(date +%Od/%Om/%Oy,%OH:%OM)'</span></div>' >> $presentation
Loguser=$(who am i | awk '{print $1}')
echo '<div id="bloc-fixe-customer"><b>Customer : </b><span
class="model">'$NomClient' </span></div>' >> $presentation
echo '<div id="bloc-fixe-user"><b>User for executing audit : </b><span
class="model">'$Loguser' </span></div>' >> $presentation
echo '<div id="bloc-fixe3trait"></div>' >> $presentation
echo '<div id="bloc-fixe4trait"></div>' >> $presentation
echo '<script>function attente(){valpage='\''<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" ><head><meta name="Lyon"
content="RS6000">'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<title>Info AIXVIEW : viosp66_1 ---
Welcome to JF Pinguet s audit ---- version 11-H.2.27 --</title>'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" /><style type="text/css">'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''html, body {font-
family:Arial,Verdana,Helvetica;color:black;background:#c7d6e2;font-size:90%;}'\'''
>> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''#bloc-fixe
{position:fixed;right:0px;left:0px;top:0px;height:44px;border:solid 2px;border-
color:#c7d6e2;background-repeat: no-repeat;background: -moz-linear-gradient(top,
#303031, #274059);background: -webkit-gradient(linear, left top, left bottom,
from(#303031), to(#274059));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#303031,
endColorstr=#274059);font-family:Verdana,Arial,Helvetica;font-
size:240%;color:#a0a8ad;} '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''#bloc-fixe-nom
{position:fixed;right:0px;left:500px;top:30px;height:16px;width:250px;color:white;
font-size:90%;}'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''#bloc-chapitre
{position:fixed;overflow:auto;right:5px;left:5px;bottom:5px;top:47px;background-
repeat: no-repeat;background: -moz-linear-gradient(top, #c7d6e2,
#98a0a7);background: -webkit-gradient(linear, left top, left bottom, from(#c7d6e2),
to(#98a0a7));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#c7d6e2,
endColorstr=#98a0a7);font-size:110%;}'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''h3 {font-family :
Arial,Verdana,Helvetica;background-repeat: no-repeat;background: -moz-linear-
gradient(top, #ffffff, #c3d2df);background: -webkit-gradient(linear, left top, left
bottom, from(#ffffff), to(#c3d2df));filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,
endColorstr=#c3d2df);font-size:110%;color : #2f4576;}'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" /><style type="text/css">'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''</STYLE><!--[if lt IE 7]><STYLE
type=text/css> html, body {height:100%;} html {padding-top:85px} #bloc-fixe, #bloc-
chapitre { position:absolute;width:100%;} #bloc-chapitre
{position:absolute;height:100%;} </STYLE><![endif]--></head><body>'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<div id="bloc-fixe"><b>AIX
VIEW ....and also !! </b></div>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<div id="bloc-fixe-nom"><b>par Jean
fran\347ois Pinguet</b></div>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<div id="bloc-chapitre">'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>Si vous voulez en savoir
plus . . .</strong></h3><PRE><a
href="http://galetiere.fr/aufildeaix/aixview.htm">http://galetiere.fr/aufildeaix/ai
xview.htm</a></pre>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>L audit \253 aixview \273
pour quoi faire . . .</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Le script d audit a pour int\351r\352t
de faciliter l analyse des machines. Il est important pour les services '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''techniques d avoir une image de l \
351tat de la machine au moment de la prise en main. Le script
<strong>"aixview.sh"</strong>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''analyse les machines et/ou partitions et
permet de voir le fonctionnement des diff\351rents adapters, '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''configuration des raids disques,
configurations des fibres, des miroirs disques . etc...'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Lors d un incident, les techniciens
demandent d ex\351cuter le script. La comparaison avec les anciens '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''r\351sultats permettent d optimiser les
diagnostiques.</pre>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>Ou trouver l audit \253
aixview \273 ??</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Je fournis r\351guli\350rement des
versions, sinon vous pouvez le t\351l\351charger sur mon site.'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<a
href="http://galetiere.fr/aufildeaix/telechargement.htm">http://galetiere.fr/aufild
eaix/telechargement.htm</a></pre>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>Il faut savoir quil existe
aussi . . .</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Le script "audithmc.sh" permet de voir
le cot\351 configuration des HMC, la r\351partition des processeurs, m\351moires,
'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''configuration des partitions.... il nous
permet aussi de voir les d\351fauts de configuration avec les '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''d\351validations de certain \
351l\351ments. Il n est pas utilisable pour les HMCs des Regattas.'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Une liaison ssh est utilis\351e lors de
l ex\351cution du script sur la partition utilis\351e vers l HMC</pre>'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>L audit \253 aixview \273
pour quelle machine . . .</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Toutes versions AIX. Cependant
l�ex\351cution sur des machines anciennes peut prendre beaucoup de
temps.</pre>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>Une nouvelle version \253
aixview \273 ??...</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''La derni\350re version est
r\351actualis\351e en fonction des nouveaut\351s, et s enrichit aussi de nouvelle
analyses suite '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''aux nouveaux probl\350mes
rencontr\351s.</pre>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>Comment utiliser le script d
audit \253 aixview.sh \273 . . .</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Le script d audit
<strong>"aixwiew.sh"</strong> doit \352tre ex\351cut\351 sur toutes les partitions
sous "root". '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Dans le cas d un VIOS, entrez en \253
padmin \273 dans le VIOS, puis entrez en \253 oem_setup_env \273. L utilisation du
'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''script est la m\352me qu avec une
partition standard.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<strong>Installer le \253 aixview.sh \
273 sur les partitions AIX </strong>(Attention, en ftp choisir un transfert en
BINARY) :'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''sur toutes les partitions en root'\'';
'valpage=valpage+\'''\\'\'n''\''+'\'' '\'' ;
'valpage=valpage+\'''\\'\'n''\''+'\''<strong>chmod +x aixview.sh</strong>'\'' ;' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\'' '\'';'
valpage=valpage+\'''\\'\'n''\''+'\''<strong>./aixview.sh -dn
"NomClient"</strong>'\'' ; valpage=valpage+'\'''\\'\'n''\''+'\'' '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''R\351cup\351rer le fichier
<strong>HTML</strong> g\351r\351, pour l afficher avec un browser.</pre>'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<h3><strong>La toute petite histoire du
script d audit . . .</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Le premier script d audit est n\351
suite \340 un grand coup blues <strong>dans les ann\351es 2001</strong>. Le snap \
351tant trop gros, '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''\340 l \351poque, la prise en charge d
un nouveau serveur se faisait par la saisie d une liste de commande que l on '\'''
>> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''transf\351rait ensuite sur une disquette
3"1/2. On r\351coltait tous les petits fichiers que l on mettait en forme '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''dans un document Word (\347a fait un peu
vieux con !!). Pour un serveur c \351tait facile, mais un jour, quelqu un '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''que je ne d\351noncerai pas parce que c
est un ami <em>(Christian Gigante)</em>, m a envoy\351 auditer des serveurs sur
'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''St Etienne. Au bout de quasi une
journ\351e \340 saisir des commandes, je me suis promis de ne pas recommencer. Le
'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''lendemain, les premi\350res lignes du
script d audit naissaient. Le fichier de r\351sultat \351tait sous un format
<strong>".txt"</strong>, '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''et \351tait facilement int\351grable
sous Word.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''La facilit\351 d ex\351cution \340
permis de r\351cup\351rer plus d informations, avec plus de complications '\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''pour toujours affin\351 le r\351sultat.
Avec le format <strong>".txt"</strong> il est devenu difficile de lire le
r\351sultat si l on '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''n avait pas un \351diteur performant.
Onze versions ont \351t\351 cr\351es, il s appelait <strong>\253 ecsaudit.sh \
273</strong>.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<strong>En 2005</strong>, j ai cr\351e
une version HTML que je n ai <strong>diffus\351 qu en 2006</strong>, version 11-
H.1.0. Il avait le m\352me nom '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<strong>\253 ecsaudit.sh \273</strong>,
mais fonctionnait \340 l aide de modules et d un moteur d ex\351cution. Il
suffisait ensuite de cr\351er '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''des modules suppl\351mentaires avec de
nouvelles commandes pour faire \351voluer les versions. '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<strong>En 2010</strong> apr\350s la
version 11-H.2.16, et quelques modifications, le script \340 \351t\351 renomm\351
en <strong>\253 aixaudit.sh \273</strong>, et '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''a \351volu\351 jusqu \340 la version 11-
H.2.28. '\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''<strong>Fin 2011</strong>, donc 10 ans
apr\350s sa naissance, refonte de tout le graphisme, am\351lioration de la
compatibilit\351 vers les'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''browsers. Apparition de la
<strong>version 2012-1.0.0</strong> nomm\351 pour l occasion <strong>\253 AIXVIEW \
273</strong> avec le fichier <strong>\253 aixview.sh \273</strong>'\''' >>
$presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''</pre><h3><strong>Merci
qui ??...</strong></h3><PRE>'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Christian Gigante pour accepter de subir
les premiers tests.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Jean-Fran\347ois Faivre et Franck Delmas
pour leurs suggestions de rajout de commandes, et leurs mise \340 disposition de
machines.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Stephen Etile pour les mises \340
dispositions de machines, d ex\351cutions des tests et de critique de la
forme.'\''' >> $presentation
echo 'valpage=valpage+'\'''\\'\'n''\''+'\''Samir Ouedda pour ses retours d
informations constructifs.'\''' >> $presentation
return $a
}
# --- Fin d audit html
FinAudithtml()
{
$debug
typeset -i a=0
typeset UtilModule temp NomMod
finAudit=$tpvar"finaudit"
echo '<a name="bottom"></a><h3><strong>End of the audit</strong></h3><PRE> the
document was created by a script AIX created by Jean Fran�ois Pinguet ' >>
$finAudit
echo '<iframe align="left" width="2" height="2" frameborder="0" scrolling="auto"
src="http://galetiere.fr/compteuraix.php" name="compteurVue"></iframe></PRE>' >>
$finAudit
echo '<div id="back"><a href="#sommaire">Back to top</a></div></div>' >> $finAudit
return $a
}
# --- Information de Resume de l audit
Resume()
{
$debug
typeset aa bx cx
typeset -i j=$1
typeset -i a=0
typeset UtilModule temp NomMod memoire memoire1 conf
NomMod=$tpvar"Resume"
UtilModule="Resume"
temp=$tpvar$j"Resume"
>$temp"jfp1"
echo "resume . . . ."
echo '<div id="contenu"><a name="sommaire">' > $NomMod
echo '<div id="bloc-fixe-pub"><marquee width="800" direction="left" loop="infinite"
scrollamount="2" align="bottom" height="20">this audit was created and offered by
JFP technical support </marquee></div>' >> $NomMod
echo '<a href="http://galetiere.fr/aufildeaix/aixview.htm"><img
src="http://galetiere.fr/aufildeaix/Info/InfoMiseAJour151.gif" border="0"></a>' >>
$NomMod
echo '</a><h1>Resuming '$partitype'</h1>' >> $NomMod
echo '<h2><pre>' >> $NomMod
Uptime=$(uptime)
echo 'You are connected with ID : <strong> '$(id)' </strong>' >> $NomMod
echo 'Uptime : <strong> '$Uptime' </strong> ' >> $NomMod
if [ $(echo 2 | sed 's/['$LevelExec']/n/g' | grep n) ]
then
echo ' Adresse IP : <strong> none </strong> (aixview run in level 2) \c' >>
$NomMod
else
echo ' Adresse IP : \c' >> $NomMod
ifconfig -a |grep netmask | grep -v "127.0.0.1" | awk '{print$2}' | while
read ligne ; do
echo ' <strong> '$ligne' </strong>\c' >> $NomMod
done
fi
echo '' >> $NomMod
lslpp -L | grep cluster.es.server.rte > $temp"jfp0"
if [[ -s $temp"jfp0" ]]
then
echo '<strong class="alert0"> ATTENTION --> </strong> HACMP, Version :
<strong> '$(lslpp -L | grep cluster.es.server.rte | awk '{print$2}')' </strong>'
>> $NomMod
fi
echo ' ' >> $NomMod
chedition -l 2>$temp"jfp100" 1>$temp"jfp100"
if [ $? = 0 ]
then
echo ' AIX level : <strong> '$(oslevel)' </strong> , Edition :
<strong> '$(chedition -l)' </strong>' >> $NomMod
else
echo ' AIX level : <strong> '$(oslevel)' </strong>' >> $NomMod
fi
oslevel -s >$temp"jfp1" 2>$temp"jfp1"
if [ $? = 0 ]
then
VerFileOS=$(lslpp -L "bos.rte.install" | grep "bos.rte.install" |awk
'{print$2}')
echo ' AIX level -s : <strong id="db-oslevel">'$(oslevel -s)' </strong> ,
bos.rte.install : <strong> '$VerFileOS' </strong>' >> $NomMod
fi
/usr/ios/cli/ioscli ioslevel >$temp"jfp1" 2>$temp"jfp1"
if [ $? = 0 ]
then
chedition 2>$temp"jfp100" 1>$temp"jfp100"
if [ $? != 127 ]
then
chedition -l 2>$temp"jfp100" 1>$temp"jfp100"
if [ $? = 0 ]
then
EDition=$(chedition -l)
else
EDition=$(/usr/ios/cli/ioscli chedition -list 2>$temp"jfp100")
if [[ $EDition = "" ]] ; then EDition="not determined" ; fi
fi
fi
VerFileIOS=$(lslpp -L "ios.cli.rte" | grep "ios.cli.rte" |awk '{print$2}')
echo ' VIOS IOSlevel : <strong id="db-vioslevel"> '$(/usr/ios/cli/ioscli
ioslevel)' </strong> , Edition : <strong> '$EDition' </strong> ,
ios.cli.rte : <strong> '$VerFileIOS' </strong>' >> $NomMod
fi
echo ' ' >> $NomMod
for i in $(lsdev -C -F name | grep proc)
do
processeur=$i
done
memoire=$(bootinfo -r)
[ $? = 0 ] && let memoire1=$memoire/1024
echo 'Really memory size : <strong> '$memoire1' Mbytes </strong>' >> $NomMod
for i in $(lsdev -C -F name | grep L2cache)
do
echo 'Cache : '$i' --> <strong> '$(lsattr -El $i)' </strong>' >> $NomMod
done
smtctl 1>$temp"jfp1" 2>$temp"jfp1"
if [ $? != 127 ]
then
smtctl |grep SMT | grep proc | grep -v bound > $temp"jfp1"
if [ -s $temp"jfp1" ]
then
echo $(smtctl |grep SMT | grep proc | grep -v bound | cut -c
-10)'<strong> '$(smtctl |grep SMT | grep proc | grep -v bound | cut -c 10-)'
</strong>' >> $NomMod
fi
fi
echo ' ' >> $NomMod
cat $tpvar"jfp_prtconf" |grep -i firmware |grep -iv "not available" | while read
conf ; do
echo $(echo $conf | tr " " "%" | tr ":" " "| awk '{print$1}'| tr "%" " ")'
<strong> '$(echo $conf | tr " " "%" | tr ":" " "| awk '{print$2}'| tr "%" " ")'
</strong>' > $temp"jfp1"
cat $temp"jfp1" | grep -i Version > $temp"jfp2"
if [ -s $temp"jfp2" ]
then
echo $(echo $conf | tr " " "%" | tr ":" " "| awk '{print$1}'| tr "%" "
")' <strong id="db-srvfirmware"> '$(echo $conf | tr " " "%" | tr ":" " "| awk
'{print$2}'| tr "%" " ")' </strong>' >> $NomMod
else
echo $(echo $conf | tr " " "%" | tr ":" " "| awk '{print$1}'| tr "%" "
")' <strong> '$(echo $conf | tr " " "%" | tr ":" " "| awk '{print$2}'| tr "%" " ")'
</strong>' >> $NomMod
fi
done
>$temp"jfp111"
>$temp"jfp112"
>$temp"jfp113"
ls $tpsort"Res"* | while read aa ; do
cat $aa | grep -i 'class="alert"' >> $temp"jfp111"
cat $aa | grep -i 'class="alert0"' >> $temp"jfp112"
cat $aa | grep -ivE 'class="alert0"|class="alert"' >> $temp"jfp113"
done
cat $temp"jfp113" >> $NomMod
echo '' >> $NomMod
cat $temp"jfp112" >> $NomMod
echo '' >> $NomMod
cat $temp"jfp111" >> $NomMod
cat $tpvar"jfp_prtconf" |grep -i "machine serial number" |grep -iv "not available"
| tr " " "%" | tr ":" " " | awk '{print$2}' | tr '%' ' ' | awk '{print$1}' >
$temp"jfp1"
if [[ ! -s $temp"jfp1" ]]
then
typeset j=$1
typeset TitreModule version
TitreModule="ls -ltr /var/tmp | tail"
version=" version 2013-1.4.6 date: 21/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF006"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
ls -ltr /var/tmp | tail > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_ls_ltr_var_tmp_tail''\''));"
style="cursor: pointer;"><strong class="alert1"> \c' >> $Modu
echo 'ls -ltr /var/tmp | tail' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_ls_ltr_var_tmp_tail" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_ls_ltr_var_tmp_tail''\''));"
style="cursor: pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
typeset j=$1
typeset TitreModule version
TitreModule="ulimit -a"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF007"
filtre='infoperf'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
ulimit -a > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''ulimita''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'ulimit -a \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="ulimita" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''ulimita''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
typeset j=$1
typeset TitreModule version
typeset -i a=0
TitreModule="/etc/qconfig (printer)"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF008"
filtre='infoinst'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/qconfig > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcqconfig''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/qconfig \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcqconfig" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcqconfig''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF009() # Num�ro d execution
{
$debug
#yyyy ModFFF009 oui
typeset j=$1
typeset TitreModule version
TitreModule="edit crontab"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF009"
filtre='infosys'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
crontab -l > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''crontabl''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'crontab -l \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="crontabl" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''crontabl''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF010() # Num�ro d execution
{
$debug
#yyyy ModFFF010 oui
typeset -i i
typeset j=$1
typeset TitreModule version
TitreModule="Information audit executing"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF010"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
echo $CmdLancer >> $Modu
echo '' >> $Modu
if [ -s $tpsort"KILL9" ]
then
echo '<a href="#'${SignetS[$NumNum+4000]}'" class="alert" title="Go to 4.'$j'
'$TitreModule'">Some command with time out are Killed</a>' >> $Resu
echo 'Some command with time out are Killed' >> $Modu
cat $tpsort"KILL9" >> $Modu
else
echo 'no command KILL' >> $Modu
fi
if [ -s $tpsort"MVide" ]
then
echo 'Command with no result :' >> $Modu
cat $tpsort"MVide" >> $Modu
fi
echo '' >> $Modu
cat $tpsort"ModExecAudit" >> $Modu
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF011() # Num�ro d execution
{
$debug
#yyyy ModFFF011 oui
typeset j=$1
typeset TitreModule version
TitreModule="Tuning Info : /etc/tunables/nextboot"
version=" version 11-H.2.15"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF011"
filtre='infoperf'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/tunables/nextboot > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etctunablesnextboot''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/tunables/nextboot \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etctunablesnextboot" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etctunablesnextboot''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF012() # Num�ro d execution
{
$debug
#yyyy ModFFF012 oui
typeset j=$1
typeset TitreModule version
TitreModule="environment variables : env"
version=" version 11-H.2.16"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF012"
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
env > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''envjfpenviron''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'env \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="envjfpenviron" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''envjfpenviron''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF013() # Num�ro d execution
{
$debug
#yyyy ModFFF013 oui
typeset j=$1
typeset TitreModule version
TitreModule="INFO DUMP : sysdumpdev"
version=" version 11-H.2.16, modif le 29/05/12"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF013"
filtre='infolog'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
sysdumpdev -l > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''sysdumpdevl''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'sysdumpdev -l \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="sysdumpdevl" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''sysdumpdevl''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
sysdumpdev -L > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''sysdumpdevL2''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'sysdumpdev -L \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="sysdumpdevL2" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''sysdumpdevL2''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF014() # Num�ro d execution
{
$debug
#yyyy ModFFF014 oui
typeset j=$1
typeset TitreModule version
TitreModule="/etc/profile"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF014"
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/profile > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcprofile''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/profile \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcprofile" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcprofile''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF015() # Num�ro d execution
{
$debug
#yyyy ModFFF015 oui
typeset j=$1
typeset TitreModule version
TitreModule="/etc/passwd"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF015"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/passwd > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcpasswd''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/passwd \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcpasswd" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcpasswd''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF016() # Num�ro d execution
{
$debug
#yyyy ModFFF016 oui
typeset j=$1
typeset TitreModule version
TitreModule="/etc/group"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF016"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/group > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcgroup''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/group \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcgroup" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcgroup''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF017() # Num�ro d execution
{
$debug
#yyyy ModFFF017 oui
typeset j=$1
typeset TitreModule version
TitreModule="/etc/filesystems"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF017"
filtre='infosys'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/filesystems > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcfilesystems''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/filesystems \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcfilesystems" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcfilesystems''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF018() # Num�ro d execution
{
$debug
#yyyy ModFFF018 oui
typeset j=$1
typeset TitreModule version
TitreModule="/etc/security/limits"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF018"
filtre='infoperf'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
cat /etc/security/limits > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''etcsecuritylimits''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo '/etc/security/limits \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="etcsecuritylimits" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''etcsecuritylimits''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF019() # Num�ro d execution
{
$debug
#yyyy ModFFF019 oui
typeset j=$1
typeset TitreModule version
TitreModule="locale"
version=" version 2012-1.0.0 date : 27/10/11"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF019"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
locale > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''localejfp2''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'locale \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="localejfp2" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''localejfp2''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModFFF020() # Num�ro d execution
{
$debug
#yyyy ModFFF020 oui 6 "ls -ltr /var/adm | tail"
typeset j=$1
typeset TitreModule version
TitreModule="ls -ltr /var/adm | tail"
version=" version 2013-1.4.6 date: 21/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="FFF020"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+4000]="Mod"$NomMod
TitreS[$NumNum+4000]=$TitreModule
NumS[$NumNum+4000]=$j
SignetS[$NumNum+4000]="titre"$NomMod
listlien[$NumNum+4000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
ls -ltr /var/adm | tail > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_ls_ltr_var_adm_tail''\''));"
style="cursor: pointer;"><strong class="alert1"> \c' >> $Modu
echo 'ls -ltr /var/adm | tail \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_ls_ltr_var_adm_tail" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_ls_ltr_var_adm_tail''\''));"
style="cursor: pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr VgAssos ccin typeM Manufacturer Firm
location1 location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
for typeinfo in FRU2 NomAdapter2 locaddr2 VgAssos2 ccin2 typeM2 Manufacturer2 Firm2
location12 location22 location32
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-scsicard"><tr><td>SCSI card :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{ccin[$numligne]}'</td><td>'${SerialNumber[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'$
{Adapterdesc[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SCSI card with FRU </th>' >>
$Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>SCSI card :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${ccin2[$numligne]}'</td><td>'$
{SerialNumber2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})$([[ ${location52[$numligne]} != 'none' ]] && echo '-'$
{location52[$numligne]})$([[ ${location62[$numligne]} != 'none' ]] && echo '-'$
{location62[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td></tr>' >>
$temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SCSI card without FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH002() # Num�ro d execution
{
$debug
#yyyy ModHHH002 oui
typeset j=$1
typeset TitreModule version
TitreModule="SAS Raid Card"
version="modif with version 2013-1.4.2 date: 29/08/2013"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH002"
typeset -i miss=0
typeset sas xx info status addr
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsdev -Cc adapter -F name | grep sas >$temp"jfp1"
if [ $? = 0 ]
then
let nbfib=0
for sas in $(lsdev -l sissas* -F name)
do
((nbfib+=1))
lscfg -vl $sas | grep -iE "(alterable)|FRU|Part Number|Customer
Card ID Number|Network Address" | tr " " "#" |tr '.' ' ' > $temp"jfp6"
part=$(cat $temp"jfp6" | grep Part#Number | awk '{print$2}'|tr
"#" " ")
FRU=$(cat $temp"jfp6" | grep FRU | awk '{print$2}'|tr "#" " ")
cat $temp"jfp6" | grep '(alterable)' |read xx xxx Z99
Z9=$(echo $Z99|tr " " "." | tr "#" " ")
CCIN=$(cat $temp"jfp6" | grep Customer#Card#ID#Number | awk
'{print$2}'|tr "#" " ")
lsdev -l $sas | read xx status addr info
echo '<TABLE cellpadding=1 cellspacing=1 border=1
bgcolor=#becddb><tr><td><b> Adapter : </b><em> '$sas' </em> <em> '$status'
</em> <em> '$addr' </em><b> '$info' </b>' >> $Modu
echo '<b> Parts : </b> '$part' , <b> FRU : </b> '$FRU' , <b>
Firmware : </b> '$Z9' , <b> CCIN : </b> '$CCIN >> $Modu
echo '</td></tr></TABLE><TABLE cellpadding=1 cellspacing=1
border=1 bgcolor=#becddb><tr><td><b> Diplaying Rechargeable Battery Information :
</b><em> '$sas' </em>' >> $Modu
sissasraidmgr -M -o0 -l $sas >> $Modu
echo '</td></tr></TABLE><TABLE cellpadding=1 cellspacing=1
border=1 bgcolor=#becddb><tr><td><b> Viewing the SAS device resource
information : </b><em> '$sas' </em>' >> $Modu
sissasraidmgr -Z -o1 -j3 -l $sas >> $Modu
echo '</td></tr></TABLE><TABLE cellpadding=1 cellspacing=1
border=1 bgcolor=#becddb><tr><td><b> Viewing the SAS device resource locations :
</b><em> '$sas' </em>' >> $Modu
sissasraidmgr -Z -o0 -j3 -l $sas >> $Modu
echo '</td></tr></TABLE><TABLE cellpadding=1 cellspacing=1
border=1 bgcolor=#becddb><tr><td><b> Viewing the Disk Array Configuration :
</b><em> '$sas' </em>' >> $Modu
sissasraidmgr -Ll $sas -j1 >> $Modu
echo '</td></tr></TABLE><TABLE cellpadding=1 cellspacing=1
border=1 bgcolor=#becddb><tr><td><b> Viewing the Disk SAS Configuration path on
split backplane : </b><em> '$sas' </em>' >> $Modu
sissasraidmgr -Tl $sas >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH003() # Num�ro d execution
{
$debug
#yyyy ModHHH003 oui "HARD Available SSA Adapter"
typeset j=$1
typeset TitreModule version
TitreModule="HARD Available SSA Adapter"
version=" version 2013-1.4.2 date: 17/09/2013"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH003"
typeset -i num=1
typeset ligne
typeset NomAdapter[] Adapterdesc[] locaddr[] VgAssos[] typeM[] FRU[]
SerialNumber[] ccin[] sizem[] location1[] location2[] location3[] location4[]
location5[] location6[] Manufacturer[] Firm[] NetAddr[]
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsdev -S A -Cc adapter -F name,description | grep -v siss | tr ' ' '%' | tr ',' ' '
| awk '{print$1}' | grep -i ssa > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc adapter -F name,description | grep -v siss | grep -i ssa | tr ' '
'%' | tr ',' ' ' > $temp"listeadapt"
typeset -i numtotligne
typeset -i numligne=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number" | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} > $temp"jfp0" ;
ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ] ; then
ccin[$numligne]='none' ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr '.' '
' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} > $temp"jfp0" ;
Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "${Manufacturer[$numligne]}" = ''
] ; then Manufacturer[$numligne]='none' ; fi
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
#NetAddr[$numligne]=$(cat $temp"adapter" | grep -i Network%Address | tr '.' '
' | awk '{print$2}' | tr '%' ' ') ; echo ${NetAddr[$numligne]} > $temp"jfp0" ;
NetAddr[$numligne]=$(cat $temp"jfp0") ; if [ "${NetAddr[$numligne]}" = '' ] ; then
NetAddr[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i "ROS%level" | awk '{print$2}'
| tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} > $temp"jfp0" ;
Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ] ; then
Firm[$numligne]='none' ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$1}') ; if [ "$
{location1[$numligne]}" = '' ] ; then location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$2}') ; if [ "$
{location2[$numligne]}" = '' ] ; then location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$3}') ; if [ "$
{location3[$numligne]}" = '' ] ; then location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$4}') ; if [ "$
{location4[$numligne]}" = '' ] ; then location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$5}') ; if [ "$
{location5[$numligne]}" = '' ] ; then location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i ${NomAdapter[$numligne]}
| tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk '{print$6}') ; if [ "$
{location6[$numligne]}" = '' ] ; then location6[$numligne]='none' ; fi
for typeinfo in FRU NomAdapter locaddr ccin Manufacturer Firm location1 location2
location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-ssacard"><tr><td>SSA card :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{SerialNumber[$numligne]}'</td><td>'${Manufacturer[$numligne]}'</td><td><span
class="db-location">'${location1[$numligne]}$([[ ${location2[$numligne]} !=
'none' ]] && echo '-'${location2[$numligne]})$([[ ${location3[$numligne]} != 'none'
]] && echo '-'${location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] &&
echo '-'${location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo
'-'${location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'$
{Adapterdesc[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>SerialN
umber</th><th>manufacturer</th><th>Physical Location</th><th>Description</th></tr>"
>> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH004() # Num�ro d execution
{
$debug
#yyyy ModHHH004 oui
typeset j=$1
typeset TitreModule version
TitreModule="All devices list"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH004"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsdev -C >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
if [ -n "$hdisks" ]
then
for i in $hdisks
do
location_hdisk=`lsdev -Cl $i | awk '{ print $3 }'`
scsi_id_hdisk=`echo $location_hdisk | cut -c1-5`
if [ $scsi_id_hdisk = $scsi_id_adptr ]
then
scraidmgr -C -l $i >> $temp"jfp1"
fi
done
fi
if [ -n "$hdisks" ]
then
for i in $hdisks
do
location_hdisk=`lsdev -Cl $i | awk '{ print $3 }'`
scsi_id_hdisk=`echo $location_hdisk | cut -c1-5`
if [ $scsi_id_hdisk = $scsi_id_adptr ]
then
scraidmgr -J -l $i >> $temp"jfp1" 2>$temp"jfp5"
if [ $? -ne 0 ]
then
echo '<a href="#'${SignetS[$NumNum+1000]}'" class="alert"
title="Go to 1.'$j' '$TitreModule'">'$CarteScsiRaid', Disk Array '$i' ; IN ERROR
</a>' >> $Resu
echo '<em> '$CarteScsiRaid' </em><b> , Disk Array </b><em>
'$i' : </em><br/>' >> $temp"jfp1"
cat $temp"jfp5" >> $temp"jfp1"
fi
fi
done
fi
done
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
cat $tpsort"HARDLoc" | tr ' ' 'x' | tr '-' 'y' | tr '.' 'z' | grep -w
"$histo" > $temp"jfp0000"
if [ $? = 0 ]
then
if (( $numligne > 0 )) ; then ((numligne-=1)); fi
else
echo ${Nom[$numligne]} >> $temp"Nom""1"
echo ${SerialNumber[$numligne]} >> $temp"SerialNumber""1"
echo ${ccin[$numligne]} >> $temp"ccin""1"
echo ${FRU[$numligne]} >> $temp"FRU""1"
echo ${typeM[$numligne]} >> $temp"typeM""1"
echo ${location1[$numligne]} >> $temp"location1""1"
echo ${location2[$numligne]} >> $temp"location2""1"
echo ${location3[$numligne]} >> $temp"location3""1"
fi
fi
done
let numtotligne=$numligne
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-hardelement"><tr><td>Hardware element :</td><td>'$
{Nom[$numligne]}'</td><td>'${typeM[$numligne]}'</td><td>'$
{SerialNumber[$numligne]}'</td><td>'${FRU[$numligne]}'</td><td>'$
{ccin[$numligne]}'</td><td><span class="db-location">'${location1[$numligne]}$([[ $
{location2[$numligne]} != 'none' ]] && echo '-'${location2[$numligne]})$([[ $
{location3[$numligne]} != 'none' ]] && echo '-'${location3[$numligne]})$([[ $
{location4[$numligne]} != 'none' ]] && echo '-'${location4[$numligne]})$([[ $
{location5[$numligne]} != 'none' ]] && echo '-'${location5[$numligne]})$([[ $
{location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo "<tr><th></th><th>Name</th><th>Type
Model</th><th>Serial</th><th>FRU</th><th>CCIN</th><th>Physical Location</th></tr>"
>> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
let numtotligne=$numligne
let numtotligne2=$numligne2
cat $temp"NomAdapter""11" | sort -u > $temp"NomAdapter""1"
cat $temp"locaddr""11" | sort -u > $temp"locaddr""1"
cat $temp"Adapterdesc""11" | sort -u > $temp"Adapterdesc""1"
cat $temp"typeM""11" | sort -u > $temp"typeM""1"
cat $temp"SerialNumber""11" | sort -u > $temp"SerialNumber""1"
cat $temp"ccin""11" | sort -u > $temp"ccin""1"
cat $temp"Manufacturer""11" | sort -u > $temp"Manufacturer""1"
cat $temp"PortSpeedSup""11" | sort -u > $temp"PortSpeedSup""1"
cat $temp"PortSpeedRun""11" | sort -u > $temp"PortSpeedRun""1"
cat $temp"FRU""11" | sort -u > $temp"FRU""1"
cat $temp"Firm""11" | sort -u > $temp"Firm""1"
cat $temp"location1""11" | sort -u > $temp"location1""1"
cat $temp"location2""11" | sort -u > $temp"location2""1"
cat $temp"location3""11" | sort -u > $temp"location3""1"
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr ccin typeM Manufacturer Firm location1
location2 location3 PortSpeedSup PortSpeedRun
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
typeset j=$1
typeset TitreModule version
TitreModule="SDD DataPath (vpath)"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH022"
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
$(which datapath) query version >$temp"jfp1" 2>$temp"jfp1"
if [ $? = 0 ]
then
lslpp -l | grep "devices\.sdd\." >$temp"jfp1" 2>$temp"jfp1"
if [ $? = 0 ]
then
echo '<b> datapath query version : </b>' >> $Modu
$(which datapath) query version >> $Modu
echo '<a href="#'${SignetS[$NumNum+1000]}'" title="Go to 1.'$j'
'$TitreModule'"><strong class="alert0"> STORAGE : </strong></a><strong> SDD
DataPath (vpath) </strong> , Version : <strong> '$(cat $temp"jfp1" | awk
'{print$3}') ' </strong>' >> $Resu
echo '<b> datapath query adapter : </b>' >> $Modu
$(which datapath) query adapter >> $Modu
echo '<b> datapath query device : </b>' >> $Modu
$(which datapath) query device >> $Modu
fi
fi
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
typeset j=$1
typeset TitreModule version
TitreModule="LPAR caracteristics"
version=" version 2013-1.4.6 date: 21/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH025"
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lparstat_i''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lparstat -i \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lparstat_i" style="display: none;">' >> $Modu
lparstat -i >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lparstat_i''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_amepat''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'amepat \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_amepat" style="display: none;">' >> $Modu
amepat >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_amepat''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
done
echo '<strong class="alert2"> Fiber adapter ( fcs ): </strong><strong>
'$nbfib' </strong>' >> $Resu
echo '<CAPTION style=background:#add8e6><b> HBA card : (</b>'$NomVolume >
$temp"jfp1ResulCom"
echo "xxxx- Etat carte HBA :" >> $temp"jfp1ResulCom"
print
"b,HBA,b,STATE,b,ADDR,b,FEATURE,b,PART_NB,b,FRU_NB,b,TYPE,b,MODEL,b,SPEED,b,ROM,b,F
/W,b,S/N,b,LOCATION,b,WWPN,b,MAX_XFER_SIZE,b,NUM_CMD_ELEMS,bc,FSCSI,bc,STATE,bc,FC_
ERR_RECOV,bc,DYNTRK" >> $temp"jfp1ResulCom"
for HBA in `lsdev -Cc adapter | grep ^fcs | awk '{print $1}'`; do
> $temp"jfp2"
WWPN=`lscfg -vl $HBA | grep Network | sed 's/\./ /g' | awk '{print $NF}'`
FCSTAT=`fcstat $HBA 2>/dev/null | sed 's/$/,/' | sed -e :a -e '$!N;
s/\n/ /; ta' | sed 's/ //g' | sed 's/ //g'`
SPEED=`echo $FCSTAT | tr "," "\n" | grep running | awk -F: '{print $NF}'`
if [[ $SPEED = "" ]]; then
SPEED="N/A"
fi
TYPE=`echo $FCSTAT | tr "," "\n" | grep "PortType" | awk -F: '{print $NF}'`
if [[ $TYPE = "" ]]; then
TYPE="Link Down"
fi
SERIAL=`echo $FCSTAT | tr "," "\n" | grep Serial | awk -F: '{print
$NF}'`
ROM=`echo $FCSTAT | tr "," "\n" | grep ROM | awk -F: '{print $NF}'`
FIRMWARE=`echo $FCSTAT | tr "," "\n" | grep Firmware | awk -F: '{print
$NF}'`
MODEL=`lscfg -pl $HBA | grep Model | awk '{print $NF}'`
LOCATION=`lscfg -pl $HBA | grep Location | awk '{print $NF}'`
FCS_STATE=`lsdev -l $HBA | awk '{print $2}'`
MAX_XFER_SIZE=`lsattr -El $HBA -a max_xfer_size | awk '{print $2}'`
NUM_CMD_ELEMS=`lsattr -El $HBA -a num_cmd_elems | awk '{print $2}'`
FSCSI=`echo $HBA | sed 's/fcs/fscsi/'`
FSCSI_STATE=`lsdev -l $FSCSI 2>/dev/null | awk '{print $2}'`
FC_ERR_RECOV=`lsattr -El $FSCSI -a fc_err_recov 2>/dev/null | awk
'{print $2}'`
DYNTRK=`lsattr -El $FSCSI -a dyntrk 2>/dev/null | awk '{print $2}'`
ADDR=`lsdev -Cc adapter | grep $HBA | awk '{print$3}'`
FEATURE=`lscfg -vl $HBA | grep Feature | tr " " "%" |tr "." " " | awk
'{print$2}'`
[[ $FEATURE = "" ]] && FEATURE=none
PART_NB=`lscfg -vl fcs0 | grep "Part Number" | tr " " "%" |tr "." " " |
awk '{print$2}'`
[[ $PART_NB = "" ]] && PART_NB=none
FRU_NB=`lscfg -vl fcs0 | grep "FRU" | tr " " "%" |tr "." " " | awk
'{print$2}'`
[[ $FRU_NB = "" ]] && FRU_NB=none
coulstat1=ro
coulstat2=ro
coulstat3=ro
coulstat4=ro
[[ $FCS_STATE = "Available" ]] && coulstat1=vc
[[ $FSCSI_STATE = "Available" ]] && coulstat2=vc
[[ $TYPE != "Link Down" ]] && coulstat4=b
lsdev -C| grep $ADDR | grep -vE "$HBA|fscsi" | while read dev1 state1
addr1 d ; do
coulstat3=ro
[[ $state1 = "Available" ]] && coulstat3=vc
print 'b,'$dev1','$coulstat3','$state1',b,'$addr1 >> $temp"jfp2"
done
print
'bf,'$HBA','$coulstat1','$FCS_STATE',b,'$ADDR',b,'$FEATURE',b,'$PART_NB',b,'$FRU_NB
','$coulstat4','$TYPE',b,'$MODEL',b,'$SPEED',b,'$ROM',b,'$FIRMWARE',b,'$SERIAL',b,'
$LOCATION',b,'$WWPN',b,'$MAX_XFER_SIZE',b,'$NUM_CMD_ELEMS',bc,'$FSCSI','$coulstat2'
,'$FSCSI_STATE',bc,'$FC_ERR_RECOV',bc,'$DYNTRK >> $temp"jfp1ResulCom"
cat $temp"jfp2" >> $temp"jfp1ResulCom"
done
echo " " > $temp"jfp1TitreVolume"
tritablec "Etat carte HBA :" $temp"jfp1ResulCom" $temp"jfp1sorti"
$temp"jfp1TitreVolume"
cat $temp"jfp1sorti" >> $Modu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH029() # Num�ro d execution
{
$debug
#yyyy ModHHH029 oui
typeset j=$1
typeset TitreModule version
TitreModule="ATF Objet"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH029"
typeset obj
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsdev -C -Sa | grep atf
if [ $? = "0" ]
then
for obj in $(lsdev -C -Sa -F name | grep atf)
do
echo '<b> '$obj:' </b>' >> $Modu
/usr/sbin/atf/atfi -d $obj -p >> $Modu
echo '<a href="#'${SignetS[$NumNum+1000]}'" title="Go to 1.'$j'
'$TitreModule'"><strong class="alert0"> ATF : </strong></a><strong> present
</strong>' >> $Resu
echo '' >> $Modu
done
fi
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
lsdev -S A -Cc adapter -F name,description | tr ' ' '%' | tr ',' ' ' | awk
'{print$1}' | grep -i ent > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc adapter -F name,description | grep -i ent | grep -iv scsi | tr ' '
'%' | tr ',' ' ' > $temp"listeadapt"
lsdev -S A -Cc adapter -F name,description | grep -i hba | grep -iv scsi | tr ' '
'%' | tr ',' ' ' >> $temp"listeadapt"
typeset -i numtotligne numligne1 numtotligne2 numligne2 numligne
let numligne1=0
let numligne=0
let numligne2=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
addip[$numligne]=$(netstat -in|grep $(echo ${NomAdapter[$numligne]} | sed
's/t//') | egrep -v "link" | awk '{print $4}' | tr '\n' ';') ; echo $
{addip[$numligne]} > $temp"jfp0" ; addip[$numligne]=$(cat $temp"jfp0") ; if [ "$
{addip[$numligne]}" = '' ] ; then addip[$numligne]='none' ; fi
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Part%Number | awk '{print$2}' | sed 's/^[\.\t]//g' | tr
'%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0")
; if [ "${FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Z3 | awk '{print$2}' | tr '%' ' ') ; echo $
{FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0") ; if [ "$
{FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" != 'none' ]
then
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number"
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} >
$temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ]
; then ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%' '
') ; echo ${ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ;
if [ "${ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} >
$temp"jfp0" ; Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "$
{Manufacturer[$numligne]}" = '' ] ; then Manufacturer[$numligne]='none' ; fi
NetAddr[$numligne]=$(cat $temp"adapter" | grep -i Network%Address | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${NetAddr[$numligne]} >
$temp"jfp0" ; NetAddr[$numligne]=$(cat $temp"jfp0") ; if [ "${NetAddr[$numligne]}"
= '' ] ; then NetAddr[$numligne]='none' ; fi
typeM[$numligne]=$(cat $temp"adapter" | grep -i Machine%Type%and%Model
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${typeM[$numligne]} >
$temp"jfp0" ; typeM[$numligne]=$(cat $temp"jfp0") ; if [ "${typeM[$numligne]}" = ''
] ; then typeM[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i alterable | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} >
$temp"jfp0" ; Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ]
; then Firm[$numligne]='none' ; fi
if [ "${Firm2[$numligne2]}" = 'none' ] ; then Firm[$numligne]=$(cat
$temp"adapter" | grep -i "Loadable%Microcode%Level" | awk '{print$2}' | tr '%' ' '
| sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} > $temp"jfp0" ; Firm[$numligne]=$
(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ] ; then
Firm[$numligne]='none' ; fi ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; echo $
{location1[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location1[$numligne]=$
(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; echo $
{location2[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location2[$numligne]=$
(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; echo $
{location3[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location3[$numligne]=$
(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; echo $
{location4[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location4[$numligne]=$
(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; echo $
{location5[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location5[$numligne]=$
(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; echo $
{location6[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location6[$numligne]=$
(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
if [ "${location1[$numligne]}" = "none" ]
then
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
fi
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber NetAddr addip
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr ccin typeM Manufacturer Firm location1
location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-networkcard"><tr><td>network card :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{ccin[$numligne]}'</td><td>'${NetAddr[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'${Adapterdesc[$numligne]}'</td><td>'$
{addip[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> network card with FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th><a
style=color:#824128>NetworkAddress</a></th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>address IP</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>network card :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${ccin2[$numligne]}'</td><td>'$
{NetAddr2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})$([[ ${location52[$numligne]} != 'none' ]] && echo '-'$
{location52[$numligne]})$([[ ${location62[$numligne]} != 'none' ]] && echo '-'$
{location62[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td><td>'$
{addip2[$numligne]}'</td></tr>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> network card without FRU
</th>' >> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th><a
style=color:#824128>NetworkAddress</a></th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>address IP</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH033() # Num�ro d execution
{
$debug
#yyyy ModHHH033 oui
typeset j=$1
typeset TitreModule version
TitreModule="Command NPIV: lsmap -all -npiv"
version=" version 11-H.2.24"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH033"
filtre='vios'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
#/usr/ios/cli/ioscli lsmap -all -npiv : NPIV>> $Modu
/usr/ios/cli/ioscli lsmap -all -npiv >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
fi
fi
((j+=4))
done
fi
fi
((i+=4))
done
rm -f $tpvar"TraiteMirok"*
return $a
}
ModHHH036() # Num�ro d execution
{
$debug
#yyyy ModHHH036 oui
typeset j=$1
typeset TitreModule version
TitreModule="lspv -l (for each disk)"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH036"
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
for i in $(lspv | grep -iv none | grep -i active | awk '{print$1}')
do
lspv -l $i > $temp"jfp1" 2>> $temp"jfp1" &
pid=$!
sleep 2
kill -0 $pid 1>$temp"0" 2>$temp"0"
if [ $? = '0' ]
then
sleep 30
kill -0 $pid 1>$temp"0" 2>$temp"0"
[ $? = '0' ] && (kill -9 $pid ; echo "--- kill lspv -l after time out
of command ---" >> $Modu ; echo 'module HHH036, kill after time out command lspv
-l' >> $tpsort"KILL9" )
fi
if [[ -s $temp"jfp1" ]]
then
#echo "Disque "$i" : " >> $Modu
echo '<em> '$i' </em><b> '$(lsdev -Cc disk | grep -w $i | read val val1;
echo $val1)' : </b>' >> $Modu
#lsdev -Cc disk | grep $i >> $Modu
cat $temp"jfp1" | grep -v $i >> $Modu
fi
echo '' >> $Modu
done
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
if [ -x $(which dlnkmgr) ]
then
echo '<a href="#'${SignetS[$NumNum+1000]}'" title="Go to 1.'$j'
'$TitreModule'"><strong class="alert0"> STORAGE : </strong></a><strong> HITACHI
HDLM </strong>' >> $Resu
echo '<b> HDLM sys : </b><strong><a href="#HDLM sys"> dlnkmgr view -sys
</a></strong>' >> $Modu
echo '<b> HDLM device : </b><strong><a href="#HDLM device"> lsdev -C | grep
dlm </a></strong>' >> $Modu
echo '<b> HDLM drive : </b><strong><a href="#HDLM drive"> dlnkmgr view -drv
</a></strong>' >> $Modu
echo '<b> HDLM path : </b><strong><a href="#HDLM path"> dlnkmgr view -path
</a></strong>' >> $Modu
echo '<b> HDLM hba : </b><strong><a href="#HDLM hba"> dlnkmgr view -hba
</a></strong>' >> $Modu
echo '<b> HDLM cha : </b><strong><a href="#HDLM cha"> dlnkmgr view -cha
</a></strong>' >> $Modu
echo '<b> HDLM Dynamic : </b><strong><a href="#HDLM Dynamic"> lslpp -Lc|grep
-i dyn </a></strong>' >> $Modu
panel='';fsp='';cec='';proc='';dimm='';disk='';rmt='';fcs='';ent='';raid='';lhea=''
cat $temp"jfp1" | read drawer
cat $temp"jfp3" | grep -wp $drawer > $temp"jfp11" ; echo '\c' >> $temp"jfp11"
cat $temp"jfp11" | grep -i panel > /dev/null
if [ $? = 0 ]
then
panel=' (presence of panel)'
fi
cat $temp"jfp11" | grep " FSP " | grep -vi nc > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
fsp=' ('$NbDevice' x FSP)'
fi
cat $temp"jfp11" | grep " PROC " > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
proc=' ('$NbDevice' x PROC)'
fi
cat $temp"jfp11" | grep " CEC:" > /dev/null
if [ $? = 0 ]
then
cec=' (CEC)'
fi
cat $temp"jfp11" | grep " DIMM" > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
dimm=' ('$NbDevice' x DIMM)'
fi
cat $temp"jfp4" > $temp"jfp5"
> $temp"jfp16"
for resource in $(cat $temp"jfp5")
do
lscfg -vl $resource > $temp"jfp6" 2>> /dev/null
if [ -s $temp"jfp6" ]
then
cat $temp"jfp6" | grep $drawer > /dev/null
if [ $? = 0 ]
then
cat $temp"jfp6" >> $temp"jfp16"
sed -e '/'$resource'/d' $temp"jfp5" > $temp"jfp7" ; cp
$temp"jfp7" $temp"jfp5"
fi
fi
done
cat $temp"jfp5" > $temp"jfp4"
device='';devicev=''
cat $temp"jfp16" | grep "disk" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x DISK )'
fi
fi
cat $temp"jfp16" | grep "disk" | grep -i virtual | grep -vi Target >
$temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual DISK )'
fi
fi
disk=$device$devicev
device='';devicev=''
cat $temp"jfp16" | grep " rmt" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x Tape )'
fi
fi
cat $temp"jfp16" | grep " rmt" | grep -i virtual > $temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual Tape )'
fi
fi
rmt=$device$devicev
device='';devicev=''
cat $temp"jfp16" | grep " fcs" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x Fiber )'
fi
fi
cat $temp"jfp16" | grep " fcs" | grep -i virtual > $temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual Fiber )'
fi
fi
fcs=$device$devicev
device='';devicev=''
cat $temp"jfp16" | grep " ent" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x Ethernet Adapter )'
fi
fi
cat $temp"jfp16" | grep " ent" | grep -i virtual > $temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual Ethernet Adapter )'
fi
fi
ent=$device$devicev
device='';devicev=''
cat $temp"jfp16" | grep "raid" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x Raid Adapter )'
fi
fi
cat $temp"jfp16" | grep "raid" | grep -i virtual > $temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual Raid Adapter )'
fi
fi
raid=$device$devicev
cat $temp"jfp16" | grep " lhea" | grep -vi virtual > $temp"jfpD00"
if [ $? = 0 ]
then
lhea=' (LHEA)'
fi
device='';devicev=''
cat $temp"jfp16" | grep -E "cd0|cd1|cd2|cd3|cd4|cd5" | grep -vi virtual >
$temp"jfpD00"
if [ $? = 0 ]
then
NbDevice=$(cat $temp"jfpD00" | wc -l)
if [ $NbDevice != 0 ]
then
device=' ('$NbDevice' x CD/DVD )'
fi
fi
cat $temp"jfp16" | grep -E "cd0|cd1|cd2|cd3|cd4|cd5" | grep -i virtual >
$temp"jfpD01"
if [ $? = 0 ]
then
NbDeviceV=$(cat $temp"jfpD01" | wc -l)
if [ $NbDeviceV != 0 ]
then
devicev=' ('$NbDeviceV' x Virtual CD/DVD )'
fi
fi
cd=$device$devicev
lspath -HF "name status path_id parent connection" | grep fscsi|sort -u >
$temp"jfp1"
if [ -s $temp"jfp1" ]
then
cat $temp"jfp1" | awk '{print$1}' | sort -u > $temp"jfp2"
cat $temp"jfp1" | awk '{print$4}' | sort -u > $temp"jfp5"
echo '<table cellpadding=2 cellspacing=0 rules=cols bgcolor=#d6d6d8>' >
$temp"jfp9"
#let nbfib=0
for fscsi in $(cat $temp"jfp5")
do
fcs=$(lsdev -Cl $(lsdev -Cl $fscsi -F parent) -F name)
lscfg -l $fcs |read xx Location description
lscfg -vl $fcs | grep -iE "(Z9)|FRU|Part Number|Customer Card ID
Number|Network Address" | tr " " "#" |tr '.' ' ' > $temp"jfp6"
part=$(cat $temp"jfp6" | grep Part#Number | awk '{print$2}'|tr "#" " ")
FRU=$(cat $temp"jfp6" | grep FRU | awk '{print$2}'|tr "#" " ")
cat $temp"jfp6" | grep '(Z9)' |read xx xxx Z99
Z9=$(echo $Z99|tr " " ".")
CCIN=$(cat $temp"jfp6" | grep Customer#Card#ID#Number | awk
'{print$2}'|tr "#" " ")
WWN=$(cat $temp"jfp6" | grep Network#Address | awk '{print$2}'|tr "#" "
")
lsdev -Cl $fcs | read xx status addr xx
coul="#FFFFFF"
echo '<tr><th style=background:#af7036 colspan=5 height="5"></th></tr>'
>> $temp"jfp9"
echo '<tr><td style=background:#faf6ce > </td><th
style=background:'$coul'>status</th><th style=background:'$coul'>adresse</th><th
style=background:'$coul'>location</th><th
style=background:'$coul'>description</th></tr>' >> $temp"jfp9"
coul="#faf6ce"
echo '<tr><td style=background:#faf6ce > '$fcs' </td><td
style=background:'$coul'>'$status'</td><td style=background:'$coul'>'$addr'</td><td
style=background:'$coul'>'$Location'</td><td
style=background:'$coul'>'$description'</td></tr>' >> $temp"jfp9"
coul="#FFFFFF"
echo '<tr><td style=background:#faf6ce > </td><th
style=background:'$coul'>Part Number</th><th style=background:'$coul'>FRU</th><th
style=background:'$coul'>Firmware</th><th style=background:'$coul'>CCIN</th><th
style=background:'$coul'>Network Address</th></tr>' >> $temp"jfp9"
coul="#f6fed0"
echo '<tr><td style=background:#faf6ce > </td><td
style=background:'$coul'>'$part'</td><td style=background:'$coul'>'$FRU'</td><td
style=background:'$coul'>'$Z9'</td><td style=background:'$coul'>'$CCIN'</td><td
style=background:'$coul'>'$WWN'</td></tr>' >> $temp"jfp9"
#((nbfib+=1))
lsattr -El $fcs -O > $temp"jfp7"
let col=0
cat $temp"jfp7" | while read ligne ; do
((col+=1)) ; coul="#f8f0b0"
echo $ligne > $temp"jfp8"
[[ $col = 1 ]] && coul="#FFFFFF"
[[ $col != 1 ]] && echo '<tr><td style=background:#faf6ce >
</td><td style=background:'$coul'>\c' >> $temp"jfp9"
[[ $col != 1 ]] && sed "s/:/<\/td><td style=background:$coul>/g"
$temp"jfp8" >> $temp"jfp9"
[[ $col != 1 ]] && echo "</td></tr>" >> $temp"jfp9"
[[ $col = 1 ]] && echo '<tr><th style=background:#faf6ce >
</th><th style=background:'$coul'>\c' >> $temp"jfp9"
[[ $col = 1 ]] && sed "s/:/<\/th><th style=background:$coul>/g"
$temp"jfp8" >> $temp"jfp9"
[[ $col = 1 ]] && echo "</th></tr>" >> $temp"jfp9"
done
echo '</table><table cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8>' >> $temp"jfp9"
lscfg -l $fscsi |read xx Location description
lsdev -Cl $fscsi | read xx status addr xx
coul="#FFFFFF"
echo '<tr><td style=background:#fcf9e0 > </td><th
style=background:'$coul'>status</th><th style=background:'$coul'>adresse</th><th
style=background:'$coul'>location</th><th
style=background:'$coul'>description</th></tr>' >> $temp"jfp9"
coul="#fcf9e0"
echo '<tr><td style=background:#fcf9e0 > '$fscsi' </td><td
style=background:'$coul'>'$status'</td><td style=background:'$coul'>'$addr'</td><td
style=background:'$coul'>'$Location'</td><td
style=background:'$coul'>'$description'</td></tr>' >> $temp"jfp9"
lsattr -El $fscsi -O > $temp"jfp7"
let col=0
cat $temp"jfp7" | while read ligne ; do
((col+=1)) ; coul="#f8f0b0"
echo $ligne > $temp"jfp8"
[[ $col = 1 ]] && coul="#ffffff"
done
echo '<tr><td style=background:#fcf1e6 height="5"></td><th
style=background:#af7036 colspan=7></th>' >> $temp"jfp9"
done
echo '</table>' >> $temp"jfp9"
cat $temp"jfp9" >> $Modu
if [ -s $tpvar"BusPci_"$busp"_"${lignp[$genpar]}"_"${colp[$genpar]}"_"$
{lignc[$genpar]}"_"${colc[$genpar]}"_"${parent[$genpar]} ]
then
let lignp[$genchil]=${lignc[$genpar]} ; let colp[$genchil]=${colc[$genpar]} ;
let lignc[$genchil]=1 ; let colc[$genchil]=${colc[$genpar]}+1
fi
}
ModHHH058() # Num�ro d execution
{
$debug
#yyyy ModHHH058 oui
typeset j=$1
typeset TitreModule version
TitreModule="Bus Architecture of machine"
version=" version 2012-1.2.2 date: 6/12/12"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH058"
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
typeset -i col
typeset -i genpar=1 retour=1 genchil=2
typeset -i lignp[0] colp[0] lignc[0] colc[0]
typeset -i tblign=1 tbcol=1 busp=1 nbrecul=0
typeset Dbus hardloc status dev macaddr
typeset -i tblignmax=0 tbcolmax=0
# --- Calcul du module
> $tpvar"entjfp5"
for en in $(lsdev -Cc if -F name | grep -v et | grep en)
do
>$tpvar"entjfp7"
entstat -d $en | grep -E "Hardware Address|ETHERNET STATISTICS" | sed
"s/ETHERNET STATISTICS/%/" | sed "s/ ://" | sed "s/Hardware Address://" | while
read ligne ; do
echo $ligne'' >>$tpvar"entjfp7"
done
nbligne=$(cat $tpvar"entjfp7" | wc -l)
if (( $nbligne >= 2 ))
then
cat $tpvar"entjfp7" | sed 's/%//g' | sed "/^$/d" | sed "s/)//g" | sed
"s/(//g" >>$tpvar"entjfp5"
fi
done
>$tpvar"entjfp3"
typeset -i basc=0
netstat -in|awk '{print $1}'|sort -u|egrep -v "Name|lo0" > $temp"jfpnetstatok"
for ligne in $(cat $tpvar"entjfp5")
do
if (( $basc == 0 ))
then
cat $temp"jfpnetstatok" | grep -w $ligne > $temp"jfpok"
if [ -s $temp"jfpok" ]
then
echo $ligne' \c' >>$tpvar"entjfp3" ; let basc=1 ; addip=$(netstat
-in|grep $ligne| egrep -v "link" | awk '{print $4}' | tr '\n' ';')
else
echo $ligne' \c' >>$tpvar"entjfp3" ; let basc=1 ; addip=""
fi
elif (( $basc == 1 ))
then
echo $ligne' \c' >>$tpvar"entjfp3" ; let basc=0 ; echo $addip
>>$tpvar"entjfp3"
fi
done
cat $tpvar"entjfp3" | grep -v ent > $tpvar"entjfp6"
> $tpvar"entjfp5"
for en in $(lsdev -Cc adapter -F name |grep ent)
do
>$tpvar"entjfp7"
entstat -d $en | grep -E "Hardware Address|ETHERNET STATISTICS" | sed
"s/ETHERNET STATISTICS/%/" | sed "s/ ://" | sed "s/Hardware Address://" | while
read ligne ; do
echo $ligne'' >>$tpvar"entjfp7"
done
nbligne=$(cat $tpvar"entjfp7" | wc -l)
if (( $nbligne >= 2 ))
then
cat $tpvar"entjfp7" | sed 's/%//g' | sed "/^$/d" | sed "s/)//g" | sed
"s/(//g" >>$tpvar"entjfp5"
fi
done
>$tpvar"entjfp4"
typeset -i basc=0
for ligne in $(cat $tpvar"entjfp5")
do
if (( $basc == 0 ))
then
echo $ligne' \c' >>$tpvar"entjfp4" ; let basc=1
elif (( $basc == 1 ))
then
echo $ligne >>$tpvar"entjfp4" ; let basc=0
fi
done
while (( $retour == 1 ))
do
if [ -s $tpvar"BusPci_"$busp"_"${lignp[$genpar]}"_"$
{colp[$genpar]}"_"${lignc[$genpar]}"_"${colc[$genpar]}"_"${parent[$genpar]} ]
then
parent[$genchil]=$(cat $tpvar"BusPci_"$busp"_"$
{lignp[$genpar]}"_"${colp[$genpar]}"_"${lignc[$genpar]}"_"${colc[$genpar]}"_"$
{parent[$genpar]})
cp $tpvar"BusPci_"$busp"_"${lignp[$genpar]}"_"$
{colp[$genpar]}"_"${lignc[$genpar]}"_"${colc[$genpar]}"_"${parent[$genpar]}
$tpvar"tbcase_"$tblign"_"$tbcol
RechChild ${parent[$genchil]} $busp ${lignp[$genchil]} $
{colp[$genchil]} ${lignc[$genchil]} ${colc[$genchil]} ${parent[$genchil]}
retour=$?
let nbrecul=0
else
retour=0
fi
if [ $retour = 1 ]
then
((tbcol+=1))
let nbrecul=0
(( $tbcolmax < $tbcol )) && let tbcolmax=tbcol
((genchil+=1))
((genpar+=1))
let lignp[$genchil]=${lignc[$genpar]} ; let
colp[$genchil]=${colc[$genpar]} ; let lignc[$genchil]=1 ; let colc[$genchil]=$
{colc[$genpar]}+1
else
if [[ $genpar > 0 ]]
then
((lignc[$genpar]+=1))
if [ -s $tpvar"BusPci_"$busp"_"${lignp[$genpar]}"_"$
{colp[$genpar]}"_"${lignc[$genpar]}"_"${colc[$genpar]}"_"${parent[$genpar]} ]
then
let lignp[$genchil]=${lignc[$genpar]} ; let
colp[$genchil]=${colc[$genpar]} ; let lignc[$genchil]=1 ; let colc[$genchil]=$
{colc[$genpar]}+1
((tblign+=1))
else
recul $genpar $genchil
((tbcol-=1))
((nbrecul+=1))
(( $nbrecul <= 1 )) && ((tblign+=1))
fi
let retour=1
else
let retour=0
fi
fi
done
let genpar=1 ; let genchil=2 ; let retour=1 ; ((tblign+=1)) ; let tbcol=1
((busp+=1))
done
let tblignmax=$tblign-2
typeset -i tblign=1 tbcol=1
echo '<TABLE cellpadding=1 cellspacing=1 border=1 bgcolor=#becddb>' > $Modu
while (( $tblign <= $tblignmax ))
do
echo '<tr>' >> $Modu
while (( $tbcol <= $tbcolmax ))
do
if [ -s $tpvar"tbcase_"$tblign"_"$tbcol ]
then
dev=$(cat $tpvar"tbcase_"$tblign"_"$tbcol)
IDbus=$(lsattr -El $dev | grep "bus_id" | awk '{print$2}')
hardloc=$(lscfg -l $dev | awk '{print$2}')
status=$(lsdev -l $dev -F "status" | sed "s/Defined/<strong
class=\"alert\">Defined<\/strong>/")
volG=$(lspv | grep -w $dev |awk '{print$3 ,$4}')
macaddr=$(cat $tpvar"entjfp4" | grep -w $dev | awk '{print$2}')
macaddrip=$(cat $tpvar"entjfp6" | grep -w $dev | awk '{print$2}')
ipaddr=$(cat $tpvar"entjfp6" | grep -w $dev | awk '{print$3}' |
tr ';' ' ')
echo '<td style=background:#FFFFED title="'$(lsdev -Cl $dev |
while read lligne ; do echo $lligne"
 \c" ; done ; lscfg -vl $dev | while
read lligne ; do echo $lligne"
 \c" ; done ; lsattr -El $dev | while read
lligne ; do echo $lligne"
 \c" ; done)'"><b> '$(echo $dev ; echo ' </b>
'$status ; [[ $IDbus != "" ]] && echo "("$IDbus")\c" ; [[ $volG != "" ]] && echo
"<b> (VG: "$volG") </b>\c" ; [[ $macaddr != "" ]] && echo "<b> "$macaddr" </b>\c" ;
[[ $macaddrip != "" ]] && echo "<b> "$macaddrip" </b>\c" ; [[ $ipaddr != "" ]] &&
echo "<b> ("$ipaddr") </b>\c" ; [[ $hardloc != "" ]] && echo
"
("$hardloc")")'</td>' >> $Modu
else
echo '<td style=background:#FFFFFF></td>' >> $Modu
fi
((tbcol+=1))
done
echo '</tr>' >> $Modu
let tbcol=1
((tblign+=1))
done
echo '</tr></table>' >> $Modu
rm -f $tpvar"BusPci_"*
rm -f $tpvar"tbcase_"*
rm -f $tpvar"entjfp"*
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH059() # Num�ro d execution
{
$debug
#yyyy ModHHH059 oui
typeset j=$1
typeset TitreModule version
TitreModule="Managed by HMC"
version=" version 2013-1.4.6 date: 21/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH059"
typeset -i num=1
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsrsrc IBM.MCP | grep IPAddresses > $temp"jfp1" &
pid=$!
sleep 2
kill -0 $pid 1>$temp"0" 2>$temp"0"
if [ $? = '0' ]
then
sleep 30
kill -0 $pid 1>$temp"0" 2>$temp"0"
[ $? = '0' ] && (kill -9 $pid ; echo "--- kill lsrsrc IBM.MCP | grep
IPAddresses after time out of command ---" >> $Modu ; echo 'module HHH059, kill
after time out command: lsrsrc IBM.MCP | grep IPAddresses' >> $tpsort"KILL9" )
fi
if [ -s $temp"jfp1" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrsrc_IBM_MCP''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lsrsrc IBM.MCP \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lsrsrc_IBM_MCP" style="display: none;">' >> $Modu
lsrsrc IBM.MCP >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrsrc_IBM_MCP''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrsrc_IBM_ManagementServer''\''));"
style="cursor: pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lsrsrc IBM.ManagementServer \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lsrsrc_IBM_ManagementServer" style="display: none;">' >>
$Modu
lsrsrc IBM.ManagementServer >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrsrc_IBM_ManagementServer''\''));"
style="cursor: pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
let num=1
echo '<a href="#'${SignetS[$NumNum+1000]}'" title="Go to 1.'$j'
'$TitreModule'"><strong class="alert0"> Managed by HMC : </strong></a>\c' >> $Resu
for ligne in $(cat $temp"jfp1" | tr ' ",' '% ' | awk '{print $2,$3}'| tr ' '
'/' | sed "s/\//\//" | sed "s/\/}/ /")
do
echo ' HMC '$num' : <strong><span id="db-ipHMC"> '$ligne'
</span></strong> \c' >> $Resu
((num+=1))
done
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|
degraded|Definved" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong
class=\"alert\">Failed<\/strong>/g; s/failed/<strong
class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong
class=\"alert\">faulted<\/strong>/g; s/Faulted/<strong
class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong
class=\"alert\">missing<\/strong>/g; s/Missing/<strong
class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong
class=\"alert\">stale<\/strong>/g; s/Stale/<strong
class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong
class=\"alert\">unknown<\/strong>/g; s/Unknown/<strong
class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong
class=\"alert\">degraded<\/strong>/g; s/Degraded/<strong
class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/Definved/<strong
class=\"alert\">Definved<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
rm -f $tpvar"BusPci_"*
rm -f $tpvar"tbcase_"*
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
done
echo '<tr><td style=background:#fcf1e6 height="5"></td><th
style=background:#af7036 colspan=7></th>' >> $temp"jfp9"
done
echo '</table>' >> $temp"jfp9"
cat $temp"jfp9" >> $Modu
rm -f $tpvar"BusPci_"*
rm -f $tpvar"tbcase_"*
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
calculcouleur()
{
typeset -i coul1=252
typeset -i coul2=249
typeset -i coul3=224
typeset -i incr=16
typeset -i Nbcouleur=90
typeset -i coul=1
valcoul[$coul]='#'$(echo 'obase=16 ; ibase=10 ; '$coul1''| bc)$(echo 'obase=16 ;
ibase=10 ; '$coul2''| bc)$(echo 'obase=16 ; ibase=10 ; '$coul3''| bc)
while (( $coul < $Nbcouleur ))
do
((coul+=1))
((coul3-=incr));((coul2-=incr));((coul1-=incr));let coul3=${coul3#-};let
coul1=${coul1#-};let coul2=${coul2#-}
valcoul[$coul]='#'$(echo 'obase=16 ; ibase=10 ; '$coul1''| bc)$(echo
'obase=16 ; ibase=10 ; '$coul2''| bc)$(echo 'obase=16 ; ibase=10 ; '$coul3''| bc)
if (( $coul == 6 ))
then
let coul1=225
let coul2=251
let coul3=239
elif (( $coul == 12 ))
then
let coul1=225
let coul2=242
let coul3=251
elif (( $coul == 18 ))
then
let coul1=255
let coul2=212
let coul3=177
elif (( $coul == 24 ))
then
let coul1=254
let coul2=249
let coul3=178
elif (( $coul == 30 ))
then
let coul1=193
let coul2=253
let coul3=179
elif (( $coul == 36 ))
then
let coul1=180
let coul2=252
let coul3=223
elif (( $coul == 42 ))
then
let coul1=179
let coul2=242
let coul3=253
elif (( $coul == 48 ))
then
let coul1=177
let coul2=218
let coul3=255
elif (( $coul == 54 ))
then
let coul1=185
let coul2=178
let coul3=254
elif (( $coul == 60 ))
then
let coul1=244
let coul2=177
let coul3=255
elif (( $coul == 66 ))
then
let coul1=254
let coul2=178
let coul3=220
fi
done
}
ModHHH061() # Num�ro d execution
{
$debug
#yyyy ModHHH061 oui
typeset j=$1
typeset TitreModule version
TitreModule="HARD memory list"
version=" version 2013-1.4.2 date 20/08/2013"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH061"
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
typeset Adapterdesc[] FRU[] SerialNumber[] ccin[] sizem[] location1[] location2[]
location3[] location4[] location5[] location6[]
lscfg -vp | grep -ip "Size" | tr ' ' '%' > $temp"jfplscfg"
if [ -s $temp"jfplscfg" ]
then
calculcouleur
> $temp"LocPosSize"
> $temp"LocPosFRU"
> $temp"LocPosMem"
lsdev -S A -Cc disk -F name,description | grep -i scsi| tr ' ' '%' | tr ',' ' ' |
awk '{print$1}' > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"typeM""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc disk -F name,description | grep -i scsi | tr ' ' '%' | tr ',' ' ' >
$temp"listeadapt"
lsdev -S A -Cc pdisk -F name,description | grep -i scsi | tr ' ' '%' | tr ',' ' '
>> $temp"listeadapt"
typeset -i numtotligne numligne1 numtotligne2 numligne2 numligne
let numligne1=0
let numligne=0
let numligne2=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
VgAssos[$numligne]=$(lspv | grep -w ${NomAdapter[$numligne]} | awk
'{print$3}') ; echo ${VgAssos[$numligne]} > $temp"jfp0" ; VgAssos[$numligne]=$(cat
$temp"jfp0") ; if [ "${VgAssos[$numligne]}" = '' ] ; then VgAssos[$numligne]='none'
; fi
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Part%Number | awk '{print$2}' | sed 's/^[\.\t]//g' | tr
'%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0")
; if [ "${FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Z3 | awk '{print$2}' | tr '%' ' ') ; echo $
{FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0") ; if [ "$
{FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" != 'none' ]
then
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number"
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} >
$temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ]
; then ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "$
{ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
typeM[$numligne]=$(cat $temp"adapter" | grep -i Machine%Type%and%Model
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${typeM[$numligne]} >
$temp"jfp0" ; typeM[$numligne]=$(cat $temp"jfp0") ; if [ "${typeM[$numligne]}" = ''
] ; then typeM[$numligne]='none' ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} >
$temp"jfp0" ; Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "$
{Manufacturer[$numligne]}" = '' ] ; then Manufacturer[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i "ROS%Level" | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} >
$temp"jfp0" ; Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ]
; then Firm[$numligne]='none' ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr VgAssos ccin typeM Manufacturer Firm
location1 location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
for typeinfo in FRU2 NomAdapter2 locaddr2 VgAssos2 ccin2 typeM2 Manufacturer2 Firm2
location12 location22 location32
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-scsidisk"><tr><td>SCSI Disk :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{typeM[$numligne]}'</td><td>'${SerialNumber[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'${Adapterdesc[$numligne]}'</td><td>'$
{VgAssos[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SCSI Disk with FRU </th>' >>
$Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>SCSI Disk :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${typeM2[$numligne]}'</td><td>'$
{SerialNumber2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})$([[ ${location52[$numligne]} != 'none' ]] && echo '-'$
{location52[$numligne]})$([[ ${location62[$numligne]} != 'none' ]] && echo '-'$
{location62[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td><td>'$
{VgAssos2[$numligne]}'</td></tr>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SCSI Disk without FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
lsdev -S A -Cc disk -F name,description | grep -i sas| tr ' ' '%' | tr ',' ' ' |
awk '{print$1}' > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"typeM""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc disk -F name,description | grep -i sas | tr ' ' '%' | tr ',' ' ' >
$temp"listeadapt"
lsdev -S A -Cc pdisk -F name,description | grep -i sas | tr ' ' '%' | tr ',' ' ' >>
$temp"listeadapt"
typeset -i numtotligne numligne1 numtotligne2 numligne2 numligne
let numligne1=0
let numligne=0
let numligne2=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
VgAssos[$numligne]=$(lspv | grep -w ${NomAdapter[$numligne]} | awk
'{print$3}') ; echo ${VgAssos[$numligne]} > $temp"jfp0" ; VgAssos[$numligne]=$(cat
$temp"jfp0") ; if [ "${VgAssos[$numligne]}" = '' ] ; then VgAssos[$numligne]='none'
; fi
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Part%Number | awk '{print$2}' | sed 's/^[\.\t]//g' | tr
'%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0")
; if [ "${FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Z3 | awk '{print$2}' | tr '%' ' ') ; echo $
{FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0") ; if [ "$
{FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" != 'none' ]
then
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number"
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} >
$temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ]
; then ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%' '
') ; echo ${ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ;
if [ "${ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "$
{ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
typeM[$numligne]=$(cat $temp"adapter" | grep -i Machine%Type%and%Model
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${typeM[$numligne]} >
$temp"jfp0" ; typeM[$numligne]=$(cat $temp"jfp0") ; if [ "${typeM[$numligne]}" = ''
] ; then typeM[$numligne]='none' ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} >
$temp"jfp0" ; Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "$
{Manufacturer[$numligne]}" = '' ] ; then Manufacturer[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i alterable | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} >
$temp"jfp0" ; Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ]
; then Firm[$numligne]='none' ; fi
if [ "${Firm[$numligne]}" = 'none' ] ; then Firm[$numligne]=$(cat
$temp"adapter" | grep -i "ROS%Level" | awk '{print$2}' | tr '%' ' ' | sed
's/^[\.\t]//g') ; echo ${Firm[$numligne]} > $temp"jfp0" ; Firm[$numligne]=$(cat
$temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ] ; then Firm[$numligne]='none' ;
fi ; fi
if [ "${Firm[$numligne]}" = 'none' ] ; then Firm[$numligne]=$(cat
$temp"adapter" | grep -i "Loadable%Microcode%Level" | awk '{print$2}' | tr '%' ' '
| sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} > $temp"jfp0" ; Firm[$numligne]=$
(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ] ; then
Firm[$numligne]='none' ; fi ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; echo $
{location1[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location1[$numligne]=$
(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; echo $
{location2[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location2[$numligne]=$
(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; echo $
{location3[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location3[$numligne]=$
(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; echo $
{location4[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location4[$numligne]=$
(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; echo $
{location5[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location5[$numligne]=$
(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; echo $
{location6[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location6[$numligne]=$
(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
if [ "${location1[$numligne]}" = 'none' ]
then
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
fi
echo ${NomAdapter[$numligne]} >> $temp"NomAdapter""11"
echo ${locaddr[$numligne]} >> $temp"locaddr""11"
echo ${Adapterdesc[$numligne]} >> $temp"Adapterdesc""11"
echo ${VgAssos[$numligne]} >> $temp"VgAssos""11"
echo ${typeM[$numligne]} >> $temp"typeM""11"
echo ${SerialNumber[$numligne]} >> $temp"SerialNumber""11"
echo ${ccin[$numligne]} >> $temp"ccin""11"
echo ${Manufacturer[$numligne]} >> $temp"Manufacturer""11"
echo ${FRU[$numligne]} >> $temp"FRU""11"
echo ${Firm[$numligne]} >> $temp"Firm""11"
echo ${location1[$numligne]} >> $temp"location1""11"
echo ${location2[$numligne]} >> $temp"location2""11"
echo ${location3[$numligne]} >> $temp"location3""11"
else
((numligne2+=1))
NomAdapter2[$numligne2]="${NomAdapter[$numligne]}"
Adapterdesc2[$numligne2]="${Adapterdesc[$numligne]}"
locaddr2[$numligne2]="${locaddr[$numligne]}"
VgAssos2[$numligne2]="${VgAssos[$numligne]}"
FRU2[$numligne2]="none"
SerialNumber2[$numligne2]=$(cat $temp"adapter" | grep -i "Serial
%Number" | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{SerialNumber2[$numligne2]} > $temp"jfp0" ; SerialNumber2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${SerialNumber2[$numligne2]}" = '' ] ; then
SerialNumber2[$numligne2]='none' ; fi
ccin2[$numligne2]=$(cat $temp"adapter" | grep -i Customer%Card%ID
%Number | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin2[$numligne2]} >
$temp"jfp0" ; ccin2[$numligne2]=$(cat $temp"jfp0") ; if [ "${ccin2[$numligne2]}" =
'' ] ; then ccin2[$numligne2]='none' ; fi
if [ "${ccin2[$numligne2]}" = 'none' ] ; then ccin2[$numligne2]=$
(cat $temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin2[$numligne2]} > $temp"jfp0" ; ccin2[$numligne2]=$(cat $temp"jfp0") ; if [ "$
{ccin2[$numligne2]}" = '' ] ; then ccin2[$numligne2]='none' ; fi ; fi
if [ "${ccin2[$numligne2]}" = 'none' ] ; then ccin2[$numligne2]=$
(cat $temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%'
' ') ; echo ${ccin2[$numligne2]} > $temp"jfp0" ; ccin2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${ccin2[$numligne2]}" = '' ] ; then ccin2[$numligne2]='none' ;
fi ; fi
if (( $(echo "${ccin2[$numligne2]}" | wc -c) > 5 )) ; then
ccin2[$numligne2]="none" ; fi
typeM2[$numligne2]=$(cat $temp"adapter" | grep -i Machine%Type
%and%Model | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{typeM2[$numligne2]} > $temp"jfp0" ; typeM2[$numligne2]=$(cat $temp"jfp0") ; if
[ "${typeM2[$numligne2]}" = '' ] ; then typeM2[$numligne2]='none' ; fi
Manufacturer2[$numligne2]=$(cat $temp"adapter" | grep -i
Manufacture | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{Manufacturer2[$numligne2]} > $temp"jfp0" ; Manufacturer2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${Manufacturer2[$numligne2]}" = '' ] ; then
Manufacturer2[$numligne2]='none' ; fi
Firm2[$numligne2]=$(cat $temp"adapter" | grep -i alterable | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm2[$numligne2]} >
$temp"jfp0" ; Firm2[$numligne2]=$(cat $temp"jfp0") ; if [ "${Firm2[$numligne2]}" =
'' ] ; then Firm2[$numligne2]='none' ; fi
if [ "${Firm2[$numligne2]}" = 'none' ] ; then Firm2[$numligne2]=$
(cat $temp"adapter" | grep -i "Loadable%Microcode%Level" | awk '{print$2}' | tr '%'
' ' | sed 's/^[\.\t]//g') ; echo ${Firm2[$numligne2]} > $temp"jfp0" ;
Firm2[$numligne2]=$(cat $temp"jfp0") ; if [ "${Firm2[$numligne2]}" = '' ] ; then
Firm2[$numligne2]='none' ; fi ; fi
location12[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; if [ "$
{location12[$numligne2]}" = '' ] ; then location12[$numligne2]='none' ; fi
location22[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; if [ "$
{location22[$numligne2]}" = '' ] ; then location22[$numligne2]='none' ; fi
location32[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; if [ "$
{location32[$numligne2]}" = '' ] ; then location32[$numligne2]='none' ; fi
location42[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; if [ "$
{location42[$numligne2]}" = '' ] ; then location42[$numligne2]='none' ; fi
location52[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; if [ "$
{location52[$numligne2]}" = '' ] ; then location52[$numligne2]='none' ; fi
location62[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; if [ "$
{location62[$numligne2]}" = '' ] ; then location62[$numligne2]='none' ; fi
if [ "${location12[$numligne2]}" = 'none' ]
then
location12[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location12[$numligne2]}" = '' ] ; then
location12[$numligne2]='none' ; fi
location22[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location22[$numligne2]}" = '' ] ; then
location22[$numligne2]='none' ; fi
location32[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location32[$numligne2]}" = '' ] ; then
location32[$numligne2]='none' ; fi
location42[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location42[$numligne2]}" = '' ] ; then
location42[$numligne2]='none' ; fi
location52[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location52[$numligne2]}" = '' ] ; then
location52[$numligne2]='none' ; fi
location62[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location62[$numligne2]}" = '' ] ; then
location62[$numligne2]='none' ; fi
fi
if (( $numligne > 0 )) ; then ((numligne-=1)); fi
echo ${NomAdapter2[$numligne2]} >> $temp"NomAdapter2""11"
echo ${locaddr2[$numligne2]} >> $temp"locaddr2""11"
echo ${Adapterdesc2[$numligne2]} >> $temp"Adapterdesc2""11"
echo ${VgAssos2[$numligne2]} >> $temp"VgAssos2""11"
echo ${typeM2[$numligne2]} >> $temp"typeM2""11"
echo ${SerialNumber2[$numligne2]} >> $temp"SerialNumber2""11"
echo ${ccin2[$numligne2]} >> $temp"ccin2""11"
echo ${Manufacturer2[$numligne2]} >> $temp"Manufacturer2""11"
echo ${FRU2[$numligne2]} >> $temp"FRU2""11"
echo ${Firm2[$numligne2]} >> $temp"Firm2""11"
echo ${location12[$numligne2]} >> $temp"location12""11"
echo ${location22[$numligne2]} >> $temp"location22""11"
echo ${location32[$numligne2]} >> $temp"location32""11"
if [ "${NomAdapter2[$numligne2]}" = '' ] ; then if (( $numligne2
> 0 )) ; then ((numligne2-=1)); fi ; fi
fi
done
let numtotligne=$numligne
let numtotligne2=$numligne2
cat $temp"NomAdapter""11" | sort -u > $temp"NomAdapter""1"
cat $temp"locaddr""11" | sort -u > $temp"locaddr""1"
cat $temp"Adapterdesc""11" | sort -u > $temp"Adapterdesc""1"
cat $temp"VgAssos""11" | sort -u > $temp"VgAssos""1"
cat $temp"typeM""11" | sort -u > $temp"typeM""1"
cat $temp"SerialNumber""11" | sort -u > $temp"SerialNumber""1"
cat $temp"ccin""11" | sort -u > $temp"ccin""1"
cat $temp"Manufacturer""11" | sort -u > $temp"Manufacturer""1"
cat $temp"FRU""11" | sort -u > $temp"FRU""1"
cat $temp"Firm""11" | sort -u > $temp"Firm""1"
cat $temp"location1""11" | sort -u > $temp"location1""1"
cat $temp"location2""11" | sort -u > $temp"location2""1"
cat $temp"location3""11" | sort -u > $temp"location3""1"
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr VgAssos ccin typeM Manufacturer Firm
location1 location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
for typeinfo in FRU2 NomAdapter2 locaddr2 VgAssos2 ccin2 typeM2 Manufacturer2 Firm2
location12 location22 location32
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-sasdisk"><tr><td>SAS Disk :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{typeM[$numligne]}'</td><td>'${SerialNumber[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})'</span></td><td>'${Adapterdesc[$numligne]}'</td><td>'$
{VgAssos[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SAS Disk with FRU </th>' >>
$Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>SAS Disk :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${typeM2[$numligne]}'</td><td>'$
{SerialNumber2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td><td>'$
{VgAssos2[$numligne]}'</td></tr>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SAS Disk without FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModHHH064() # Num�ro d execution
{
$debug
#yyyy ModHHH064 oui "HARD Available SSA DISK"
typeset j=$1
typeset TitreModule version
TitreModule="HARD Available SSA DISK"
version=" version 2013-1.4.2 date: 24/09/2013"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH064"
typeset ligne
filtre='disk'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
typeset NomAdapter[] Adapterdesc[] locaddr[] VgAssos[] typeM[] FRU[] SerialNumber[]
ccin[] sizem[] location1[] location2[] location3[] location4[] location5[]
location6[] Manufacturer[] Firm[] NetAddr[]
lsdev -S A -Cc disk -F name,description | grep -v siss | grep -i ssa| tr ' ' '%' |
tr ',' ' ' | awk '{print$1}' > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"typeM""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc disk -F name,description | grep -vi "virtual" | grep -v siss | grep
-i ssa | tr ' ' '%' | tr ',' ' ' > $temp"listeadapt"
lsdev -S A -Cc pdisk -F name,description | grep -vi "virtual" | grep -v siss | grep
-i ssa | tr ' ' '%' | tr ',' ' ' >> $temp"listeadapt"
typeset -i numtotligne numligne1 numtotligne2 numligne2 numligne
let numligne1=0
let numligne=0
let numligne2=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
VgAssos[$numligne]=$(lspv | grep -w ${NomAdapter[$numligne]} | awk
'{print$3}') ; echo ${VgAssos[$numligne]} > $temp"jfp0" ; VgAssos[$numligne]=$(cat
$temp"jfp0") ; if [ "${VgAssos[$numligne]}" = '' ] ; then VgAssos[$numligne]='none'
; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Part%Number | awk '{print$2}' | sed 's/^[\.\t]//g' | tr
'%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0")
; if [ "${FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Z3 | awk '{print$2}' | tr '%' ' ') ; echo $
{FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0") ; if [ "$
{FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" != 'none' ]
then
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number"
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} >
$temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ]
; then ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "$
{ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
typeM[$numligne]=$(cat $temp"adapter" | grep -i Machine%Type%and%Model
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${typeM[$numligne]} >
$temp"jfp0" ; typeM[$numligne]=$(cat $temp"jfp0") ; if [ "${typeM[$numligne]}" = ''
] ; then typeM[$numligne]='none' ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} >
$temp"jfp0" ; Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "$
{Manufacturer[$numligne]}" = '' ] ; then Manufacturer[$numligne]='none' ; fi
#NetAddr[$numligne]=$(cat $temp"adapter" | grep -i Network%Address | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${NetAddr[$numligne]} >
$temp"jfp0" ; NetAddr[$numligne]=$(cat $temp"jfp0") ; if [ "${NetAddr[$numligne]}"
= '' ] ; then NetAddr[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i "ROS%Level" | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} >
$temp"jfp0" ; Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ]
; then Firm[$numligne]='none' ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in FRU NomAdapter locaddr VgAssos typeM Manufacturer Firm location1
location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
for typeinfo in FRU2 Nom2 locaddr2 VgAssos2 typeM2 Manufacturer2 Firm2 location12
location22 location32
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-ssadisk"><tr><td>SSA Disk :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{typeM[$numligne]}'</td><td>'${SerialNumber[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})'</span></td><td>'${Adapterdesc[$numligne]}'</td><td>'$
{VgAssos[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SSA Disk with FRU </th>' >>
$Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>SSA Disk :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${typeM2[$numligne]}'</td><td>'$
{SerialNumber2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td><td>'$
{VgAssos2[$numligne]}'</td></tr>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SSA Disk without FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>TypeMod
el</th><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th><th>VG associated</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
lsdev -S A -Cc adapter -F name,description | grep -i sas| tr ' ' '%' | tr ',' ' ' |
awk '{print$1}' > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
> $temp"NomAdapter"
> $temp"Adapterdesc""1"
> $temp"SerialNumber""1"
> $temp"ccin""1"
> $temp"Manufacturer""1"
> $temp"FRU""1"
> $temp"NetAddr""1"
> $temp"Firm""1"
> $temp"location1""1"
> $temp"location2""1"
> $temp"location3""1"
lsdev -S A -Cc adapter -F name,description | grep -i sas | tr ' ' '%' | tr ',' ' '
> $temp"listeadapt"
typeset -i numtotligne numligne1 numtotligne2 numligne2 numligne
let numligne1=0
let numligne=0
let numligne2=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Part%Number | awk '{print$2}' | sed 's/^[\.\t]//g' | tr
'%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0")
; if [ "${FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" = 'none' ] ; then FRU[$numligne]=$(cat
$temp"adapter" | grep -i Z3 | awk '{print$2}' | tr '%' ' ') ; echo $
{FRU[$numligne]} > $temp"jfp0" ; FRU[$numligne]=$(cat $temp"jfp0") ; if [ "$
{FRU[$numligne]}" = '' ] ; then FRU[$numligne]='none' ; fi ; fi
if [ "${FRU[$numligne]}" != 'none' ]
then
SerialNumber[$numligne]=$(cat $temp"adapter" | grep -i "Serial%Number"
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${SerialNumber[$numligne]} >
$temp"jfp0" ; SerialNumber[$numligne]=$(cat $temp"jfp0") ; if [ "$
{SerialNumber[$numligne]}" = '' ] ; then SerialNumber[$numligne]='none' ; fi
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} >
$temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ]
; then ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%' '
') ; echo ${ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ;
if [ "${ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "$
{ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} >
$temp"jfp0" ; Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "$
{Manufacturer[$numligne]}" = '' ] ; then Manufacturer[$numligne]='none' ; fi
NetAddr[$numligne]=$(cat $temp"adapter" | grep -i Network%Address | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${NetAddr[$numligne]} >
$temp"jfp0" ; NetAddr[$numligne]=$(cat $temp"jfp0") ; if [ "${NetAddr[$numligne]}"
= '' ] ; then NetAddr[$numligne]='none' ; fi
typeM[$numligne]=$(cat $temp"adapter" | grep -i Machine%Type%and%Model
| tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${typeM[$numligne]} >
$temp"jfp0" ; typeM[$numligne]=$(cat $temp"jfp0") ; if [ "${typeM[$numligne]}" = ''
] ; then typeM[$numligne]='none' ; fi
Firm[$numligne]=$(cat $temp"adapter" | grep -i alterable | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} >
$temp"jfp0" ; Firm[$numligne]=$(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ]
; then Firm[$numligne]='none' ; fi
if [ "${Firm[$numligne]}" = 'none' ] ; then Firm[$numligne]=$(cat
$temp"adapter" | grep -i "Loadable%Microcode%Level" | awk '{print$2}' | tr '%' ' '
| sed 's/^[\.\t]//g') ; echo ${Firm[$numligne]} > $temp"jfp0" ; Firm[$numligne]=$
(cat $temp"jfp0") ; if [ "${Firm[$numligne]}" = '' ] ; then
Firm[$numligne]='none' ; fi ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; echo $
{location1[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location1[$numligne]=$
(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; echo $
{location2[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location2[$numligne]=$
(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; echo $
{location3[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location3[$numligne]=$
(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; echo $
{location4[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location4[$numligne]=$
(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; echo $
{location5[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location5[$numligne]=$
(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; echo $
{location6[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location6[$numligne]=$
(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
if [ "${location1[$numligne]}" = 'none' ]
then
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
fi
echo ${NomAdapter[$numligne]} >> $temp"NomAdapter""11"
echo ${locaddr[$numligne]} >> $temp"locaddr""11"
echo ${Adapterdesc[$numligne]} >> $temp"Adapterdesc""11"
echo ${typeM[$numligne]} >> $temp"typeM""11"
echo ${SerialNumber[$numligne]} >> $temp"SerialNumber""11"
echo ${ccin[$numligne]} >> $temp"ccin""11"
echo ${Manufacturer[$numligne]} >> $temp"Manufacturer""11"
echo ${FRU[$numligne]} >> $temp"FRU""11"
echo ${NetAddr[$numligne]} >> $temp"NetAddr""11"
echo ${Firm[$numligne]} >> $temp"Firm""11"
echo ${location1[$numligne]} >> $temp"location1""11"
echo ${location2[$numligne]} >> $temp"location2""11"
echo ${location3[$numligne]} >> $temp"location3""11"
else
((numligne2+=1))
NomAdapter2[$numligne2]="${NomAdapter[$numligne]}"
Adapterdesc2[$numligne2]="${Adapterdesc[$numligne]}"
locaddr2[$numligne2]="${locaddr[$numligne]}"
FRU2[$numligne2]="none"
SerialNumber2[$numligne2]=$(cat $temp"adapter" | grep -i "Serial
%Number" | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{SerialNumber2[$numligne2]} > $temp"jfp0" ; SerialNumber2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${SerialNumber2[$numligne2]}" = '' ] ; then
SerialNumber2[$numligne2]='none' ; fi
ccin2[$numligne2]=$(cat $temp"adapter" | grep -i Customer%Card%ID
%Number | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin2[$numligne2]} >
$temp"jfp0" ; ccin2[$numligne2]=$(cat $temp"jfp0") ; if [ "${ccin2[$numligne2]}" =
'' ] ; then ccin2[$numligne2]='none' ; fi
if [ "${ccin2[$numligne2]}" = 'none' ] ; then ccin2[$numligne2]=$
(cat $temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%'
' ') ; echo ${ccin2[$numligne2]} > $temp"jfp0" ; ccin2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${ccin2[$numligne2]}" = '' ] ; then ccin2[$numligne2]='none' ;
fi ; fi
if [ "${ccin2[$numligne2]}" = 'none' ] ; then ccin2[$numligne2]=$
(cat $temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin2[$numligne2]} > $temp"jfp0" ; ccin2[$numligne2]=$(cat $temp"jfp0") ; if [ "$
{ccin2[$numligne2]}" = '' ] ; then ccin2[$numligne2]='none' ; fi ; fi
if (( $(echo "${ccin2[$numligne2]}" | wc -c) > 5 )) ; then
ccin2[$numligne2]="none" ; fi
typeM2[$numligne2]=$(cat $temp"adapter" | grep -i Machine%Type
%and%Model | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{typeM2[$numligne2]} > $temp"jfp0" ; typeM2[$numligne2]=$(cat $temp"jfp0") ; if
[ "${typeM2[$numligne2]}" = '' ] ; then typeM2[$numligne2]='none' ; fi
Manufacturer2[$numligne2]=$(cat $temp"adapter" | grep -i
Manufacture | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{Manufacturer2[$numligne2]} > $temp"jfp0" ; Manufacturer2[$numligne2]=$(cat
$temp"jfp0") ; if [ "${Manufacturer2[$numligne2]}" = '' ] ; then
Manufacturer2[$numligne2]='none' ; fi
NetAddr2[$numligne2]=$(cat $temp"adapter" | grep -i Network
%Address | tr '.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo $
{NetAddr2[$numligne2]} > $temp"jfp0" ; NetAddr2[$numligne2]=$(cat $temp"jfp0") ; if
[ "${NetAddr2[$numligne2]}" = '' ] ; then NetAddr2[$numligne2]='none' ; fi
Firm2[$numligne2]=$(cat $temp"adapter" | grep -i alterable | awk
'{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g') ; echo ${Firm2[$numligne2]} >
$temp"jfp0" ; Firm2[$numligne2]=$(cat $temp"jfp0") ; if [ "${Firm2[$numligne2]}" =
'' ] ; then Firm2[$numligne2]='none' ; fi
if [ "${Firm2[$numligne2]}" = 'none' ] ; then Firm2[$numligne2]=$
(cat $temp"adapter" | grep -i "Loadable%Microcode%Level" | awk '{print$2}' | tr '%'
' ' | sed 's/^[\.\t]//g') ; echo ${Firm2[$numligne2]} > $temp"jfp0" ;
Firm2[$numligne2]=$(cat $temp"jfp0") ; if [ "${Firm2[$numligne2]}" = '' ] ; then
Firm2[$numligne2]='none' ; fi ; fi
location12[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; if [ "$
{location12[$numligne2]}" = '' ] ; then location12[$numligne2]='none' ; fi
location22[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; if [ "$
{location22[$numligne2]}" = '' ] ; then location22[$numligne2]='none' ; fi
location32[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; if [ "$
{location32[$numligne2]}" = '' ] ; then location32[$numligne2]='none' ; fi
location42[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; if [ "$
{location42[$numligne2]}" = '' ] ; then location42[$numligne2]='none' ; fi
location52[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; if [ "$
{location52[$numligne2]}" = '' ] ; then location52[$numligne2]='none' ; fi
location62[$numligne2]=$(cat $temp"adapter" | grep -i Location |
awk '{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; if [ "$
{location62[$numligne2]}" = '' ] ; then location62[$numligne2]='none' ; fi
if [ "${location12[$numligne2]}" = 'none' ]
then
location12[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location12[$numligne2]}" = '' ] ; then
location12[$numligne2]='none' ; fi
location22[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location22[$numligne2]}" = '' ] ; then
location22[$numligne2]='none' ; fi
location32[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location32[$numligne2]}" = '' ] ; then
location32[$numligne2]='none' ; fi
location42[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location42[$numligne2]}" = '' ] ; then
location42[$numligne2]='none' ; fi
location52[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location52[$numligne2]}" = '' ] ; then
location52[$numligne2]='none' ; fi
location62[$numligne2]=$(cat $temp"adapter" | grep -i $
{NomAdapter2[$numligne2]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location62[$numligne2]}" = '' ] ; then
location62[$numligne2]='none' ; fi
fi
if (( $numligne > 0 )) ; then ((numligne-=1)); fi
echo ${NomAdapter2[$numligne2]} >> $temp"NomAdapter2""11"
echo ${locaddr2[$numligne2]} >> $temp"locaddr2""11"
echo ${Adapterdesc2[$numligne2]} >> $temp"Adapterdesc2""11"
echo ${typeM2[$numligne2]} >> $temp"typeM2""11"
echo ${SerialNumber2[$numligne2]} >> $temp"SerialNumber2""11"
echo ${ccin2[$numligne2]} >> $temp"ccin2""11"
echo ${Manufacturer2[$numligne2]} >> $temp"Manufacturer2""11"
echo ${FRU2[$numligne2]} >> $temp"FRU2""11"
echo ${NetAddr2[$numligne2]} >> $temp"NetAddr2""11"
echo ${Firm2[$numligne2]} >> $temp"Firm2""11"
echo ${location12[$numligne2]} >> $temp"location12""11"
echo ${location22[$numligne2]} >> $temp"location22""11"
echo ${location32[$numligne2]} >> $temp"location32""11"
if [ "${NomAdapter2[$numligne2]}" = '' ] ; then if (( $numligne2
> 0 )) ; then ((numligne2-=1)); fi ; fi
fi
done
let numtotligne=$numligne
let numtotligne2=$numligne2
cat $temp"NomAdapter""11" | sort -u > $temp"NomAdapter""1"
cat $temp"locaddr""11" | sort -u > $temp"locaddr""1"
cat $temp"Adapterdesc""11" | sort -u > $temp"Adapterdesc""1"
cat $temp"typeM""11" | sort -u > $temp"typeM""1"
cat $temp"SerialNumber""11" | sort -u > $temp"SerialNumber""1"
cat $temp"ccin""11" | sort -u > $temp"ccin""1"
cat $temp"Manufacturer""11" | sort -u > $temp"Manufacturer""1"
cat $temp"FRU""11" | sort -u > $temp"FRU""1"
cat $temp"Firm""11" | sort -u > $temp"Firm""1"
cat $temp"location1""11" | sort -u > $temp"location1""1"
cat $temp"location2""11" | sort -u > $temp"location2""1"
cat $temp"location3""11" | sort -u > $temp"location3""1"
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
if [ ${location12[$numligne]} != "none" ]
then
echo ${ccin2[$numligne]}' '${FRU2[$numligne]}' '$
{location12[$numligne]}'-'${location22[$numligne]}'-'${location32[$numligne]}'-'$
{location42[$numligne]}'-'${location52[$numligne]}'-'${location62[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in Adapterdesc SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
for typeinfo in FRU NomAdapter locaddr ccin typeM Manufacturer Firm location1
location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-sascard"><tr><td>SAS card :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{ccin[$numligne]}'</td><td>'${SerialNumber[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'$
{Adapterdesc[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SAS card with FRU </th>' >>
$Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>SAS card :</td><td>'${NomAdapter2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${FRU2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${ccin2[$numligne]}'</td><td>'$
{SerialNumber2[$numligne]}'</td><td>'${Manufacturer2[$numligne]}'</td><td>'$
{location12[$numligne]}$([[ ${location22[$numligne]} != 'none' ]] && echo '-'$
{location22[$numligne]})$([[ ${location32[$numligne]} != 'none' ]] && echo '-'$
{location32[$numligne]})$([[ ${location42[$numligne]} != 'none' ]] && echo '-'$
{location42[$numligne]})$([[ ${location52[$numligne]} != 'none' ]] && echo '-'$
{location52[$numligne]})$([[ ${location62[$numligne]} != 'none' ]] && echo '-'$
{location62[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td></tr>' >>
$temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> SAS card without FRU </th>'
>> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>Firmware</th><th>CCIN</t
h><th>SerialNum</th><th>manufacturer</th><th>Physical
Location</th><th>Description</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
lsdev -S A -Cc adapter -F name,description | grep -i Graphics| tr ' ' '%' | tr ','
' ' | awk '{print$1}' > $temp"listeadapt"
if [ -s $temp"listeadapt" ]
then
calculcouleur
lsdev -S A -Cc adapter -F name,description | grep -i Graphics | tr ' ' '%' | tr ','
' ' > $temp"listeadapt"
typeset -i numtotligne
typeset -i numligne=0
cat $temp"listeadapt" | while read ligne ; do
((numligne+=1))
NomAdapter[$numligne]=$(echo $ligne| awk '{print$1}') ; echo $
{NomAdapter[$numligne]} > $temp"jfp0" ; NomAdapter[$numligne]=$(cat $temp"jfp0") ;
if [ "${NomAdapter[$numligne]}" = '' ] ; then NomAdapter[$numligne]='none' ; fi
Adapterdesc[$numligne]=$(echo $ligne| awk '{print$2}' | tr '%' ' ') ; echo $
{Adapterdesc[$numligne]} > $temp"jfp0" ; Adapterdesc[$numligne]=$(cat
$temp"jfp0") ; if [ "${Adapterdesc[$numligne]}" = '' ] ; then
Adapterdesc[$numligne]='none' ; fi
locaddr[$numligne]=$(lsdev -Cl ${NomAdapter[$numligne]} -F location) ; echo $
{locaddr[$numligne]} > $temp"jfp0" ; locaddr[$numligne]=$(cat $temp"jfp0") ; if
[ "${locaddr[$numligne]}" = '' ] ; then locaddr[$numligne]='none' ; fi
lscfg -vpl ${NomAdapter[$numligne]} | tr ' ' '%' | sed 's/\.\./ /g' >
$temp"adapter"
ccin[$numligne]=$(cat $temp"adapter" | grep -i Customer%Card%ID%Number | tr
'.' ' ' | awk '{print$2}' | tr '%' ' ') ; echo ${ccin[$numligne]} > $temp"jfp0" ;
ccin[$numligne]=$(cat $temp"jfp0") ; if [ "${ccin[$numligne]}" = '' ] ; then
ccin[$numligne]='none' ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Z0 | awk '{print$2}' | tr '%' ' ') ; echo $
{ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ; if [ "$
{ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if [ "${ccin[$numligne]}" = 'none' ] ; then ccin[$numligne]=$(cat
$temp"adapter" | grep -i Marketing%ID | tr '.' ' ' | awk '{print$2}' | tr '%' '
') ; echo ${ccin[$numligne]} > $temp"jfp0" ; ccin[$numligne]=$(cat $temp"jfp0") ;
if [ "${ccin[$numligne]}" = '' ] ; then ccin[$numligne]='none' ; fi ; fi
if (( $(echo "${ccin[$numligne]}" | wc -c) > 5 )) ; then
ccin[$numligne]="none" ; fi
Manufacturer[$numligne]=$(cat $temp"adapter" | grep -i Manufacture | tr '.' '
' | awk '{print$2}' | tr '%' ' ') ; echo ${Manufacturer[$numligne]} > $temp"jfp0" ;
Manufacturer[$numligne]=$(cat $temp"jfp0") ; if [ "${Manufacturer[$numligne]}" = ''
] ; then Manufacturer[$numligne]='none' ; fi
FRU[$numligne]=$(cat $temp"adapter" | grep -i FRU | tr '.' ' ' | awk
'{print$2}' | tr '%' ' ') ; echo ${FRU[$numligne]} > $temp"jfp0" ;
FRU[$numligne]=$(cat $temp"jfp0") ; if [ "${FRU[$numligne]}" = '' ] ; then
FRU[$numligne]='none' ; fi
location1[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$1}') ; echo $
{location1[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location1[$numligne]=$
(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$2}') ; echo $
{location2[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location2[$numligne]=$
(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$3}') ; echo $
{location3[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location3[$numligne]=$
(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$4}') ; echo $
{location4[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location4[$numligne]=$
(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$5}') ; echo $
{location5[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location5[$numligne]=$
(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i Location | awk
'{print$2}' | tr '%' ' ' | tr '-' ' ' | awk '{print$6}') ; echo $
{location6[$numligne]} | awk '{print$1}' > $temp"jfp0" ; location6[$numligne]=$
(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
if [ "${location1[$numligne]}" = 'none' ]
then
location1[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$1}') ; if [ "${location1[$numligne]}" = '' ] ; then
location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$2}') ; if [ "${location2[$numligne]}" = '' ] ; then
location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$3}') ; if [ "${location3[$numligne]}" = '' ] ; then
location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$4}') ; if [ "${location4[$numligne]}" = '' ] ; then
location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$5}') ; if [ "${location5[$numligne]}" = '' ] ; then
location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"adapter" | grep -i $
{NomAdapter[$numligne]} | tr '%' ' ' | awk '{print$2}' | tr '-' ' ' | awk
'{print$6}') ; if [ "${location6[$numligne]}" = '' ] ; then
location6[$numligne]='none' ; fi
fi
echo ${NomAdapter[$numligne]} >> $temp"NomAdapter"
echo ${locaddr[$numligne]} >> $temp"locaddr"
echo ${Adapterdesc[$numligne]} >> $temp"Adapterdesc""1"
echo ${ccin[$numligne]} >> $temp"ccin""1"
echo ${Manufacturer[$numligne]} >> $temp"Manufacturer""1"
echo ${FRU[$numligne]} >> $temp"FRU""1"
echo ${location1[$numligne]} >> $temp"location1""1"
echo ${location2[$numligne]} >> $temp"location2""1"
echo ${location3[$numligne]} >> $temp"location3""1"
done
let numtotligne=$numligne
cat $temp"NomAdapter" | sort -u > $temp"NomAdapter""1"
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-graphicscard"><tr><td>Graphics card :</td><td>'$
{NomAdapter[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${ccin[$numligne]}'</td><td>'$
{Manufacturer[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'$
{Adapterdesc[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo
"<tr><th></th><th>Name</th><th>LocAddr</th><th>FRU</th><th>CCIN</th><th>manufacture
r</th><th>Physical Location</th><th>Description</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
if [ "${location1[$numligne]}" = "none" ]
then
location1[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$1}' ) ; echo ${location1[$numligne]} > $temp"jfp0" ;
location1[$numligne]=$(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ;
then location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$2}') ; echo ${location2[$numligne]} > $temp"jfp0" ;
location2[$numligne]=$(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ;
then location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$3}') ; echo ${location3[$numligne]} > $temp"jfp0" ;
location3[$numligne]=$(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ;
then location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$4}') ; echo ${location4[$numligne]} > $temp"jfp0" ;
location4[$numligne]=$(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ;
then location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$5}') ; echo ${location5[$numligne]} > $temp"jfp0" ;
location5[$numligne]=$(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ;
then location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"jfplscfg2" | grep -p $ligne | grep -i
"(YL)" | sed 's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | sed 's/^[\.\t]//g' | tr
'-' ' ' | awk '{print$6}') ; echo ${location6[$numligne]} > $temp"jfp0" ;
location6[$numligne]=$(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ;
then location6[$numligne]='none' ; fi
fi
if [ "${location1[$numligne]}" = "none" ]
then
location1[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$1}' | tr 'x' '.' ) ; echo ${location1[$numligne]} > $temp"jfp0" ;
location1[$numligne]=$(cat $temp"jfp0") ; if [ "${location1[$numligne]}" = '' ] ;
then location1[$numligne]='none' ; fi
location2[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$2}' | tr 'x' '.' ) ; echo ${location2[$numligne]} > $temp"jfp0" ;
location2[$numligne]=$(cat $temp"jfp0") ; if [ "${location2[$numligne]}" = '' ] ;
then location2[$numligne]='none' ; fi
location3[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$3}' | tr 'x' '.' ) ; echo ${location3[$numligne]} > $temp"jfp0" ;
location3[$numligne]=$(cat $temp"jfp0") ; if [ "${location3[$numligne]}" = '' ] ;
then location3[$numligne]='none' ; fi
location4[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$4}' | tr 'x' '.' ) ; echo ${location4[$numligne]} > $temp"jfp0" ;
location4[$numligne]=$(cat $temp"jfp0") ; if [ "${location4[$numligne]}" = '' ] ;
then location4[$numligne]='none' ; fi
location5[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$5}' | tr 'x' '.' ) ; echo ${location5[$numligne]} > $temp"jfp0" ;
location5[$numligne]=$(cat $temp"jfp0") ; if [ "${location5[$numligne]}" = '' ] ;
then location5[$numligne]='none' ; fi
location6[$numligne]=$(cat $temp"jfplscfg2" | grep -i "Location" | sed
's/\.\./ /g' | awk '{print$2}' | tr '%' ' ' | tr '.' 'x'| tr '-' ' ' | awk
'{print$6}' | tr 'x' '.' ) ; echo ${location6[$numligne]} > $temp"jfp0" ;
location6[$numligne]=$(cat $temp"jfp0") ; if [ "${location6[$numligne]}" = '' ] ;
then location6[$numligne]='none' ; fi
fi
echo ${SerialNumber[$numligne]} >> $temp"SerialNumber""1"
echo ${Nom[$numligne]} >> $temp"Nom""1"
echo ${ccin[$numligne]} >> $temp"ccin""1"
echo ${FRU[$numligne]} >> $temp"FRU""1"
echo ${frequence[$numligne]} >> $temp"frequence""1"
echo ${location1[$numligne]} >> $temp"location1""1"
echo ${location2[$numligne]} >> $temp"location2""1"
echo ${location3[$numligne]} >> $temp"location3""1"
done
let numtotligne=$numligne
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in SerialNumber
do
echo '.\c'
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \${$typeinfo[$numligne]})
if [ "${valinfo[$numligne]}" != "none" ] ; then valinfo[$numligne]='<a
class="db-'$typeinfo'">'${valinfo[$numligne]}'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
done
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-proccard"><tr><td>Processor :</td><td>'$
{Nom[$numligne]}'</td><td>'${frequence[$numligne]}'</td><td>'$
{FRU[$numligne]}'</td><td>'${ccin[$numligne]}'</td><td>'$
{SerialNumber[$numligne]}'</td><td><span class="db-location">'$
{location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo '-'$
{location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo
"<tr><th></th><th>Name</th><th>Frequency</th><th>FRU</th><th>CCIN</th><th>SerialNum
</th><th>Physical Location</th></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
cherchcar() # recherche espace, emplacement, info de retour dans return.... nom
fichier entrer : $temp"lignenum"
{
typeset tabu=""
typeset -i long1
typeset -i long=1
long1=$(cat $temp"lignenum" | wc -c)
while [[ $(echo $tabu) = "" ]] && [[ $long -le $long1 ]]
do
((long+=1))
tabu=$(head -c $long $temp"lignenum" | awk '{print$2}')
done
if [[ $long -ge $long1 ]]
then
return 0
else
return $long
fi
}
ModHHH068() # Num�ro d execution
{
$debug
#yyyy ModHHH068 oui 9 "HARD Available all devices not listed"
typeset j=$1
typeset TitreModule version
TitreModule="HARD Available all devices not listed"
version=" version 2013-1.4.4 date: 11/10/2013"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="HHH068"
typeset -i num=1
typeset ligne frunone lignelst
filtre='wywyw'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+1000]="Mod"$NomMod
TitreS[$NumNum+1000]=$TitreModule
NumS[$NumNum+1000]=$j
SignetS[$NumNum+1000]="titre"$NomMod
listlien[$NumNum+1000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
typeset Adapterdesc[] FRU[] SerialNumber[] ccin[] sizem[] location1[] location2[]
location3[] location4[] location5[] location6[]
lscfg -vp | tr ' ' '%' > $temp"jfplscfg"
if [ -s $temp"jfplscfg" ]
then
calculcouleur
typeset -i nbligne long
>$temp"jfplscfg"
lscfg | awk '{print$2}' | while read ligne ; do
lscfg -vl $ligne 2>$temp"tmp2lscfg" | grep $ligne >$temp"tmplscfg"
2>$temp"tmp2lscfg"
if [ $? = 0 ]
then
cat $temp"tmplscfg" >> $temp"jfplscfg"
fi
done
nbligne=$(cat $temp"jfplscfg" | wc -l)
>$temp"lscfglist"
typeset -i numligne=1
while [[ ! -s $temp"lscfglist" ]] && [[ $nbligne -gt $numligne ]]
do
((numligne+=1))
sed -n "$numligne"p $temp"jfplscfg" > $temp"lignenum"
cherchcar
long=$?
if [[ $long -gt 3 ]]
then
((long-=2))
sed '/^.\{'$long'\} / s/\(.\{'$long'\}\)./\1%/' $temp"jfplscfg" >
$temp"lscfglistmp"
cat $temp"lscfglistmp" | grep -v "%" > $temp"lscfglist"
else
>$temp"lscfglist"
fi
done
let numtotligne=$numligne
let numtotligne2=$numligne2
let numligne=1
while (( $numligne <= $numtotligne ))
do
if [ ${location1[$numligne]} != "none" ]
then
echo ${ccin[$numligne]}' '${FRU[$numligne]}' '$
{location1[$numligne]}'-'${location2[$numligne]}'-'${location3[$numligne]}'-'$
{location4[$numligne]}'-'${location5[$numligne]}'-'${location6[$numligne]} >>
$tpsort"HARDLoc"
fi
((numligne+=1))
done
for typeinfo in FRU Nom locaddr VgAssos ccin typeM Manufacturer Firm location1
location2 location3
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a class="db-'$typeinfo'" style=background:'$
{valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
for typeinfo in FRU2 Nom2 locaddr2 VgAssos2 ccin2 typeM2 Manufacturer2 Firm2
location12 location22 location32
do
echo '.\c'
let coulc=1
let coulf=13
let contr=1
cat $temp$typeinfo"1" | while read mot ; do
if [ "$mot" != "none" ]
then
if (( $contr == 1 )) ; then
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulc]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulc+=1)) ; let contr=2
else
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
valinfo[$numligne]=$(eval echo \$
{$typeinfo[$numligne]})
if [ "$mot" = "${valinfo[$numligne]}" ] ; then
valinfo[$numligne]='<a style=background:'${valcoul[$coulf]}'>'$mot'</a>' ; fi
eval "$typeinfo[$numligne]"="\${valinfo[$numligne]}"
((numligne+=1))
done
((coulf+=1)) ; let contr=1
fi
fi
done
done
>$temp"LocPosMem1"
let numligne=1
while (( $numligne <= $numtotligne ))
do
echo '<span class="db-harddevices"><tr><td>Hards Device :</td><td>'$
{Nom[$numligne]}'</td><td>'${locaddr[$numligne]}'</td><td>'$
{typeM[$numligne]}'</td><td>'${FRU[$numligne]}'</td><td>'$
{ccin[$numligne]}'</td><td>'${Firm[$numligne]}'</td><td>'$
{SerialNumber[$numligne]}'</td><td>'${Manufacturer[$numligne]}'</td><td>'$
{NetAddr[$numligne]}'</td><td>'${VgAssos[$numligne]}'</td><td><span class="db-
location">'${location1[$numligne]}$([[ ${location2[$numligne]} != 'none' ]] && echo
'-'${location2[$numligne]})$([[ ${location3[$numligne]} != 'none' ]] && echo '-'$
{location3[$numligne]})$([[ ${location4[$numligne]} != 'none' ]] && echo '-'$
{location4[$numligne]})$([[ ${location5[$numligne]} != 'none' ]] && echo '-'$
{location5[$numligne]})$([[ ${location6[$numligne]} != 'none' ]] && echo '-'$
{location6[$numligne]})'</span></td><td>'$
{Adapterdesc[$numligne]}'</td></tr></span>' >> $temp"LocPosMem1"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> Hards Devices with FRU </th>'
>> $Modu
echo "<tr><th></th><th>Name</th><th>LocAddr</th><th>Type
Model</th><th>FRU</th><th>CCIN</th><th>Firmware</th><th>Serial
Number</th><th>manufacturer</th><th>Networkaddress</th><th>Associated
VG</th><th>Physical Location</th><th>Description</th></tr></tr>" >> $Modu
cat $temp"LocPosMem1" >> $Modu
echo '</table>' >> $Modu
fi
echo '.\c'
>$temp"LocPosMem1"
>$temp"LocPosMem12"
let numligne=1
while (( $numligne <= $numtotligne2 ))
do
echo '<tr><td>Device :</td><td>'${Nom2[$numligne]}'</td><td>'$
{locaddr2[$numligne]}'</td><td>'${typeM2[$numligne]}'</td><td>'$
{FRU2[$numligne]}'</td><td>'${ccin2[$numligne]}'</td><td>'$
{Firm2[$numligne]}'</td><td>'${SerialNumber2[$numligne]}'</td><td>'$
{Manufacturer2[$numligne]}'</td><td>'${NetAddr2[$numligne]}'</td><td>'$
{VgAssos2[$numligne]}'</td><td>'${location12[$numligne]}$([[ $
{location22[$numligne]} != 'none' ]] && echo '-'${location22[$numligne]})$([[ $
{location32[$numligne]} != 'none' ]] && echo '-'${location32[$numligne]})$([[ $
{location42[$numligne]} != 'none' ]] && echo '-'${location42[$numligne]})$([[ $
{location52[$numligne]} != 'none' ]] && echo '-'${location52[$numligne]})$([[ $
{location62[$numligne]} != 'none' ]] && echo '-'$
{location62[$numligne]})'</td><td>'${Adapterdesc2[$numligne]}'</td></tr>' >>
$temp"LocPosMem12"
((numligne+=1))
done
if [ -s $temp"LocPosMem1" ]
then
echo '<table>' >> $Modu
echo '<tr><th></th><th colspan=4> Devices without FRU </th>' >>
$Modu
echo "<tr><th></th><th>Name</th><th>LocAddr</th><th>Type
Model</th><th>FRU</th><th>CCIN</th><th>Firmware</th><th>Serial
Number</th><th>manufacturer</th><th>Networkaddress</th><th>Associated
VG</th><th>Physical Location</th><th>Description</th></tr></tr>" >> $Modu
cat $temp"LocPosMem12" >> $Modu
echo '</table>' >> $Modu
fi
>$temp"LocPosMem12"
echo '.'
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
#FinModHHH
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModAAA012() # Num�ro d execution
{
$debug
#yyyy ModAAA012 oui
typeset j=$1
typeset TitreModule version
TitreModule="netstat -r"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="AAA012"
filtre='network'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+3000]="Mod"$NomMod
TitreS[$NumNum+3000]=$TitreModule
NumS[$NumNum+3000]=$j
SignetS[$NumNum+3000]="titre"$NomMod
listlien[$NumNum+3000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
netstat -r >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModAAA026() # Num�ro d execution
{
$debug
#yyyy ModAAA026 oui
typeset j=$1
typeset TitreModule version
TitreModule="svmon -P -t 10 : Process report "
version=" version 11-H.2.24"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="AAA026"
typeset Ent etat
filtre='infoperf'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+3000]="Mod"$NomMod
TitreS[$NumNum+3000]=$TitreModule
NumS[$NumNum+3000]=$j
SignetS[$NumNum+3000]="titre"$NomMod
listlien[$NumNum+3000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
svmon -P -t 10 >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
#FinModAAA
ModSSS002() # Num�ro d execution
{
$debug
#yyyy ModSSS002 oui
typeset j=$1
typeset TitreModule version
TitreModule="Installed level Maintenance"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS002"
typeset psi
filtre='infosys'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lsdev -C -Sa -F name | grep atf > $temp"jfp1"
if [ $? = 0 ]
then
for i in $(lsdev -C -Sa -F name | grep atf)
do
echo '<b> Pseudo-Devices : </b><em> '$psi' </em>' >> $Modu
/usr/sbin/atf/atfi -d $psi -p >> $Modu
echo '' >> $Modu
done
fi
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
ps gv > $temp"result"
if [ -s $temp"result" ]
then
echo '<a onclick="javascript:
showinf(document.getElementById('\'''psgv''\''));" style="cursor: pointer;"><strong
class="alert1"> \c' >> $Modu
echo 'ps gv \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="psgv" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''psgv''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
fi
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModSSS028() # Num�ro d execution
{
$debug
#yyyy ModSSS028 oui 5 "Health system installed (lppchk etc...)"
typeset j=$1
typeset TitreModule version
TitreModule="Health system installed (lppchk etc...)"
version=" version 2013-1.4.6 date: 21/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS028"
filtre='infoinst'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
typeset -i nbetat=0
lppchk -v > $temp"result"
if [ ! -s $temp"result" ] ; then resultat="that ok" ; ((nbetat+=1)) ; else
resultat='<a class="alert"> that not ok </a>' ; ((nbetat+=1)) ; fi
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lppchk_v1''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lppchk -v '$resultat'\c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lppchk_v1" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lppchk_v1''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
lppchk -vm3 > $temp"result"
if [ ! -s $temp"result" ] ; then resultat="that ok" ; ((nbetat+=1)) ; else
resultat='<a class="alert"> that not ok </a>' ; ((nbetat+=1)) ; fi
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lppchk_vm3''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lppchk -vm3 '$resultat'\c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lppchk_vm3" style="display: none;">' >> $Modu
cat $temp"result" >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lppchk_vm3''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
if [ -s $temp"NOTinstML" ]
then
for fileset in $(cat $temp"instML" | grep -i "not all" |tr ' ' '\n' | grep ML
| tr '_' ' ' | awk '{print$1}')
do
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_oslevel_rl''$fileset''''\''));"
style="cursor: pointer;"><strong class="alert1"> \c' >> $Modu
echo '--> oslevel -rl '$fileset' \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_oslevel_rl'$fileset'" style="display: none;">' >> $Modu
echo '.\c'
oslevel -rl $fileset >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById(('\'''cmd_oslevel_rl''$fileset''''\''));"
style="cursor: pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
done
fi
if [ -s $temp"NOTinstML" ]
then
for fileset in $(cat $temp"instML" | grep -i "not all" |tr ' ' '\n' | grep SP
| tr '_' ' ' | awk '{print$1}')
do
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_oslevel_rl''$fileset''''\''));"
style="cursor: pointer;"><strong class="alert1"> \c' >> $Modu
echo '--> oslevel -sl '$fileset' \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_oslevel_rl'$fileset'" style="display: none;">' >> $Modu
echo '.\c'
oslevel -sl $fileset >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById(('\'''cmd_oslevel_rl''$fileset''''\''));"
style="cursor: pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
done
fi
echo '.'
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
fi
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" | while read alert ; do
echo '<a href="#'${SignetS[$NumNum+2000]}'" class="alert"
title="Go to 2.'$j' '$TitreModule'">'$alert'</a>' >> $temp"jfp88"
done
if [ -s $temp"jfp88" ] || [[ $nbetat -gt 0 ]]
then
echo '<a href="#'${SignetS[$NumNum+2000]}'" class="alert"
title="Go to 2.'$j' '$TitreModule'"> Warning, error messages in chapter 2.'$j'
"Health system installed (lppchk etc...)" </a>' >> $Resu
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModSSS029() # Num�ro d execution
{
$debug
#yyyy ModSSS029 oui
typeset j=$1
typeset TitreModule version
TitreModule="Kernel Informations"
version=" version 11-H.1.00"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS029"
typeset Chemin filelpp
filtre='infosys'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
Chemin=$(ls -l /unix | awk {'print $11'})
filelpp=$(lslpp -w $Chemin | grep bos | awk {'print $2'})
lslpp -h $filelpp >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
>> $Resu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" | while read alert ; do
echo '<a href="#'${SignetS[$NumNum+2000]}'" class="alert"
title="Go to 2.'$j' '$TitreModule'">'$alert'</a>' >> $Resu
done
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModSSS032() # Num�ro d execution
{
$debug
#yyyy ModSSS032 oui
typeset j=$1
typeset TitreModule version
TitreModule="lslpp -l"
version=" version 11-H.2.24"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS032"
filtre='infoinst'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
lslpp -l > $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModSSS048() # Num�ro d execution
{
$debug
#yyyy ModSSS048 oui
typeset j=$1
typeset TitreModule version
TitreModule="KERNEL : vmtune"
version=" version 2012-1.0.12 date: 31/05/12"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS048"
filtre='infoperf'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
if [ -x /usr/samples/kernel/vmtune ]
then
/usr/samples/kernel/vmtune >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|warning" >
$temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g; s/Dead/<strong
class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong class=\"alert\">DEAD<\/strong>/g"
$temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g; s/Stale/<strong
class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
instfix -i >$temp"jfp10"
sed "s/Not all/ntntnt, /g" $temp"jfp10" > $temp"jfp1"
sed "s/No /nonono, /g" $temp"jfp1" > $temp"jfp2"
sed "s/All filesets /okokok, /g" $temp"jfp2" > $temp"jfp1"
cat $temp"jfp1" | tr ' ' '%' > $temp"jfp2"
sed "s/ntntnt,/#FFFF00 /g" $temp"jfp2" > $temp"jfp1"
sed "s/nonono,/#FF9900 /g" $temp"jfp1" > $temp"jfp2"
sed "s/okokok,/#CCFFCC /g" $temp"jfp2" > $temp"jfp1"
sed "s/for/ /g" $temp"jfp1" > $temp"jfp2"
sed 's/were/ /g' $temp"jfp2" > $temp"jfp1"
sed 's/are/ /g' $temp"jfp1" > $temp"jfp2"
cat $temp"jfp2" | awk '{print $1$3}' | tr '%' ' ' > $temp"jfp1"
cat $temp"jfp1" | grep "ML" > $temp"ML"
cat $temp"jfp1" | grep "SP" > $temp"SP"
cat $temp"jfp1" | grep -vE "SP|ML" > $temp"fix"
typeset j=$1
typeset TitreModule version
TitreModule="summary system (last boot etc...)"
version=" version 2013-1.4.6 date: 14/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS058"
filtre='infopart'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
echo '<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">In this
result, click on the label. You will view all details (emgr -l) for this label' >>
$Modu
echo '' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''last_boot''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'Date of the last boot : (last boot) \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="last_boot" style="display: none;">' >> $Modu
last boot >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''last_boot''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''last_reboot''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'All boot : (last reboot) \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="last_reboot" style="display: none;">' >> $Modu
last reboot >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''last_reboot''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''w_summary''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'summary system : ( w ) \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="w_summary" style="display: none;">' >> $Modu
w >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''w_summary''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
else
echo 'Module '$NomMod' : '$TitreModule' ---> \c' >> $tpsort"MVide"
cat $temp"Noresult" >> $tpsort"MVide"
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
ModSSS059() # Num�ro d execution
{
$debug
#yyyy ModSSS059 oui 9 "specific commands VIOS"
typeset j=$1
typeset TitreModule version
TitreModule="specific commands VIOS"
version=" version 2013-1.4.6 date: 20/01/2014"
if [[ $j != "conf" ]]
then
typeset temp NomMod filtre
typeset -i a=0
NomMod="SSS059"
filtre='vios'
temp=$tpvar$j$NomMod"jfp"
Somm=$tpsort"Som"$NomMod
Modu=$tpsort"Mod"$NomMod
Resu=$tpsort"Res"$NomMod
>$temp"jfp1"
>$Modu
>$Somm
echo $NomMod' '$TitreModule >> $tpsort"ListeTitreMS"
NomMd[$NumNum+2000]="Mod"$NomMod
TitreS[$NumNum+2000]=$TitreModule
NumS[$NumNum+2000]=$j
SignetS[$NumNum+2000]="titre"$NomMod
listlien[$NumNum+2000]=$(cat $tpsort"listedelien" | grep $filtre | read wwww
xxxx listL ; echo $listL)
# --- Calcul du module
if [ -s /usr/ios/cli/ioscli ]
then
echo '<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">In this
result, click on the command. You will view the result' >> $Modu
echo '' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lsdev_virtual''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lsdev -virtual \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lsdev_virtual" style="display: none;">' >> $Modu
/usr/ios/cli/ioscli lsdev -virtual >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lsdev_virtual''\''));" style="cursor:
pointer;" class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lssp''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lssp \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lssp" style="display: none;">' >> $Modu
/usr/ios/cli/ioscli lssp >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lssp''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrep''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lsrep \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lsrep" style="display: none;">' >> $Modu
ls -t > $temp"diff1"
/usr/ios/cli/ioscli lsrep >> $Modu &
pid=$!
sleep 2
kill -0 $pid 1>$temp"0" 2>$temp"0"
if [ $? = '0' ]
then
sleep 80
kill -0 $pid 1>$temp"0" 2>$temp"0"
[ $? = '0' ] && (kill -9 $pid ; echo "--- kill
/usr/ios/cli/ioscli lsrep time out of command ---" >> $Modu ; echo 'module SSS059,
kill after time out command: /usr/ios/cli/ioscli lsrep' >> $tpsort"KILL9" )
fi
ls -t > $temp"diff2"
rm $(diff $temp"diff1" $temp"diff2" | grep ">" | sed 's/^> //' |
grep -iE "core|stderr")
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lsrep''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
echo '<a onclick="javascript:
showinf(document.getElementById('\'''cmd_lsvopt''\''));" style="cursor:
pointer;"><strong class="alert1"> \c' >> $Modu
echo 'lsvopt \c' >> $Modu
echo '</strong></a><tt cellpadding=2 cellspacing=0 rules=cols
bgcolor=#d6d6d8 id="cmd_lsvopt" style="display: none;">' >> $Modu
/usr/ios/cli/ioscli lsvopt >> $Modu
echo '<strong onclick="javascript:
showinf(document.getElementById('\'''cmd_lsvopt''\''));" style="cursor: pointer;"
class="alert1">
<img src="http://galetiere.fr/aufildeaix/Info/lumiere02.gif">Close
details</strong>' >> $Modu
echo '</tt>' >> $Modu
cat $Modu | grep -iE "Failed|missing|dead|stale|unknow|degraded|
warning" > $temp"jfp77"
if [ -s $temp"jfp77" ]
then
sed "s/Failed/<strong class=\"alert\">Failed<\/strong>/g;
s/failed/<strong class=\"alert\">failed<\/strong>/g; s/FAILED/<strong
class=\"alert\">FAILED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/faulted/<strong class=\"alert\">faulted<\/strong>/g;
s/Faulted/<strong class=\"alert\">Faulted<\/strong>/g; s/FAULTED/<strong
class=\"alert\">FAULTED<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/missing/<strong class=\"alert\">missing<\/strong>/g;
s/Missing/<strong class=\"alert\">Missing<\/strong>/g; s/MISSING/<strong
class=\"alert\">MISSING<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/dead/<strong class=\"alert\">dead<\/strong>/g;
s/Dead/<strong class=\"alert\">Dead<\/strong>/g; s/DEAD/<strong
class=\"alert\">DEAD<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/stale/<strong class=\"alert\">stale<\/strong>/g;
s/Stale/<strong class=\"alert\">Stale<\/strong>/g; s/STALE/<strong
class=\"alert\">STALE<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/unknown/<strong class=\"alert\">unknown<\/strong>/g;
s/Unknown/<strong class=\"alert\">Unknown<\/strong>/g; s/UNKNOWN/<strong
class=\"alert\">UNKNOWN<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
sed "s/degraded/<strong class=\"alert\">degraded<\/strong>/g;
s/Degraded/<strong class=\"alert\">Degraded<\/strong>/g; s/DEGRADED/<strong
class=\"alert\">DEGRADED<\/strong>/g" $Modu > $temp"jfp78" ; echo '.\c'
sed "s/warning/<strong class=\"alert\">warning<\/strong>/g;
s/Warning/<strong class=\"alert\">Warning<\/strong>/g; s/WARNING/<strong
class=\"alert\">WARNING<\/strong>/g" $temp"jfp78" > $Modu ; echo '.\c'
else
echo 'Module '$NomMod' : '$TitreModule' ---> \c' >> $tpsort"MVide"
cat $temp"Noresult" >> $tpsort"MVide"
fi
echo $j > $Somm
echo $TitreModule >> $Somm
rm -f $tpvar$j$NomMod"jfp"*
return $a
else
TitreMod=$TitreModule" "$version
fi
}
#FinModSSS
MiseEnFormeErreur ()
{
$debug
cat $1 > $TaixLog
# --- debut d analyse d erreurs ---
if [[ -s $TaixLog ]]
then
> $TaixLog2
# ----- extraction dans $TaixLog2 des lignes avec un ID en double
for i in $(cat $TaixLog | awk '{print $1}')
do
cat $TaixLog |grep -w $i > $Taix
if [ $? = 0 ]
then
print $i >> $TaixLog2
fi
cat $TaixLog |grep -v $i > $TaixLog1 ; mv $TaixLog1
$TaixLog
done
> $TaixLog
> $TaixLog1
# ----- extraction des numeros de sequence et cr�ation du fichier resume des
erreurs
for i in $(cat $TaixLog2)
do
>$Tmp2
# --- liste des ressources concern�
errpt -j $i | grep -v IDENTIFIER | awk '{print $5}' > $Tmp
for kk in $(cat $Tmp)
do
cat $Tmp | grep -w $kk > $tmp
if [ $? = 0 ]
then
print $kk >> $Tmp2
fi
cat $Tmp | grep -v $kk > $Tmp1
mv $Tmp1 $Tmp
done
errpt -j $i -a | grep -i equence | awk '{print $NF}' > $TaixLog
NombreLigne=$(cat $TaixLog | wc -l)
print
'____________________________________________________________________________' >>
$TaixLog1
print
'============================================================================' >>
$TaixLog1
print 'There are '$NombreLigne' type errors on this server : '$
(hostname) >> $TaixLog1
print 'The following sources concerned : '$(cat $Tmp2) >>
$TaixLog1
errpt -a -l $(cat $TaixLog) >> $TaixLog1
done
else
> $TaixLog1
fi
# --- creation du fichier analyselog.txt
mv $TaixLog1 $log
# --- fin de fonction d analyse d erreur ---
}
RecupSnap()
{
$debug
typeset temp
typeset -i a=0
temp=$tpvar"RecupSnap"
echo 'info IBM snap .... '
echo 'info IBM snap .... ' >> $tpsort"ModExecAudit"
snap -gcd $Rept >> $temp"jfp11" 2>>$temp"jfp22" &
pidbase=$!
echo 'please wait ...... snap running ... '
echo 'please wait ...... snap running ... ' >> $tpsort"ModExecAudit"
sleep 55
kill -0 $pidbase 1>$temp"0" 2>$temp"0"
if [ $? = '0' ]
then
echo 'please wait ..................... snap running .............. '
echo 'please wait ..................... snap running .............. '
>> $tpsort"ModExecAudit"
sleep 90
kill -0 $pidbase 1>$temp"0" 2>$temp"0"
if [ $? = '0' ]
then
> $temp"jfp1"
echo $pidbase > $temp"pid"
valsum2=0
valsum1=$(sum $temp"pid" | awk '{print$1}')
while (( $valsum1 != $valsum2 ))
do
cat $temp"pid" | while read pidb ; do
ps -eaf | grep $pidb | grep -v "grep $pidb" | while
read ee pid1 pid2 suite ; do
if [ $pidb = $pid2 ]
then
echo $pid1 >> $temp"jfp1"
fi
done
if [ -s $temp"jfp1" ]
then
cat $temp"jfp1" | sort -u > $temp"jfp2"
cat $temp"jfp2" > $temp"jfp1"
fi
done
if [ -s $temp"jfp1" ]
then
valsum1=$(sum $temp"pid" | awk '{print$1}')
valsum2=$(sum $temp"jfp1" | awk '{print$1}')
cat $temp"jfp1" > $temp"pid"
else
valsum1=valsum2
fi
done
echo $pidbase >> $temp"pid"
cat $temp"pid" | sort -u | while read pid ; do
kill -0 $pid 2>$temp"jfptemp"
[ $? = 0 ] && (kill -9 $pid ; echo "--- kill snap -gcd "$Rept"
after time out of command ---" >> $Modu ; echo 'module recupsnap, kill after time
out command: snap -gcd '$Rept >> $tpsort"KILL9" )
done
echo 'Command "snap -gc" is failed .....'
echo 'Command "snap -gc" is failed .....' >>
$tpsort"ModExecAudit"
let a=1
fi
fi
cat $temp"jfp11" | grep snap.pax.Z >$temp"jfp22"
if [ $? = 0 ]
then
tar cvf $audit.tar $audit snap.pax.Z 1>>$temp"jfp2" 2>>$temp"jfp2"
else
let a=1
echo 'Command "snap -gc" is failed'
echo 'Command "snap -gc" is failed' >> $tpsort"ModExecAudit"
fi
#snap -rd $Rept
rm snap.pax.Z 2>>$temp"jfp22"
rm script.log 2>>$temp"jfp22"
return $a
}
# ---- gestion des arguments et execution
>$tpvar"listeOp_m"
Extension=".html"
Compress="n"
CmdSnap="no"
LevelExec=0
typeset -i Stphn=0
while getopts csSdL:n:m:x: name
do
case $name in
d) DateAudit=$(date +%Od%m%OH%OM);;
c) Compress="c";;
s) CmdSnap="yes";;
S) let Stphn="1";;
n) NomClient="$OPTARG";;
m) Nmodule="$OPTARG"; echo $Nmodule >> $tpvar"listeOp_m" ;;
x) NomFichierExec="$OPTARG"; cat $NomFichierExec >>
$tpvar"listeOp_m" ; Nmodule="ModFFF010" ;;
L) LevelExec="$OPTARG";;
?) printf "Usage: %s: [-s] [-c] [-d] [-n NomDuClient] [-m
NomDuModule] args\n" $0
information
rm -f $tpvar$j$NomMod"jfp"*
exit 2;;
esac
done
# LISTE MODULES
#FinModSSS
#FinModAAA
#FinModFFF
#FinModHHH
#xxxx ModSSS058 oui 5 "summary system (last boot etc...)"
#xxxx ModSSS060 oui 5 "system SRADID hierarchy and topology(lssrad -av)"
#xxxx ModSSS059 oui 9 "specific commands VIOS"
#xxxx ModSSS032 oui 5 "lslpp -l"
#xxxx ModSSS010 oui 5 "List Installed Software (lsllp -Lc)"
#xxxx ModSSS030 oui 3 "authentification system : lsuser -a auth1 $Loguser"
#xxxx ModSSS006 oui 6 "File System space (df)"
#xxxx ModSSS009 oui 7 "info volume groupe (lsvg -l)"
#xxxx ModSSS057 oui 5 "Interim FIX list (emgr -l)"
#xxxx ModSSS051 oui 5 "fix list : instfix -i"
#xxxx ModSSS027 oui 8 "Missing Filesets (instfix -icq | grep :-:)"
#xxxx ModSSS031 oui 5 "RPM module : rpm -qa"
#xxxx ModSSS028 oui 5 "Health system installed (lppchk etc...)"
#xxxx ModSSS007 oui 6 "File System charact�ristics (lsfs -a)"
#xxxx ModSSS046 oui 6 "Info Filesystems ( lsfs -q )"
#xxxx ModSSS008 oui 6 "Paging space charact�ristics (lsps -a)"
#xxxx ModSSS016 oui 7 "File system available (mount)"
#xxxx ModSSS015 oui 5 "status of a subsystem (lssrc -a)"
#xxxx ModSSS011 oui 7 "Info system (lsattr -El sys0)"
#xxxx ModSSS012 oui 3 "Network status (netstat -i)"
#xxxx ModSSS013 oui 3 "List All Routes (netstat -rn)"
#xxxx ModSSS014 oui 3 "Address resolution (arp -a)"
#xxxx ModSSS017 oui 3 "Network system tuning (no -a)"
#xxxx ModSSS033 oui 3 "netstat -in"
#xxxx ModSSS050 oui 3 "X25 Informations"
#xxxx ModSSS034 oui 4 "NFS : exportfs"
#xxxx ModSSS035 oui 4 "NFS : nfsstat"
#xxxx ModSSS019 oui 5 "Processus lists : (ps -eaf and ps -T 1)"
#xxxx ModSSS018 oui 5 "ps wwwweg"
#xxxx ModSSS024 oui 5 "Processus lists : ps gv"
#xxxx ModSSS005 non 4 "HACMP : snapshots"
#xxxx ModSSS053 oui 4 "HACMP summarize: clRGinfo"
#xxxx ModSSS052 oui 4 "HACMP summarize: cldisp"
#xxxx ModSSS020 oui 4 "HACMP : cllscf"
#xxxx ModSSS021 oui 4 "HACMP : cllsnw"
#xxxx ModSSS022 oui 4 "HACMP : cllsif"
#xxxx ModSSS023 oui 4 "HACMP : clshowres"
#xxxx ModSSS054 oui 4 "HACMP info"
#xxxx ModSSS055 oui 5 "conf SNMP"
#xxxx ModSSS002 oui 6 "Installed level Maintenance"
#xxxx ModSSS025 oui 6 "TAPE parameters"
#xxxx ModSSS029 oui 5 "Kernel Informations"
#xxxx ModSSS036 oui 9 "GPFS defined cluster configuration"
#xxxx ModSSS047 oui 5 "Info PERF , vmstat"
#xxxx ModSSS048 oui 5 "KERNEL : vmtune"
#xxxx ModSSS049 oui 5 "KERNEL"
#xxxx ModSSS056 oui 6 "Installed License Agreements"