You should consider using a single ksh compound variable instead of
the AI_ variables. This leaves room for extensions and avoids any
parsing (AFAIK perl and python have modules to read and write this
format).
Roland wrote
http://svn.genunix.org/repos/on/branches/ksh93/gisburn/scripts/cpvvmstat.sh
to demonstrate the concept; it turns the vmstat output into a stream
of compound variables, e.g.
(
cpu=(
integer cs=301
integer id=99
integer sy=0
integer us=1
)
integer -A disk=(
[disk_3]=0
[disk_4]=0
[s0]=0
[s2]=0
[sr]=0
)
faults=(
integer in=365
integer sy=213
)
kthr=(
integer b=0
integer r=1
integer w=0
)
memory=(
integer free=1084400
integer swap=17386512
)
page=(
integer de=0
integer fr=0
integer pi=0
integer po=0
integer si=0
integer so=0
)
timestamp='Monday, April 26, 2010 9:58:46 PM CEST'
)
This output can be passed into another script, i.e. sh cpvvmstat.sh |
while read -C var ; do print "${var.disk[s0]}" ; done, or transformed
into other formats like XML.
Olga
On Mon, Apr 26, 2010 at 9:36 PM, Dave Miner <[email protected]> wrote:
> On 04/23/10 10:47 PM, Ethan Quach wrote:
>>
>> I have posted a revision to the derived manifest design.
>>
>> (I've removed the pieces about an interactive manifest CLI on
>> the server side, as that needs to be a separate design.)
>>
>>
>> http://hub.opensolaris.org/bin/download/Project+caiman/DerivedManifests/DerivedManifestsDesignSpec.pdf
>>
>
> Already discussed these offline, but for the formal record:
>
> Introduction - It's probably tangential to this work, but it may be worth
> considering whether the criteria mechanism should be made usable on the
> bootable AI media, to assist with self-contained turnkey media installation
> solutions. Architecturally is there a reason why it shouldn't be usable?
>
> 5.2.4 Might want to clarify here that these are Python API's? Also, maybe
> "validate()" instead of "verify()" (and for the command argument in 5.2.5).
> Finally, how about making load() incremental, so blocks can be pulled in
> wholesale rather than constructed piecemeal with set()?
>
> 5.2.6 Aren't necessarily restricted to a script, are we? A Python or other
> executable would seem to be equally valid.
>
> 5.2.6.1 Ought to cover the principle ("full read, limited write") in the
> aiuser account authorizations.
>
> 5.2.7 The disk arrays seem clumsy to use; maybe ksh associative arrays would
> be better? Also, more on the rationale behind providing these variables as
> committed interfaces.
>
> Dave
>
> _______________________________________________
> caiman-discuss mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
>
--
, _ _ ,
{ \/`o;====- Olga Kryzhanovska -====;o`\/ }
.----'-/`-/ [email protected] \-`\-'----.
`'-..-| / Solaris/BSD//C/C++ programmer \ |-..-'`
/\/\ /\/\
`--` `--`
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss