Home > openview > OVO: templates manipulation scripts

OVO: templates manipulation scripts

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 .

  1. No comments yet.
  1. No trackbacks yet.

Switch to our mobile site