- Community Home
- >
- Servers and Operating Systems
- >
- HPE BladeSystem
- >
- BladeSystem - General
- >
- Script blade using SSH by PHP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2014 03:29 AM
08-29-2014 03:29 AM
Script blade using SSH by PHP
Hi,
I'm try to configure many blade server on few C7000 enclosure.
i'm correctly conected to my enclosure but each time when i try to connect on one blade i'm directly disconected.
User:OAtmp-Administrator-54003E7C logged-in to HP BladeSystem Onboard Administrator (C) Copyright 2006-2014 Hewlett-Packard Development Company, L.P. OA-10604BA3D313 [SCRIPT MODE]> connect server 6 Connecting to bay 6 ... Connection terminated by user's session. OA-10604BA3D313 [SCRIPT MODE]> set /system1 oemhp_servername=wxcvbn Invalid Arguments
How can i fix my trouble with :
Connection terminated by user's session.
Here is my php code :
<?php function ssh($host, $login, $mdp, $command) { if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist"); if(!($con = ssh2_connect($host, 22))){ echo "échec connexion\n"; } else { if(!ssh2_auth_password($con, $login, $mdp)) { echo "échec authentification\n"; } else { // execute a command if (!($stream = ssh2_exec($con, $command ))) { echo "échec de l'exécution de la commande\n"; } else { // collect returning data from command stream_set_blocking($stream, true); $data = ""; while ($buf = fread($stream,4096)) { $data .= $buf; } fclose($stream); return $data; } } } } $ch = $_SESSION['c']; $la = $_SESSION['l']; $no = $_SESSION['n']; include ('base_sql.php'); //infos de connexion à la base SQL $sql = "SELECT IP_OA FROM `enclosure` WHERE NOM = '$ch'"; $req = mysql_query($sql); while($ip_enclosure=mysql_fetch_array($req)) $ipc = $ip_enclosure['IP_OA']; $command = "connect server ".$la."\n set /system1 oemhp_servername=".$no." "; $ret = ssh($ipc, 'Admin_account', 'password', $command); echo '<pre>' . $ret . '</pre>'; ?>
Thanks by advance or your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2014 08:23 AM
09-08-2014 08:23 AM
Re: Script blade using SSH by PHP
Hi,
Nobody have an explaination about "connexion teminated by user's session" just after this command :
connect server "nbr"\n set /system1 oemhp_servername="servername"
Even if i remove 'set /system ...' i have the same issue.
help please .....
Rgds,
MarC.