home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / vmsnet / sources / 500 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  10.2 KB

  1. Path: sparky!uunet!ukma!gatech!news.byu.edu!hamblin.math.byu.edu!arizona.edu!mvb.saic.com!vmsnet-sources
  2. Newsgroups: vmsnet.sources
  3. Subject: another version of nodeinfo.com
  4. Message-ID: <10360362@MVB.SAIC.COM>
  5. From: mailrus!samsung!ulowell!aspen.ulowell.edu!welchb@uunet.UU.NET
  6. Date: Wed, 27 Jan 1993 21:58:04 GMT
  7. Followup-To: vmsnet.sources.d
  8. Organization: University of Lowell
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10. Lines: 217
  11.  
  12. Submitted-by: mailrus!samsung!ulowell!aspen.ulowell.edu!welchb@uunet.UU.NET
  13. Posting-number: Volume 4, Issue 55
  14. Archive-name: nodeinfo/part01
  15. Supersedes: nodeinfo: Volume 4, Issue 19,34
  16.  
  17. Yet another version of nodeinfo.com.  Stop me if you are all sick of this,
  18. or if it does not work for most sites.
  19. --
  20. Brendan Welch, UMass/Lowell, W1LPG,  welchb@woods.ulowell.edu
  21.  
  22. $! ------------------ CUT HERE -----------------------
  23. $ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
  24. $!
  25. $! This archive created by VMS_SHARE Version 8.2
  26. $!   On 27-JAN-1993 13:53:50.71   By user BERRYMAN
  27. $!
  28. $! The VMS_SHARE software that created this archive
  29. $!    was written by  Andy Harper, Kings College London UK
  30. $!    -- December 1992
  31. $!
  32. $! Credit is due to these people for their original ideas:
  33. $!    James Gray, Michael Bednarek 
  34. $!
  35. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  36. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  37. $!
  38. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  39. $!       1. NODEINFO.COM;1
  40. $!
  41. $set="set"
  42. $set symbol/scope=(nolocal,noglobal)
  43. $f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID"))
  44. $e="write sys$error  ""%UNPACK"", "
  45. $w="write sys$output ""%UNPACK"", "
  46. $ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
  47. $ ve=f$getsyi("version")
  48. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
  49. $ e "-E-OLDVER, Must run at least VMS 4.4"
  50. $ v=f$verify(v)
  51. $ exit 44
  52. $unpack: subroutine ! P1=filename, P2=checksum, P3=attributes
  53. $ if f$parse(P1) .nes. "" then $ goto dirok
  54. $ dn=f$parse(P1,,,"DIRECTORY")
  55. $ w "-I-CREDIR, Creating directory ''dn'"
  56. $ create/dir 'dn'
  57. $ if $status then $ goto dirok
  58. $ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
  59. $ delete 'f'*
  60. $ exit
  61. $dirok:
  62. $ x=f$search(P1)
  63. $ if x .eqs. "" then $ goto file_absent
  64. $ e "-W-EXISTS, File ''P1' exists. Skipped"
  65. $ delete 'f'*
  66. $ exit
  67. $file_absent:
  68. $ w "-I-UNPACK, Unpacking file ", P1
  69. $ n=P1
  70. $ if P3 .nes. "" then $ n=f
  71. $ if .not. f$verify() then $ define/user sys$output nl:
  72. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='n'
  73. PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
  74. SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;
  75. PROCEDURE SkipPartsep LOOP EXITIF MARK(NONE)=END_OF(b);EXITIF INDEX(ERASE_LINE,
  76. "-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE ProcessLine LOCAL c,s,l,b,
  77. n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF;
  78. MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);
  79. p := p+1;CASE c FROM ' ' TO '`' ['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[
  80. ' ']: p:=p+1;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
  81. PROCEDURE Decode POSITION(BEGINNING_OF(b));LOOP EXITIF MARK(NONE)=END_OF(b);
  82. IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine;
  83. MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(
  84. SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO(
  85. COMMAND_LINE,"file_name");b:=CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO(
  86. COMMAND_LINE,"output_file"));QUIT;
  87. $ if p3 .eqs. "" then $ goto dl
  88. $ open/write fdl &f
  89. $ write fdl "RECORD"
  90. $ write fdl P3
  91. $ close fdl
  92. $ w "-I-CONVRFM, Converting record format to ", P3
  93. $ convert/fdl=&f &f-1 &P1
  94. $dl: delete 'f'*
  95. $ checksum 'P1'
  96. $ if checksum$checksum .nes. P2 then $ -
  97.   e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  98. $ exit
  99. $ endsubroutine
  100. $start:
  101. $!
  102. $ create 'f'
  103. X$`20say`20:=`20write`20sys$output
  104. X$`20say`20"You`20are`20on`20a`20",`20f$getsyi("HW_NAME"),`20"`20named`20",`20f
  105. V$getsyi("NODENAME"),`20"."
  106. X$`20say`20"It`20was`20last`20booted`20on`20",`20f$getsyi("boottime"),"."
  107. X$`20say`20"This`20system`20has`20",`20f$getsyi("availcpu_cnt"),"`20cpu(s);"
  108. V`20-
  109. X`20,`20"`20",`20f$getsyi("activecpu_cnt"),"`20is/are`20active."
  110. X$`20if`20.not`20f$getsyi("cluster_member")
  111. X$`20then
  112. X$`20`20say`20"It`20is`20not`20a`20member`20of`20a`20VAXCluster."
  113. X$`20else
  114. X$`20`20say`20"It`20is`20a`20member`20of`20a`20VAXcluster`20containing`20"-
  115. X`20`20`20,`20f$getsyi("cluster_nodes"),"`20nodes."
  116. X$`20`20say`20"This`20VAXcluster`20has`20a`20total`20cluster`20quorum`20of`20"-
  117. V
  118. X`20`20`20,`20f$getsyi("cluster_quorum"),"`20votes,`20and`20"
  119. X$`20`20say`20"`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20",f$getsyi
  120. V("cluster_votes"),`20"`20total`20cluster`20vote(s)."
  121. X$`20`20say`20"This`20node's`20quorum`20value`20is`20",`20f$getsyi("node_quorum
  122. V")-
  123. X`20`20`20,"`20and`20it`20has`20",`20f$getsyi("node_votes"),"`20vote(s)."
  124. X$`20endif
  125. X$`20say`20"`20"
  126. X$`20say`20"We`20will`20now`20execute`20the`20equivalent`20of`20showing`20F$GET
  127. VSYI(*)"
  128. X$`20say`20f$getsyi("activecpu_cnt"),`20`20"`09`20`09`09=activecpu_cnt"
  129. X$`20say`20f$getsyi("availcpu_cnt"),`20`20"`09`20`09`09=availcpu_cnt"
  130. X$`20say`20f$getsyi("archflag"),`20`20`09`20"`09`20`09`09=archflag"
  131. X$`20say`20f$getsyi("boottime"),`20`20`09`20"`09=boottime"
  132. X$`20say`20f$getsyi("character_emulated"),`20`09`20"`09`20`09`09=character_emul
  133. Vated"
  134. X$`20say`20f$getsyi("contig_gblpages"),`20`09`20"`20`09`09`09=contig_gblpages"
  135. X$`20say`20f$getsyi("cpu"),`20`20`09`20"`09`20`09`09=cpu"
  136. X$`20say`20f$getsyi("decimal_emulated"),`20`09`20"`09`20`09`09=decimal_emulated
  137. V"
  138. X$`20say`20f$getsyi("d_float_emulated"),`20`09`20"`09`20`09`09=d_float_emulated
  139. V"
  140. X$`20say`20f$getsyi("f_float_emulated"),`20`09`20"`09`20`09`09=f_float_emulated
  141. V"
  142. X$`20say`20f$getsyi("free_gblpages"),`20`09`20"`09`20`09`09=free_gbl_pages"
  143. X$`20say`20f$getsyi("free_gblsects"),`20`09`20"`09`20`09`09=free_gbl_sects"
  144. X$`20say`20f$getsyi("g_float_emulated"),`20`09`20"`09`20`09`09=g_float_emulated
  145. V"
  146. X$`20say`20f$getsyi("pagefile_free"),`20`09`20"`09`20`09`09=pagefile_free"
  147. X$`20say`20f$getsyi("pagefile_page"),`20`09`20"`09`20`09`09=pagefile_page"
  148. X$`20say`20f$getsyi("sid"),`20`20`09`20"`09`20`09=sid"
  149. X$`20say`20f$getsyi("swapfile_free"),`20`09`20"`09`20`09`09=swapfile_free"
  150. X$`20say`20f$getsyi("swapfile_page"),`20`09`20"`09`20`09`09=swapfile_page"
  151. X$`20say`20f$getsyi("version"),`20`20`09`20"`09`20`09=version"
  152. X$`20say`20"`20"
  153. X$`20say`20f$getsyi("cluster_fsysid"),`20`20"`09`20`09=cluster_fsysid"
  154. X$`20say`20f$getsyi("cluster_ftime"),`20`20`20"`09`20=cluster_ftime"
  155. X$`20say`20f$getsyi("cluster_member"),`20`20"`09`09`09`20=cluster_member"
  156. X$`20say`20f$getsyi("cluster_nodes"),`20`20`20"`09`09`09`20=cluster_nodes"
  157. X$`20say`20f$getsyi("cluster_quorum"),`20`20"`09`09`09`20=cluster_quorum"
  158. X$`20say`20f$getsyi("cluster_votes"),`20`20`20"`09`09`09`20=cluster_votes"
  159. X$`20say`20f$getsyi("hw_model"),`20`20`20`20`20`20`20`20"`09`09`09`20=hw_model"
  160. V
  161. X$!`20hw_model`20>`201023`20is`20an`20ALPHA;`20otherwise`20VAX
  162. X$`20say`20f$getsyi("hw_name"),`20`20`20`20`20`20`20`20`20"`09`09`20=hw_name"
  163. X$`20say`20f$getsyi("nodename"),`20`20`20`20`20`20`20`20"`09`09`09`20=nodename"
  164. V
  165. X$`20nn`20=`20f$getsyi("nodename")`09!`20for`20use`20below
  166. X$`20say`20f$getsyi("node_area"),`20`20`20`20`20`20`20"`09`09`09`20=node_area"
  167. X$`20say`20f$getsyi("node_csid"),`20`20`20`20`20`20`20"`09`09`20=node_csid"
  168. X$`20say`20f$getsyi("node_hwtype"),`20`20`20`20`20"`09`09`09`20=node_hwtype"
  169. X$`20say`20f$getsyi("node_hwvers"),`20`20`20`20`20"`09=node_hwvers"
  170. X$`20say`20f$getsyi("node_number"),`20`20`20`20`20"`09`09`09`20=node_number"
  171. X$`20say`20f$getsyi("node_quorum"),`20`20`20`20`20"`09`09`09`20=node_quorum"
  172. X$`20say`20f$getsyi("node_swincarn"),`20`20`20"`09`20=node_swincarn"
  173. X$`20say`20f$getsyi("node_swtype"),`20`20`20`20`20"`09`09`09`20=node_swtype"
  174. X$`20say`20f$getsyi("node_swvers"),`20`20`20`20`20"`09`09`09`20=node_swvers"
  175. X$`20say`20f$getsyi("node_systemid"),`20`20`20"`09`20=node_systemid"
  176. X$`20say`20f$getsyi("node_votes"),`20`20`20`20`20`20"`09`09`09`20=node_votes"
  177. X$`20say`20f$getsyi("scs_exists"),`20`20`20`20`20`20"`09`09`09`20=scs_exists"
  178. X$`20say`20f$getsyi("system_rights"),`20`20`20"`09`20=system_rights"
  179. X$`20say`20f$getsyi("vector_emulator"),`20"`09`09`09`20=vector_emulator"
  180. X$`20say`20f$getsyi("vp_mask"),`20`20`20`20`20`20`20`20`20"`09`09`09`20=vp_mask
  181. V"
  182. X$`20say`20f$getsyi("vp_number"),`20`20`20`20`20`20`20"`09`09`09`20=vp_number"
  183. X$`20say`20"================================================================="
  184. X$`20say`20"We`20will`20now`20execute`20`20$SHOW`20CPU/FULL"
  185. X$`20on`20error`20then`20continue
  186. X$`20show`20cpu/full
  187. X$`20say`20"================================================================="
  188. X$`20say`20"We`20will`20try`20to`20show`20Internet`20address."
  189. X$!`20Another`20way`20would`20be`20to`20telnet`20to`20nn`20(which`20gives`20its
  190. V`20address),`20then
  191. X$!`20ctrl-`5D,`20then`20`20exit
  192. X$!`20and`20another`20way`20would`20be`20$`20ucx`20show`20host`20'nn',`20where
  193. V`20nn`20was`20saved`20above.
  194. X$`20ucx`20show`20host`20'f$trnlnm("ucx$inet_host")
  195. X$!Last`20line`20suggested`20by`20Shawn`20Clifford.
  196. X$`20say`20"================================================================="
  197. X$`20say`20"We`20will`20try`20to`20show`20DECnet`20Physical`20Working`20Etherne
  198. Vt`20address."
  199. X$`20mcr`20ncp`20show`20exec`20stat
  200. X$`20say`20"================================================================="
  201. X$`20say`20"We`20will`20try`20to`20show`20Hardware`20Ethernet`20address."
  202. X$!`20Obtain`20line`20from`20$mcr`20ncp`20sho`20kno`20line
  203. X$assign/user`20nodeinfoscratch.`20sys$output
  204. X$mcr`20ncp`20sho`20kno`20line
  205. X$!
  206. X$open/read`20scratch`20nodeinfoscratch.`09!attempting`20to`20rewind`20the`20fi
  207. Vle
  208. X$close`20scratch`09`09`09`09!attempting`20to`20rewind`20the`20file
  209. X$!
  210. X$open/read`20scratch`20nodeinfoscratch.
  211. X$recno=0
  212. X$readloop:
  213. X$read`20scratch`20rec
  214. X$write`20sys$output`20rec
  215. X$recno`20=`20recno`20+`201
  216. X$if`20recno`20.ne.`207`20`20then`20goto`20readloop
  217. X$knownline`20=`20f$extract(2,5,rec)`09!gets`20name`20like`20BNA-0`20on`20our
  218. V`20system
  219. X$sho`20sym`20knownline
  220. X$`20`20`20`20`20`20`20`20`20`20mcr`20ncp`20sho`20line`20'knownline`20char
  221. X$done:
  222. X$delete`20nodeinfoscratch..*
  223. X$`20say`20"================================================================="
  224. X$`20say`20"We`20will`20try`20to`20show`20node`20characteristics."
  225. X$`20mcr`20ncp`20show`20node`20'nn`20char
  226. $ call unpack NODEINFO.COM;1 1617715488 ""
  227. $ v=f$verify(v)
  228. $ exit
  229.