# S140OVMS.def: Collects Oracle VM Server Information # $Id: S140OVMS.def,v 1.13 2009/05/18 07:09:24 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S140OVMS.def,v 1.13 2009/05/18 07:09:24 mschenke Exp $ # # Change History # 20090518 DEM Make search for db_dump.py more selective. =head1 NAME S140OVMS - Collects Oracle VM Server Information =head1 DESCRIPTION This module collects information about Oracle VM Server. The following reports can be generated and are regrouped in C: =cut echo tput('bold'),'Processing Oracle VM Server module ...',tput('off') # Initialization var $TAIL = getSetting('RDA_TAIL',1000) var $AGE = getSetting('OVMS_AGE',15) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle VM Server' # Load common macros run library() =head2 xm_info - C Gathers C output. =cut if findCommand('xm') {var $pgm = last var $cmd = concat($pgm,' info') debug ' Inside OVMS module, getting xm info information' report xm_info prefix {write '---+ xm info' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][xm info]]' } =head2 xm_list - C Gathers C output. =cut var $cmd = concat($pgm,' list -l') debug ' Inside OVMS module, getting xm list information' report xm_list prefix {write '---+ xm list' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][xm list]]' } } =head2 xenstore - Xenstore Information Xenstore is an information storage space (centralised configuration database) that is shared between Oracle VM domains. RDA collects this information using the C and C commands. =cut debug ' Inside OVMS module, getting xenstore information' macro get_data {var ($x_l,$x_r,$itm,$sep) = @arg loop $sub (command(concat($x_l,' ',$itm))) call get_data($x_l,$x_r,join($sep,$itm,$sub),'/') if $sep {var ($val) = command(concat($x_r," ",$itm)) if !match($val,'^\(') write '|',$itm,' |',$val,' |' } } report xenstore prefix {write '---+ Xenstore Information' write '---## Using: xenstore-list and xenstore-read' write '|*Key*|*Value*|' } if findCommand('xenstore-list') call get_data(last,findCommand('xenstore-read'),'/','') if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Xenstore Information]]' } =head2 datafile - Database File Information Collects the database file information for all C<*.db> files located in F directory, using the C command. =cut debug ' Inside OVMS module, gathering database file information' var $cmd = undef loop $dir (grepDir('/opt','^ovs-agent','p')) {if testFile('x',catFile($dir,'db','db_dump.py')) var $cmd = lastFile() } if $cmd {report datafile prefix {write '---+!! Database File Information' write $TOC } loop $fil (grepDir('/etc/ovs-agent/db','\.db$','n')) {write '---+ Information from ',$fil write '---## Using: ',$cmd,' ',$fil call writeCommand(concat($cmd,' ',$fil)) write $TOP } if hasOutput(true) toc '2:[[',getFile(),'][rda_report][Database File Information]]' } =head2 xentop - Xen VM Resources Information Collect the Xen VM resources information using the C command. =cut debug ' Inside OVMS module, Xen VM resources information' report xentop prefix {write '---+ Xen VM Resources Information' write '---## Using: xentop -b -i 1 -n -x -v' } if findCommand('xentop') call writeCommand(concat(last,' -b -i 1 -n -x -v')) if hasOutput(true) toc '2:[[',getFile(),'][rda_report][Xen VM Resources Information]]' =head2 bridge - Bridge Configuration Collect the bridge configuration using the C command. =cut debug ' Inside OVMS module, getting bridge configuration' report bridge prefix {write '---+ Bridge Configuration' write '---## Using: brctl show' } if findCommand('brctl') call writeCommand(concat(last,' show')) if hasOutput(true) toc '2:[[',getFile(),'][rda_report][Bridge Configuration]]' =head2 ovs_files - Files from C directory Reports the content of C directory. =cut debug ' Inside OVMS module, list files from /OVS directory' var $dir = '/OVS' if testDir('d',$dir) {report ovs_files write '---+!! File list from /OVS Directory' loop $fil ($dir,grepDir($dir,'^[\.]+$','vr')) {if testDir('d',$fil) call statDir('an',$fil) } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Files from /OVS directory]]' } =head2 Configuration Files Gathers configuration files in the following directory structure: =over 4 =item o All files from F =item o All files from F =item o All files from F =item o All files from F =item o File F =item o File F =item o File F from F directory =back =cut debug ' Inside OVMS module, collecting the configuration files' pretoc '2:Configuration Files' call sort_files(3,0,\ '/etc/ovs-info',\ '/etc/ovs-release',\ grepDir('/etc/xen','^\.+$','vp'),\ grepDir('/etc/ovs','^\.+$','vp'),\ grepDir('/etc/ovs-agent','^\.+$','vp'),\ grepDir('/etc/xen/scripts','^\.+$','vp'),\ grepDir('/OVS','vm.cfg','r')) unpretoc =head2 Log Files Gathers log files in the following directory structure: =over 4 =item o F =item o F =back =cut debug ' Inside OVMS module, collecting the log files' pretoc '2:Log Files' call sort_files(3,$TAIL,\ grepDir('/var/log/xen','^\.+$',concat('vrm',$AGE)),\ grepDir('/var/log/ovs-agent','^\.+$',concat('vrm',$AGE))) unpretoc 2 =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.11: Guido Tijskens. =item RDA 4.15: Soren Binner. =item RDA 4.16: Shinya Narahara, Takeshi Watanabe. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut