List VTERM parameters macro

Blue Bar separator

The purpose of this macro is to make it easier to debug the problem where a telnet_msd server reports that it cannot find any usable VTERMs that match its device properties of login/slave value, slave id string (reported as 'id = XXX' in the parameter string) and locker. It will display those values for all vterms that match the vterm_starname string given as an argument to the macro. It is not necessary to include the terminating asterix on the string, the macro does that for you.

Some examples:

Using the default star_name of telnet

                                                                                    
list_vterm_parameters
Device Information for %phx_vos#telnet_m15.1 locked by: Noah_Davids.CAC
login slave: 1
parameters:
Device Information for %phx_vos#telnet_m15.2 locked by:
login slave: 1
parameters:
Device Information for %phx_vos#telnet_m15.3 locked by:
login slave: 1
parameters:
Device Information for %phx_vos#telnet_m15.4 locked by:
login slave: 1
parameters:

Using the star name of vterm

                                                                                    
list_vterm_parameters vterm
Device Information for %phx_cac#vterm.2.1 locked by:
login slave: 1
parameters:
Device Information for %phx_cac#vterm.2.2 locked by:
login slave: 1
parameters:
Device Information for %phx_cac#vterm.2.3 locked by:
login slave: 1
parameters:
Device Information for %phx_cac#vterm.2.4 locked by:
login slave: 1
parameters:

                                                                                    
 ---------------------------- list_vterm_parameters --------------------------
 vterm_starname: telnet

list_vterm_parameters.cm

                                                                                
                                                                                    
& list_vterm_parameters begins here
&
& list_vterm_parameters.cm
& version 1.0 06-08-31
& version 1.1 10-11-26  Added disclaimer
& Noah Davids Stratus CAC noah.davids@stratus.com
&
& This software is provided on an "AS IS" basis, WITHOUT ANY WARRANTY OR ANY
& SUPPORT OF ANY KIND. The AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES
& OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.  This disclaimer
& applies, despite any verbal representations of any kind provided by the
& author or anyone else.
&
&begin_parameters
 VTERM_STARNAME vterm_starname:string=telnet
&end_parameters
&
&echo no_input_lines no_command_lines no_macro_lines
&
&if (process_type) ^= interactive
&then set_ready -format off
&attach_input
&set_string old_dir (current_dir)
change_current_dir (process_dir)
&
&
& save a list of all vterm devices in the file named map.
attach_default_output map
list_devices -type vterm
detach_default_output
&
&
& extract out just the devices that match the vterm_starname. Put a
& key string "END" at the end of the file so we know when to stop looping
display map -match &VTERM_STARNAME& -output_path map2 -no_header
attach_default_output map2 -append
display_line END
detach_default_output
&
&
& loop through the map2 file and for each device get the device info. Put
& all the results in map3.
&set line 1
attach_default_output map3
&while (contents map2 &line&) ^= 'END'
display_device_info (contents map2 &line&)
&set line (calc &line& + 1)
&end
display_line END
detach_default_output
&        
&
&set line 1
&while (contents map3 (calc &line&)) ^= 'END'
&set_string map3_line (contents map3 &line&)
&if (index (string &map3_line&) 'Device Information for %') = 0
&then &goto login_slave
attach_default_output map4
who_locked (substr (string &map3_line&) (index (string &map3_line&) #))
detach_default_output
&set_string user (substr (translate (contents map4 2) '{}' '()') 31)
&set_string user (substr (string &user&) 1 (index (string &user&) ' '))
display_line &map3_line& locked by: &user&
&goto skip
&
&label login_slave
&if (index (string &map3_line&) 'login slave:') = 0
&then &goto parameters
display_line &map3_line&
&goto skip
&
&label parameters
&if (index (string &map3_line&) 'parameters:') = 0
&then &goto skip
display_line &map3_line&
&
&label skip
&set line (calc &line& + 1)
&end
change_current_dir &old_dir&
&
& list_vterm_parameters ends here



Blue Bar separator
This page was last modified on 10-11-26
mailbox Send comments and suggestions
to ndav1@cox.net