$ ! $ ! File name: TCPIP$EXTENSION_MIB_SHUTDOWN.COM $ ! Product: HP TCP/IP Services for OpenVMS $ ! Version: V5.7-13 $ ! $ ! © Copyright 1976, 2009 Hewlett-Packard Development Company, L.P. $ ! $ ! Confidential computer software. Valid license from HP and/or its $ ! subsidiaries required for possession, use, or copying. $ ! $ ! Consistent with FAR 12.211 and 12.212, Commercial Computer Software, $ ! Computer Software Documentation, and Technical Data for Commercial $ ! Items are licensed to the U.S. Government under vendor's standard $ ! commercial license. $ ! $ ! Neither HP nor any of its subsidiaries shall be liable for technical $ ! or editorial errors or omissions contained herein. The information $ ! in this document is provided "as is" without warranty of any kind $ ! and is subject to change without notice. The warranties for HP $ ! products are set forth in the express limited warranty statements $ ! accompanying such products. Nothing herein should be construed as $ ! constituting an additional warranty. $ ! $ set := $ set noon $ set symbol /scope=(nolocal,global) $ set symbol /scope=(nolocal,noglobal)/verb $ on control_y then goto exit $ serv_id = f$edit("tcpip$snmp","upcase") $ serv_home = f$edit("sys$sysdevice:[''serv_id']","upcase") $ ! $ ! If planning to stop snmp extension subagent processes and $ ! deinstall related images (e.g., Chess example), do: $ ! $ ! 1. Remove or comment out the GOTO below. $ ! $ ! 2. To stop snmp extension subagent processes, replicate the two lines $ ! after the "stop_subagents" label (see below) for each subagent $ ! $ ! 3. To deinstall snmp extension subagent images, replicate the two lines $ ! after the "deinstall_subagents" label (see below) for each subagent $ ! $ goto exit $ ! $ ! stop processes for snmp extension subagents $ ! $ stop_subagents: $ image = f$edit("sys$system:tcpip$chess_subagent.exe","upcase") $ call stop_process 'image' "''serv_id'" $ ! $ ! deinstall images for snmp extension subagents $ ! $ deinstall_subagents: $ image = f$edit("sys$system:tcpip$chess_subagent.exe","upcase") $ call deinstall_image 'image' $ ! $ ! completed shutdown of snmp extension subagents $ ! $ exit: $ exit $status .or. %x10000000 $ ! $ ! deinstall service image (p1 = image) $ ! $ deinstall_image: subroutine $ set noon $ status = 2 $ $ p1 = p1 - f$parse(p1,,,"version") $ $ if f$search(p1) .eqs. "" $ then $ write sys$output "%TCPIP-E-IMGDINSTERR, error deinstalling ''p1'" $ else $ if f$file_attributes(p1,"known") $ then $ install delete 'p1' $ status = $status $ if status $ then $ call log_info "%TCPIP-I-INFO, image ''p1' deinstalled" $ endif $ else $ write sys$output "%TCPIP-E-IMGDINSTERR, error deinstalling ''p1'" $ endif $ endif $ $ exit status .or. %x10000000 $ endsubroutine $ ! $ ! log informational message (p1 = message text) $ ! $ log_info: subroutine $ set noon $ $ if (tcpip$param_loginfo .eqs. "") .or. (tcpip$param_loginfo .nes. "QUIET") $ then $ write sys$output "''p1'" $ endif $ $ exit 1 $ endsubroutine $ ! $ ! stop service processes (p1 = service image, p2 = service id) $ ! $ stop_process: subroutine $ set noon $ status = 1 $ $ ctx = "" $ temp = f$context("process",ctx,"username","''p2'","eql") $ stop_process_loop: $ pid = f$pid(ctx) $ if pid .nes. "" $ then $ image = f$getjpi(pid,"imagname") $ if f$locate(p1,image) .ne. f$length(image) $ then $ if f$getjpi("","master_pid") .nes. f$getjpi(pid,"master_pid") $ then $ prcnam = f$getjpi(pid,"prcnam") $ stop /identification='pid' $ if $status $ then $ call log_info "%TCPIP-I-INFO, process ''prcnam' (pid=''pid') stopped" $ endif $ endif $ endif $ goto stop_process_loop $ endif $ $ exit status .or. %x10000000 $ endsubroutine