nv-l
[Top] [All Lists]

RE: [nv-l] Rebuilding the default smartsets/collections

To: "'nv-l@lists.tivoli.com'" <nv-l@lists.tivoli.com>
Subject: RE: [nv-l] Rebuilding the default smartsets/collections
From: bernard.baudoux@fortisbank.com
Date: Mon, 25 Nov 2002 08:44:48 +0100
Chris,

here are two scripts of mine I wrote to easily 'backup' and 'restore' the 
smartsets definitions.   The first one (backup) is GetSmatsetCfg.pl, the seconf 
one (restore) is MakeSmartsetCfg.pl.   You can schedule GetSmatsetCfg.pl in a 
crontab to make sure you always have the last version of your smarsets.

GetSmatsetCfg.pl
=============

#-- begin of script
#!/usr/local/bin/perl -w

@ListSmartsets = `/usr/OV/bin/nvUtil L`;

foreach $smartset (@ListSmartsets)
 {
   chomp($smartset);
   `/usr/OV/bin/nvUtil g $smartset > ./cfg/$smartset`;
 }
#--End of script

MakeSmartsetCfg.pl
===============

#-- Begin of script
#!/usr/local/bin/perl -w

@ListSmartsets = `ls ./cfg/*`;

foreach $item (@ListSmartsets)
 {
  chomp($item);
  ($foo, $foo, $smartset) = split(/\//, $item);
  @Config = `cat $item`;
  foreach $cfg (@Config)
   {
    chomp($cfg);
    $pos = index($cfg, 'SmartSet:');
    if ($pos != -1)
      {
        $name = substr($cfg, $pos+10);
      }
    $pos = index($cfg, 'Description:');
    if ($pos != -1)
      {
        $descr = substr($cfg, $pos+13);
      }
    $pos = index($cfg, 'Rule:');
    if ($pos != -1)
      {
        $rule =  substr($cfg, $pos+6);
      }
   }
  `/usr/OV/bin/nvUtil a \"$name\" \"$descr\" \"$rule\"`;
 }
#-- End of script


Hope this can help,
Bernard Baudoux,
Fortis Banque.



> -----Original Message-----
> From: Cowan, Christopher [SMTP:Christopher_Cowan@sra.com]
> Sent: vendredi 22 novembre 2002 16:53
> To:   'nv-l@lists.tivoli.com'
> Subject:      [nv-l] Rebuilding the default smartsets/collections
> 
> Is there a script or template somewhere within the NV 7.1.x for UNIX
> products for rebuilding the default Smart Sets or Collections?    I thought
> I remembered there was, but I can't find the script if it exists.    
> 
> --
> Chris Cowan
> Sr. ESM Consultant
> SRA International
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: nv-l-unsubscribe@lists.tivoli.com
> For additional commands, e-mail: nv-l-help@lists.tivoli.com
> 
> *NOTE*
> This is not an Offical Tivoli Support forum. If you need immediate
> assistance from Tivoli please call the IBM Tivoli Software Group
> help line at 1-800-TIVOLI8(848-6548)


This email and any attached files are confidential and may be legally 
privileged.
If you are not the intended recipient, any disclosure, reproduction, 
copying, distribution, or other dissemination or use of this communication 
is strictly prohibited.  
If you have received this transmission in error please notify the sender 
immediately and then delete this email.
Email transmission cannot be guaranteed to be secure or error free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses.  
The sender therefore is in no way liable for any errors or omissions in the 
content of this message, which may arise as a result of email transmission. 
If verification is required, please request a hard copy.



<<application/ms-tnef>>

<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web