<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic VC Manager command tool in Server Management - Remote Server Management</title>
    <link>https://community.hpe.com/t5/server-management-remote-server/vc-manager-command-tool/m-p/4367145#M4168</link>
    <description>&lt;!--!*#--&gt;Here's a command which lets us run a VC command without knowing which is the active VC&lt;BR /&gt;&lt;BR /&gt;server02:/ root# util_execute_vcmgr_cmd chassis02-vc1 hpadmin password "show server -output=script2,no-headers"&lt;BR /&gt;enc0:1;1Z34AB1234;1;ProLiant BL685c G5;OK;Off;project_dev_tool_profile&lt;BR /&gt;enc0:2;1Z34AB1234;2;ProLiant BL685c G5;OK;Off;&lt;UNASSIGNED&gt;&lt;BR /&gt;enc0:3;1Z34AB1234;3;ProLiant BL685c G5;OK;Off;project_dev_odb4&lt;BR /&gt;enc0:4;1Z34AB1234;4;ProLiant BL685c G5;OK;Off;project_dev_odb3&lt;BR /&gt;server02:/ root# util_execute_vcmgr_cmd chassis02-vc2 hpadmin password "show server -output=script2,no-headers"&lt;BR /&gt;enc0:1;1Z34AB1234;1;ProLiant BL685c G5;OK;Off;project_dev_tool_profile&lt;BR /&gt;enc0:2;1Z34AB1234;2;ProLiant BL685c G5;OK;Off;&lt;UNASSIGNED&gt;&lt;BR /&gt;enc0:3;1Z34AB1234;3;ProLiant BL685c G5;OK;Off;project_dev_odb4&lt;BR /&gt;enc0:4;1Z34AB1234;4;ProLiant BL685c G5;OK;Off;project_dev_odb3&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/expect&lt;BR /&gt;# Program        : util_execute_vcmgr_cmd&lt;BR /&gt;# Version        : 1.2&lt;BR /&gt;# Author         : Mark Ashley &lt;MARK at="" ibiblio="" dawt="" org=""&gt;&lt;BR /&gt;# Initial Date   : 12th Feb 2009&lt;BR /&gt;# Modify Date    : 26th Feb 2009&lt;BR /&gt;# Purpose        : Connect to a HP Blade Chassis VC and run a command&lt;BR /&gt;&lt;BR /&gt;set real_noisy 0&lt;BR /&gt;set noisy $real_noisy&lt;BR /&gt;# exp_internal 0&lt;BR /&gt;log_user $real_noisy&lt;BR /&gt;&lt;BR /&gt;set whoami "[exec /usr/ucb/whoami]"&lt;BR /&gt;set myhostname "[exec /bin/hostname]"&lt;BR /&gt;set osname "[exec uname -s]"&lt;BR /&gt;set shell "tcsh"&lt;BR /&gt;set sshcmd "/bin/ssh"&lt;BR /&gt;set remote_prompt "\-\&amp;gt;$"&lt;BR /&gt;set local_prompt "(%|#|\\\$) $"&lt;BR /&gt;set remhost [lindex $argv 0]&lt;BR /&gt;set user [lindex $argv 1]&lt;BR /&gt;set passwd [lindex $argv 2]&lt;BR /&gt;set command [lindex $argv 3]&lt;BR /&gt;# log_file -noappend /var/tmp/vcmgr_cmd.$remhost.log&lt;BR /&gt;&lt;BR /&gt;proc login_to_remote_host {} {&lt;BR /&gt;    global whoami&lt;BR /&gt;    global remhost&lt;BR /&gt;    global user&lt;BR /&gt;    global passwd&lt;BR /&gt;    global local_prompt&lt;BR /&gt;    global remote_prompt&lt;BR /&gt;    global command&lt;BR /&gt;    global shell_id&lt;BR /&gt;    global sshcmd&lt;BR /&gt;&lt;BR /&gt;    send "$sshcmd $remhost -oStrictHostKeyChecking=no -l $user \"$command\"\r"&lt;BR /&gt;    expect "*"&lt;BR /&gt;    set timeout 10&lt;BR /&gt;    set after_password 0&lt;BR /&gt;    while 1 {&lt;BR /&gt;        expect {&lt;BR /&gt;            -re "Password: " {&lt;BR /&gt;                send "$passwd\r"&lt;BR /&gt;                expect "\r\n"&lt;BR /&gt;                set after_password 1&lt;BR /&gt;            }&lt;BR /&gt;            -re ".*Virtual Connect Manager not found at this IP address." {&lt;BR /&gt;                set after_password 0&lt;BR /&gt;            }&lt;BR /&gt;            "continue connecting \(yes/no\)" {&lt;BR /&gt;                send "yes\r"&lt;BR /&gt;            }&lt;BR /&gt;            -re "Last login.+" {&lt;BR /&gt;                send "\r"&lt;BR /&gt;            }&lt;BR /&gt;            timeout {&lt;BR /&gt;                return&lt;BR /&gt;            }&lt;BR /&gt;            -re "password:" {&lt;BR /&gt;                send "$passwd\r"&lt;BR /&gt;            }&lt;BR /&gt;            -re "Please use IP Address: (.*)\r\n" {&lt;BR /&gt;                set newhost $expect_out(1,string)&lt;BR /&gt;                log_user 0&lt;BR /&gt;                set noisy 0&lt;BR /&gt;                exec kill -INT $shell_id&lt;BR /&gt;                # send_user "Switching to actual host $newhost\r\n"&lt;BR /&gt;                expect -re $local_prompt&lt;BR /&gt;                send "$sshcmd $newhost -oStrictHostKeyChecking=no -l $user \"$command\"\r"&lt;BR /&gt;                expect -re "Password: " {&lt;BR /&gt;                    send "$passwd\r"&lt;BR /&gt;                    expect "\r\n"&lt;BR /&gt;                    set after_password 1&lt;BR /&gt;                }&lt;BR /&gt;            }&lt;BR /&gt;            -re $local_prompt {&lt;BR /&gt;                set after_password 0&lt;BR /&gt;                send_user "\r\n"&lt;BR /&gt;                exit&lt;BR /&gt;            }&lt;BR /&gt;            "publickey,password,keyboard-interactive" {&lt;BR /&gt;                send_error "\rpassword for $remhost is wrong\r\n"&lt;BR /&gt;                sleep 1&lt;BR /&gt;                exit&lt;BR /&gt;            }&lt;BR /&gt;            -re ".*\r" {&lt;BR /&gt;                if ($after_password) { send_user $expect_out(buffer) }&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;set shell_id [spawn $shell -l]&lt;BR /&gt;send "stty raw -echo\r"&lt;BR /&gt;expect "*"&lt;BR /&gt;send "uname -s\r"&lt;BR /&gt;expect "$osname\n"&lt;BR /&gt;expect -re $local_prompt&lt;BR /&gt;login_to_remote_host&lt;BR /&gt;expect -re $local_prompt&lt;BR /&gt;send_user "\r\n\n"&lt;BR /&gt;&lt;/MARK&gt;&lt;/UNASSIGNED&gt;&lt;/UNASSIGNED&gt;</description>
    <pubDate>Thu, 26 Feb 2009 11:26:21 GMT</pubDate>
    <dc:creator>ilouser</dc:creator>
    <dc:date>2009-02-26T11:26:21Z</dc:date>
    <item>
      <title>VC Manager command tool</title>
      <link>https://community.hpe.com/t5/server-management-remote-server/vc-manager-command-tool/m-p/4367145#M4168</link>
      <description>&lt;!--!*#--&gt;Here's a command which lets us run a VC command without knowing which is the active VC&lt;BR /&gt;&lt;BR /&gt;server02:/ root# util_execute_vcmgr_cmd chassis02-vc1 hpadmin password "show server -output=script2,no-headers"&lt;BR /&gt;enc0:1;1Z34AB1234;1;ProLiant BL685c G5;OK;Off;project_dev_tool_profile&lt;BR /&gt;enc0:2;1Z34AB1234;2;ProLiant BL685c G5;OK;Off;&lt;UNASSIGNED&gt;&lt;BR /&gt;enc0:3;1Z34AB1234;3;ProLiant BL685c G5;OK;Off;project_dev_odb4&lt;BR /&gt;enc0:4;1Z34AB1234;4;ProLiant BL685c G5;OK;Off;project_dev_odb3&lt;BR /&gt;server02:/ root# util_execute_vcmgr_cmd chassis02-vc2 hpadmin password "show server -output=script2,no-headers"&lt;BR /&gt;enc0:1;1Z34AB1234;1;ProLiant BL685c G5;OK;Off;project_dev_tool_profile&lt;BR /&gt;enc0:2;1Z34AB1234;2;ProLiant BL685c G5;OK;Off;&lt;UNASSIGNED&gt;&lt;BR /&gt;enc0:3;1Z34AB1234;3;ProLiant BL685c G5;OK;Off;project_dev_odb4&lt;BR /&gt;enc0:4;1Z34AB1234;4;ProLiant BL685c G5;OK;Off;project_dev_odb3&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/expect&lt;BR /&gt;# Program        : util_execute_vcmgr_cmd&lt;BR /&gt;# Version        : 1.2&lt;BR /&gt;# Author         : Mark Ashley &lt;MARK at="" ibiblio="" dawt="" org=""&gt;&lt;BR /&gt;# Initial Date   : 12th Feb 2009&lt;BR /&gt;# Modify Date    : 26th Feb 2009&lt;BR /&gt;# Purpose        : Connect to a HP Blade Chassis VC and run a command&lt;BR /&gt;&lt;BR /&gt;set real_noisy 0&lt;BR /&gt;set noisy $real_noisy&lt;BR /&gt;# exp_internal 0&lt;BR /&gt;log_user $real_noisy&lt;BR /&gt;&lt;BR /&gt;set whoami "[exec /usr/ucb/whoami]"&lt;BR /&gt;set myhostname "[exec /bin/hostname]"&lt;BR /&gt;set osname "[exec uname -s]"&lt;BR /&gt;set shell "tcsh"&lt;BR /&gt;set sshcmd "/bin/ssh"&lt;BR /&gt;set remote_prompt "\-\&amp;gt;$"&lt;BR /&gt;set local_prompt "(%|#|\\\$) $"&lt;BR /&gt;set remhost [lindex $argv 0]&lt;BR /&gt;set user [lindex $argv 1]&lt;BR /&gt;set passwd [lindex $argv 2]&lt;BR /&gt;set command [lindex $argv 3]&lt;BR /&gt;# log_file -noappend /var/tmp/vcmgr_cmd.$remhost.log&lt;BR /&gt;&lt;BR /&gt;proc login_to_remote_host {} {&lt;BR /&gt;    global whoami&lt;BR /&gt;    global remhost&lt;BR /&gt;    global user&lt;BR /&gt;    global passwd&lt;BR /&gt;    global local_prompt&lt;BR /&gt;    global remote_prompt&lt;BR /&gt;    global command&lt;BR /&gt;    global shell_id&lt;BR /&gt;    global sshcmd&lt;BR /&gt;&lt;BR /&gt;    send "$sshcmd $remhost -oStrictHostKeyChecking=no -l $user \"$command\"\r"&lt;BR /&gt;    expect "*"&lt;BR /&gt;    set timeout 10&lt;BR /&gt;    set after_password 0&lt;BR /&gt;    while 1 {&lt;BR /&gt;        expect {&lt;BR /&gt;            -re "Password: " {&lt;BR /&gt;                send "$passwd\r"&lt;BR /&gt;                expect "\r\n"&lt;BR /&gt;                set after_password 1&lt;BR /&gt;            }&lt;BR /&gt;            -re ".*Virtual Connect Manager not found at this IP address." {&lt;BR /&gt;                set after_password 0&lt;BR /&gt;            }&lt;BR /&gt;            "continue connecting \(yes/no\)" {&lt;BR /&gt;                send "yes\r"&lt;BR /&gt;            }&lt;BR /&gt;            -re "Last login.+" {&lt;BR /&gt;                send "\r"&lt;BR /&gt;            }&lt;BR /&gt;            timeout {&lt;BR /&gt;                return&lt;BR /&gt;            }&lt;BR /&gt;            -re "password:" {&lt;BR /&gt;                send "$passwd\r"&lt;BR /&gt;            }&lt;BR /&gt;            -re "Please use IP Address: (.*)\r\n" {&lt;BR /&gt;                set newhost $expect_out(1,string)&lt;BR /&gt;                log_user 0&lt;BR /&gt;                set noisy 0&lt;BR /&gt;                exec kill -INT $shell_id&lt;BR /&gt;                # send_user "Switching to actual host $newhost\r\n"&lt;BR /&gt;                expect -re $local_prompt&lt;BR /&gt;                send "$sshcmd $newhost -oStrictHostKeyChecking=no -l $user \"$command\"\r"&lt;BR /&gt;                expect -re "Password: " {&lt;BR /&gt;                    send "$passwd\r"&lt;BR /&gt;                    expect "\r\n"&lt;BR /&gt;                    set after_password 1&lt;BR /&gt;                }&lt;BR /&gt;            }&lt;BR /&gt;            -re $local_prompt {&lt;BR /&gt;                set after_password 0&lt;BR /&gt;                send_user "\r\n"&lt;BR /&gt;                exit&lt;BR /&gt;            }&lt;BR /&gt;            "publickey,password,keyboard-interactive" {&lt;BR /&gt;                send_error "\rpassword for $remhost is wrong\r\n"&lt;BR /&gt;                sleep 1&lt;BR /&gt;                exit&lt;BR /&gt;            }&lt;BR /&gt;            -re ".*\r" {&lt;BR /&gt;                if ($after_password) { send_user $expect_out(buffer) }&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;set shell_id [spawn $shell -l]&lt;BR /&gt;send "stty raw -echo\r"&lt;BR /&gt;expect "*"&lt;BR /&gt;send "uname -s\r"&lt;BR /&gt;expect "$osname\n"&lt;BR /&gt;expect -re $local_prompt&lt;BR /&gt;login_to_remote_host&lt;BR /&gt;expect -re $local_prompt&lt;BR /&gt;send_user "\r\n\n"&lt;BR /&gt;&lt;/MARK&gt;&lt;/UNASSIGNED&gt;&lt;/UNASSIGNED&gt;</description>
      <pubDate>Thu, 26 Feb 2009 11:26:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-remote-server/vc-manager-command-tool/m-p/4367145#M4168</guid>
      <dc:creator>ilouser</dc:creator>
      <dc:date>2009-02-26T11:26:21Z</dc:date>
    </item>
  </channel>
</rss>

