OSF DCE Administration Guide--Core Components

OSF DCE Administration Guide—Core Components
# Show the time on all of the dts servers running in your cell.
proc _dcp_show_clocks {} {
set x [directory list /.:/hosts]
foreach n $x {
if {[catch {object show $n/dts-entity}] == 0} {
set index [string last "/" $n]
set y [string range $n [incr index] end]
if {[catch {clock show $n/dts-entity} msg] == 0} {
set i [expr 20 - [string length $y]]
puts [format "Time on $y is %${i}s %s"""\
[clock show $n/dts-entity]]
} else {
set i [expr 20 - [string length $y]]
puts [format "Time on $y is %${i}s %s"""\
"Server not responding."]
}
}
}
}
# Give some procs usable names
rename _dcp_whoami whoami
rename _dcp_show_clocks show_clocks
# If I am authorized, say so
if {$_u != ""} {
whoami
}
The rename command near the end of the file lets you invoke the _dcp_show_clocks
and _dcp_whoami procedures using the easier command names show_clocks and
whoami.
When you start dcecp, the last part of this file invokes the _dcp_whoami procedure if
you are logged into DCE. If the _u convenience variable is set, the _dcp_whoami
procedure prints your current login identity as follows:
% dcecp
You are ’ principal_name’ logged into ’ cell_name’.
dcecp>
1.8.2 AddingNew Objects to the DCE Control Program
If you have written a script as a formal dcecp object, you can make it available by
including the new object in the same directory where other task objects reside. On
UNIX systems, this is often dcelocal/dcecp. As a rule, you should add the new object to
each host in the DCE cell. Chapter 3 describes how you can use the dcecp hostdata
object to copy scripts or other files to every host in a cell.
1 18 Tandem Computers Incorporated 124243