Hello,
For my CGI, I have this script :
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="test/html"; charset=UTF-8">
<title> CLF MONITORING </title>
<h1> FRAME monitoring <font size=3> <a href="Index.sh">[ Index ]</a> </font> </h1>
<hr size="4" color="blue">
<style>
body{
background-color: #eff1f0;
}
</style>
</head>
<body>'
read a
test=$( echo $a | cut -d'=' -f2)
echo '<PRE>'
echo "FRAME : $test "
echo "------------------"
echo ""
for fn in /var/www/cgi-bin/LPAR_MAP/*; do awk -F',|;' 'NR==1 { split(FILENAME ,a,"[-.]");print "DATE ========================== : " a[4] }
/'$test'/ {
print ""
print "LPARS :" $2
print "RAM : " $5
print "CPU 1 : " $6
print "CPU 2 : " $7
print ""
print ""}' $fn; done
echo '</PRE>'
echo '</body>
</html>'
This script allow to display informations from CSV like this :
FRAME : MIAIBYF00
---------------------------------
DATE ========================== : 20180122
LPARS : miaibv189
RAM : 4
CPU 1 : 0.1
CPU 2 : 0.1
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
DATE ========================== : 20180123
LPARS : miaibv189
RAM : 7
CPU 1 : 0.5
CPU 2 : 0.5
LPARS : miaibp05
RAM : 59
CPU 1 : 1.0
CPU 2 : 3
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
I would like to display the consumption diffenence between theses to date next to the good informations. Something like :
FRAME : MIAIBYF00
---------------------------------
DATE ========================== : 20180122
LPARS : miaibv189
RAM : 4
CPU 1 : 0.1
CPU 2 : 0.1
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
DATE ========================== : 20180123
LPARS : miaibv189
RAM : 7 ( + 3 )
CPU 1 : 0.5 ( + 0.4 )
CPU 2 : 0.5 ( + 0.4 )
LPARS : miaibp05
RAM : 59 ( - 2 )
CPU 1 : 1.0 ( - 0.1 )
CPU 2 : 3
LPARS : miaibp05
RAM : 61
CPU 1 : 1.1
CPU 2 : 3
But I don't know how to do this... Can you help me ?
Thank yor !