[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

3673.0. "Synoptics launchable from DECmcc ULTRIX .." by TOOK::FLETCHER () Wed Sep 02 1992 12:24

DECmcc has the ability to launch loosely coupled applications from it's 
iconical interface.  These applications appear as pushbutton entries 
off the DECmcc Applications pulldown menu.  The DECmcc Iconic Map has
the ability to pass information to the application via a datafile.  The
datafile, produced in the user's current directory, contains the following
DECmcc map window context information:  domain, map file name, and all selected 
entities.

The user MUST define the environment variable LNMSHOME in the window from 
which the DECmcc Iconic Map is invoked.  

THE FOLLOWING ASSUMES that the Synoptics software exists in /usr/lnms.  If it doesn't
change the mcc_resource.dat definitions to use the appropriate path.

The user can add the Synoptics Expanded View application to their DECmcc map 
window by simply adding/modifying the following lines to their private 
mcc_resource.dat file.

mcc_pml.applications:DECmcc FCL,...,Synoptics Expanded View,Synoptics Ring View
mcc_pml.applications.Synoptics Expanded View.ultrix_command:/usr/lnms/mcc_synoptics_ev.csh <DF> 
mcc_pml.applications.Synoptics Ring View.ultrix_command:/usr/lnms/mcc_synoptics_rv.csh <DF> 

o  The first line actually lists (separated by commas) all launched applications 
   to placed in the Applications pulldown menu.   Also, notice that the phrasing
   used to define the launched application appears verbatum in the pulldown 
   menu.  In essence, "Synoptics Expanded View" will be the pushbutton entry of the
   Application's  pulldown menu.  The "Synoptics Ring View" pushbutton shall also
   appear in the Application's pulldown menu.

o  The second (and third) line defines the ULTRIX command used to invoke the 
   application.  Notice the "<DF>".  This flag tells DECmcc to produce a datafile 
   and pass the datafile name to the C-Shell mcc_synoptics_ev.csh and 
   mcc_synoptics_rv.csh.

More information regarding launching applications through DECmcc can be obtained
in the DECmcc Use Manual.

The C-Shell scripts mcc_synoptics_ev.csh and mcc_synoptics_rv.csh simply receive
the launched application datafile and extracts the list of selected SNMP entities.  
From this list, the scripts determine the read and write community strings, then 
invokes a Synoptics Expanded View (or Ring View) application for each selected 
SNMP entity.  The script creates and appends to a community string file
/usr/lnms/community.  The format of the file is simply:

ip read_community_string write_community_string


The following two replies shall contain the expanded and ring view Cshells.  It is intended
that Synoptics shall distribute these scripts within their kit and their release notes shall
discuss integration with DECmcc (as above).
T.RTitleUserPersonal
Name
DateLines
3673.1mcc_synoptics_ev.cshTOOK::FLETCHERWed Sep 02 1992 12:25128
#!/bin/csh 
#
#	mcc_synoptics.csh
#
# Digital Equipment Corporation, 1992.
#
# Software Product Group
# Open Network Systems Engineering 
# Network Management Systems
#
# Description:
#
#  This is C-Shell script to invoke the Synoptics Expanded View for all
#  selected entities on a DECmcc Iconical Map.
#
# Parameters:
#
#   $1 is the name of the Launch Application Datafile
#
# Dependencies:
#   Synoptics Expanded View Environment variable LNMSHOME points to Synoptics 
#    Expanded View's top_level directory.
#
#
# Set up some variables.
#
@ DELAY = 20
set LNMS_DIR = `printenv LNMSHOME`
if ($LNMS_DIR == "") then
   echo "Synoptics Expanded View Application invokation requires"
   echo " LNMSHOME to point to Synoptics Expanded View top_level directory."
   sleep $DELAY
   exit 1
endif
#
# File containing IP community strings.
#  Format:  IP_address read_community write_community
#
set COMMUNITY_FILE = $LNMS_DIR/community
#
# Get application launch datafile from DECmcc
#
set DATAFILE = $1
if ($DATAFILE == "") then
   echo "No datafile passed.  Exiting"
   sleep $DELAY
   exit 1
endif
#
# Get list of selected SNMP entities from launch application datafile.
#
set IPs = `cat $DATAFILE | awk '$1 == "SENTITY:" && $2 == "SNMP" {print $6}'`
set Hosts = `cat $DATAFILE | awk '$1 == "SENTITY:" && $2 == "SNMP" {print $8}'`
#
# If there are NO selected SNMP entities, exit.
#
if ($#IPs == 0) then
   echo "NO SNMP Entities were selected.  Exiting."
   sleep $DELAY
   exit 0
endif
#
@ i = 0
#
# Start up Expanded View for each selected SNMP entity.
#
foreach ip ($IPs)
#
   set host = ($Hosts)
   @ i++
#
#  Get community string for read and write for each IP.
#   If community file does NOT exist, prompt user for
#    information and write it to new file.
  set read_comm = `grep $ip $COMMUNITY_FILE | awk '{print $2}'`
  set write_comm = `grep $ip $COMMUNITY_FILE | awk '{print $3}'`
#
# If EITHER are not found then MUST ask user to enter manually.
#  Because we just don't know for sure which one was mistakenly
#  removed from the file.
#
  while ($read_comm == "")
    echo -n "ENTER read community string for SNMP entity ($ip): "
    set read_comm = $<
  end
#
  if ($write_comm == "") then 
     echo -n "ENTER write community string for SNMP entity ($ip) [unknown]: "
     set ans = $<
     if ($ans != "") set write_comm = $ans
  endif  
#
  grep $ip $COMMUNITY_FILE >> /dev/null
  if ($status == 1) then
     echo "$ip $read_comm $write_comm" >> $COMMUNITY_FILE
  endif       
#
# Invoke Synoptics Expanded View depending on availability of write community string.
#  Inform user that when write_community is found in $COMMUNITY_FILE, application
#  will be invoked with write permissions.
#
  if ($write_comm == "") then
     echo "Synoptics Expanded View invoked for SNMP entity $ip read-only."
     echo "  If read-write required, edit $COMMUNITY_FILE and ensure entry states "
     echo "    ip_address read_community write_community."
     echo ""
     $LNMS_DIR/bin/ev -H $host -I $ip -R $read_comm -P $LNMS_DIR &
  else 
    $LNMS_DIR/bin/ev -H $host -I $ip -R $read_comm -W $write_comm -P $LNMS_DIR &
  endif
end

sleep $DELAY

exit





 







3673.2mcc_synoptics_rv.cshTOOK::FLETCHERWed Sep 02 1992 12:25128
#!/bin/csh 
#
#	mcc_synopticsi_rv.csh
#
# Digital Equipment Corporation, 1992.
#
# Software Product Group
# Open Network Systems Engineering 
# Network Management Systems
#
# Description:
#
#  This is C-Shell script to invoke the Synoptics Ring View for all
#  selected entities on a DECmcc Iconical Map.
#
# Parameters:
#
#   $1 is the name of the Launch Application Datafile
#
# Dependencies:
#   Synoptics Ring View Environment variable LNMSHOME points to Synoptics 
#    Ring View's top_level directory.
#
#
# Set up some variables.
#
@ DELAY = 20
set LNMS_DIR = `printenv LNMSHOME`
if ($LNMS_DIR == "") then
   echo "Synoptics Ring View Application invokation requires"
   echo " LNMSHOME to point to Synoptics Ring View top_level directory."
   sleep $DELAY
   exit 1
endif
#
# File containing IP community strings.
#  Format:  IP_address read_community write_community
#
set COMMUNITY_FILE = $LNMS_DIR/community
#
# Get application launch datafile from DECmcc
#
set DATAFILE = $1
if ($DATAFILE == "") then
   echo "No datafile passed.  Exiting"
   sleep $DELAY
   exit 1
endif
#
# Get list of selected SNMP entities from launch application datafile.
#
set IPs = `cat $DATAFILE | awk '$1 == "SENTITY:" && $2 == "SNMP" {print $6}'`
set Hosts = `cat $DATAFILE | awk '$1 == "SENTITY:" && $2 == "SNMP" {print $8}'`
#
# If there are NO selected SNMP entities, exit.
#
if ($#IPs == 0) then
   echo "NO SNMP Entities were selected.  Exiting."
   sleep $DELAY
   exit 0
endif
#
@ i = 0
#
# Start up Ring View for each selected SNMP entity.
#
foreach ip ($IPs)
#
   set host = ($Hosts)
   @ i++
#
#  Get community string for read and write for each IP.
#   If community file does NOT exist, prompt user for
#    information and write it to new file.
  set read_comm = `grep $ip $COMMUNITY_FILE | awk '{print $2}'`
  set write_comm = `grep $ip $COMMUNITY_FILE | awk '{print $3}'`
#
# If EITHER are not found then MUST ask user to enter manually.
#  Because we just don't know for sure which one was mistakenly
#  removed from the file.
#
  while ($read_comm == "")
    echo -n "ENTER read community string for SNMP entity ($ip): "
    set read_comm = $<
  end
#
  if ($write_comm == "") then 
     echo -n "ENTER write community string for SNMP entity ($ip) [unknown]: "
     set ans = $<
     if ($ans != "") set write_comm = $ans
  endif  
#
  grep $ip $COMMUNITY_FILE >> /dev/null
  if ($status == 1) then
     echo "$ip $read_comm $write_comm" >> $COMMUNITY_FILE
  endif       
#
# Invoke Synoptics Ring View depending on availability of write community string.
#  Inform user that when write_community is found in $COMMUNITY_FILE, application
#  will be invoked with write permissions.
#
  if ($write_comm == "") then
     echo "Synoptics Ring View invoked for SNMP entity $ip read-only."
     echo "  If read-write required, edit $COMMUNITY_FILE and ensure entry states "
     echo "    ip_address read_community write_community."
     echo ""
     $LNMS_DIR/bin/rv_tr -H $host -I $ip -R $read_comm -P $LNMS_DIR &
  else 
    $LNMS_DIR/bin/rv_tr -H $host -I $ip -R $read_comm -W $write_comm -P $LNMS_DIR &
  endif
end

sleep $DELAY

exit





 







3673.3MSE1::RAOSat Apr 01 1995 00:175
     The two files that are called from mcc_synoptics_ev.csh and 
    mcc_synoptics_ev.csh (/bin/ev and /bin/rv), are they part of
     synoptics software or DECmcc software
    
     Radha