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
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
When the RemedySPI is not running, and you can’t start it anymore, it might be caused by an unmatched password of opc_adm inside remspi configuration.
Check the remspi log :
tail /var/opt/OV/log/remspi/remspi.log
If you found anywhere in the log says :
05/28/2009 11:05:25 [ERROR] (remspisrv-16080): Can’t connect to ITO as user ‘opc_adm’: ‘No login’. Not a typewriter (SPI215-51)
then most likely the opc_adm user had changed his password.
To fix it, modify the REMSPI_ITO_ADMIN_PASSWD value inside configuration file
/etc/opt/OV/share/conf/remspi/remspi.cfg
The encrypted password has to be generated manually, using
/opt/OV/bin/remspi/remspipasswd <password>
I always forget this 
/var/opt/OV/share/databases/OpC/mgd_node/customer/
This is the path to the place where you can put your own scripts to be used in templates. Depends on the target system, you have to put the correct version of scripts under the correct operating system.
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:
- /opt/OV/bin/OpC/utils/opcnode : to get info and manage nodes data, including assigned templates, assigning and de-assign templates, etc.
- /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
.
To assign and distribute templates from the command line, use these tools:
Assign a template to a node
# /opt/OV/bin/opcnode -assign_templ templ_name=<template name> templ_type=<template type> node_name=<node name> net_type=NETWORK_IP
template type can be one of the following:
TEMPLATE_GROUP
CONSOLE_TEMPLATE
OPCMSG_TEMPLATE
LOGFILE_TEMPLATE
MONITOR_TEMPLATE
SNMP_TEMPLATE
EC_TEMPLATE
SCHEDULE_TEMPLATE
Assign a template to a node group
#/opt/OV/bin/opcnode -assign_templ templ_name=<template name> templ_type=<template type> group_name=<group name>
Distribute template
#/opc/OV/bin/opcragt -distrib -templates -monitors -commands -actions -force <hostname>
you don’t have to specify all of the template types at once.
Viewing deployed templates on the node
#/opt/OV/bin/ovpolicy -list -host <node name>
It doesn’t have to do this way, but I like doing this way, because it also cleans the old database and policies to avoid any problem.
- Delete installed policies
# /opt/OV/bin/ovpolicy -remove -poltype/polname
- Shutdown all agent services including ovcd and ovbbccb
# /opt/OV/bin/ovc -kill
- Delete previous data
# rm /var/opt/OV/datafiles/coda*
- Remove messages queue
# rm -r /var/opt/OV/tmp/OpC/*
- delete the old certificate that has been used for communicating with the old management server
#/opt/OV/bin/ovcert -remove <cert_id>
- Configure agent to be a managed node of the new management serve
r#/opt/OV/bin/OpC/install/ovcactivate -srv <srv>
At the new management server :
Add the new node and grant certificate request (you probably need to map the node to the certificate request)