Archive

Posts Tagged ‘perl’

Export OVO templates into xls file

June 8th, 2009 bayu 1 comment

Are you using HP OVO (Openview Operation)/ITO/OMU (Operation Manager for Unix) ? So you must be understand how hard to write a templates document, especially if you have hundreds or thousands templates in your environment .  This is a quick-and-dirty script I use, that similar to my previous released script, tpl2csv, but instead dumping the templates to csv file, this script will generate xls (Microsoft Excel) spreadsheet.

You need to have the node templates first before executing the tpl2xls.pl script, and also the templates has to be in a correct directory hierarchy. But don’t worry, I will also give you the script (gettemplates.pl) to download the templates in correct hierarchy.

The script needs John McNamara’s Spreadsheet-WriteExcel module, but it has been included inside the tpl2xls archive.

Please read terms of use before downloading the script(s)

Download

tpl2xls

tpl2xls-1.0.3


gettemplates

This script will download templates into tpl2xls-readable hierarchy. It reads a node list file like the one included in the package

gettemplates-1.0.2.pl.tar.gz

Categories: openview Tags: , , , , ,

Dump OVO templates into csv file

June 3rd, 2009 bayu No comments

Are you using HP OVO (Openview Operation)/ITO/OMU (Operation Manager for Unix) ? So you must be understand how hard to write a templates document, especially if you have hundreds or thousands templates in your environment .  I started a project to dump OVO templates into a csv file.

The script is in perl, so actually I can generate an Excel spreadsheet file directly but the script will need the spreadsheet perl module. To make it widely usable, i am going to make the script to only generates csv file. csv  files can later be imported to nearly any spreadsheet editor.

Update: If you want to dump/export the OVO templates into a well-formatted MS-Excel file, read this post instead.

You can freely use, modify, and share this script, just keep the attribution intact.

Please read terms of use before downloading the script(s)

Version 1.1.0

  • Unlike the initial build, this script includes downloading templates that has been assigned to nodes. Put node names inside the node list file separated by newlines. Now the script’s first argument is node list file instead of directory name.
  • Backward compatibility (perl 5.0) increased.
  • No longer using Getopt to grab options (to avoid dependency to getopt module)
  • Some minor changes.

tpl2csv-1.1.0.pl

Version 1.0.0

The initial release. The script will dump all templates files inside the specified directory into csv file.

tpl2csv-1.0.0.pl

Categories: openview Tags: , , , , ,

Linux: lowercasing the filenames

May 22nd, 2009 bayu No comments

I really hate uppercase when it comes to filenames. It’s really simple to translate words to lowercase using perl’s “tr”.

  my @FILES=`ls /path/to/bignames`;
  foreach my $line (@FILES){
    $line=trim($line);
 
  	if ($line ne "" && $line !~ /^./ && $line =~ /[A-Z]+/) {
  	  my $smalline = $line;
	    $smalline =~ tr/[A-Z]/[a-z]/;
      $out=`mv -v $line $smalline`;
    }

and this is the complete rename-to-lowercase script.

Please read terms of use before downloading the script(s)

Categories: linux Tags: , , , , ,

OVO: templates manipulation scripts

May 15th, 2009 bayu No comments

Custsomer is a king, they said. Well that’s true on a lot of cases. Lately the customer wants us to change all the templates we have built for 3 years! That’s mean I have to change hundreds of template group in which there are up to 40 monitors inside them. Doing it from the motif GUI seems going to broke my wrist. At least i might have to buy a new mouse because of those thousands clicks per second.

OVO has been shipped with some useful console tools, especially for managing the templates. I used these tools to help me do the job:

  1. /opt/OV/bin/OpC/utils/opcnode : to get info and manage nodes data, including assigned templates, assigning and de-assign templates, etc.
  2. /opt/OV/bin/OpC/utils/opctempl : to download, upload, and modify templates

It doesn’t give much help if I do it by hand, so  I write some scripts using those tools :

  • gettemplates.pl : to download templates and save it under each node names they are assigned to. It required one argument, the node list file. The downloaded templates will be used for other scripts. At the moment it only support monitor scripts under one group (because that’s all I needed at the moment).
  • modsevup.pl : to mass change a particular severity inside template. The script taking three arguments : template name, severity before,  and severity after.
  • modtextup.pl : to change the text of notifications inside a template. It will take two arguments: template name and message text.
  • addnormal.pl : to add normal condition into the template. Just modify the script as you needed.
  • standardise.pl : this is just the concatenation of modsevup.pl modtextup.pl and addnormal.pl. It will add normal condition

All of them will show you the changes that has made to the original file, and you will be prompted if you would to directly upload it to the OVO or not .

Download them and modify as you like, but please keep the attribution attached, or, you can always click the orange button on the bottom right side :D .

Switch to our mobile site