# DCovms.ctl:140:Collects Oracle VM Server Information # $Id: DCovms.ctl,v 1.7 2013/12/16 07:59:41 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/DCovms.ctl,v 1.7 2013/12/16 07:59:41 RDA Exp $ # # Change History # 20131212 KRA Fix spell. =head1 NAME OS:DCovms - Collects Oracle VM Server Information =head1 DESCRIPTION This module collects information about Oracle VM Server. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing OS.OVMS module ...',tput('off') # Initialization var $AGE = ${R_AGE/T:15} var $TAIL = ${DFT.N_TAIL:1000} var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle VM Server' # Load common macros run RDA: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 (centralized 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,' ',quote($itm)))) call get_data($x_l,$x_r,join($sep,$itm,$sub),'/') if $sep {var ($val) = command(concat($x_r," ",quote($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 (findDir('/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(quote($cmd),' ',quote($fil))) write $TOP } if hasOutput(true) toc '2:[[',getFile(),'][rda_report][Database File Information]]' } =head2 xentop - Xen VM Resources Information Collects 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 Collects 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 the 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,findDir($dir,'^[\.]+$','vr')) call statDir('an',$fil) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Files from /OVS directory]]' } =head2 Configuration Files Gathers configuration files from 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 from 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. =item RDA 8.02: Rick Williams. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut