# S491NCC.def: Collects Network Charging and Control Information # $Id: S491NCC.def,v 1.3 2012/07/24 13:11:45 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S491NCC.def,v 1.3 2012/07/24 13:11:45 mschenke Exp $ # # Change History # 20120718 KRA Extend collection. =head1 NAME S491NCC - Collects Network Charging and Control Information =head1 DESCRIPTION This module collects information related to Network Charging and Control. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut use Mrc echo tput('bold'),'Processing NCC module ...',tput('off') # Initialization var $HOME = getSetting('NCC_HOME','/IN/service_packages') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' toc '1:Network Charging and Control' # Set the NCC symbols call setSymbol('$NCC_BASE','/IN') call setSymbol('$NCC_HOME',$HOME) =head2 abbr - Abbreviations Displays the RDA abbreviations defined for the Network Charging and Control home collection. =cut debug ' Inside NCC module, collecting defined abbreviations' report abbr prefix {write '---+ Network Charging and Control Home Abbreviations' write '|*Abbreviation*|*Location*|' } var %hsh = getSymbols() loop $key (keys(%hsh)) write '|',$key,' |',catDir(@{$hsh{$key}}),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Abbreviations]]' =head2 dbinfo - Database Information Collects Oracle Database information. =cut if getSetting('NCC_DB') {run DBinfo() # Change the database context if getSetting('NCC_SID') {var $sid = last var $usr = uc(getSetting('NCC_LOGIN','SMF')) # Determine the user password if compare('eq',$usr,'/') var ($usr,$pwd) = ('','') elsif hasSqlPassword($usr,$sid) var $pwd = undef else var $pwd = askPassword(concat('Enter ',$usr,'@',$sid,' user password:')) # Change the current user var $old = setSqlLogin($usr,$pwd,$sid) # If requested, change the database context if getSetting('NCC_SWITCH') var $env = setSqlSid($sid) else var $env = undef var $try = setSqlFailure(0) } else {var $sid = undef # Disable the database access var $env = undef var $old = setSqlLogin('','') var $try = setSqlFailure(-1) } # Test the database connection and collect information debug ' Inside NCC module, getting database information' report dbinfo if testSql() {echo '' echo tput('bold'),'The database is not accessible.',tput('off') if getSqlMessage() {echo last write '---+!! Database Information' write $TOC write 'Database not accessible (',getSqlMessage(),')' toc '2:[[',getFile(),'][rda_report][Database Information]]' } echo '' } else {var $TTL = '---+!! Database Information' var @TTL = ('',\ '---+ Replication Node Numbers',\ '---+ Replication Node Target') var @HDR = ('',\ '| *Node Number*|*IP Address Primary*|*IP Address Secondary*|\ *Description*|',\ '| *Node Number*|*Group Name*|') set $sql {SELECT '| ' || " node_number || '|' || " ip_addr_prim || ' |' || " ip_addr_sec || ' |' || " description || ' |' " FROM rep_cnf_node " ORDER BY node_number; "PROMPT ___Macro_separator(2)___ "SELECT '| ' || " node_number || '|' || " group_name || ' |' " FROM rep_cnf_target " ORDER BY node_number,group_name; } call separator(1) call writeSql($sql) call separator(0,'Database Information') } # Restore the previous context if defined($env) call setSqlSid($env) call setSqlLogin($old) call setSqlFailure($try) } =head2 Multi-run Collections Collects Network Charging and Control-related information from both current user and super user. =cut collect M130NCC|NCC($usr,$pwd) =head1 SEE ALSO L, L, L =begin credits =over 10 =item RDA 4.27: Pierre Lecomte, Wim Rydant. =item RDA 4.28: Pierre Lecomte, Januar Simarmata. =item RDA 4.29: Pierre Lecomte. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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