<?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 RIBCL under Linux in Server Management - Remote Server Management</title>
    <link>https://community.hpe.com/t5/server-management-remote-server/ribcl-under-linux/m-p/3056671#M50</link>
    <description>How can i send RIBCL commands to the remote insight board II from a unix (linux) server? All i found was a Windows utility which seems not to be available for Linux. Perl/Python scripting is not a problem. So a Specification (which port, which http header, which mime type) of how to send the RIBCL XML file to the board is okay for me.</description>
    <pubDate>Tue, 26 Aug 2003 11:37:17 GMT</pubDate>
    <dc:creator>Michael Lausch</dc:creator>
    <dc:date>2003-08-26T11:37:17Z</dc:date>
    <item>
      <title>RIBCL under Linux</title>
      <link>https://community.hpe.com/t5/server-management-remote-server/ribcl-under-linux/m-p/3056671#M50</link>
      <description>How can i send RIBCL commands to the remote insight board II from a unix (linux) server? All i found was a Windows utility which seems not to be available for Linux. Perl/Python scripting is not a problem. So a Specification (which port, which http header, which mime type) of how to send the RIBCL XML file to the board is okay for me.</description>
      <pubDate>Tue, 26 Aug 2003 11:37:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-remote-server/ribcl-under-linux/m-p/3056671#M50</guid>
      <dc:creator>Michael Lausch</dc:creator>
      <dc:date>2003-08-26T11:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: RIBCL under Linux</title>
      <link>https://community.hpe.com/t5/server-management-remote-server/ribcl-under-linux/m-p/3056672#M51</link>
      <description>I'm not a Perl user myself but I did find some examples that I hope you can use.  The port used is still 443, and you will need to establish an SSL connection with the RILOE.&lt;BR /&gt;&lt;BR /&gt;example 1: opening an ssl connection&lt;BR /&gt;&lt;BR /&gt;use Socket;&lt;BR /&gt;use Net::SSLeay qw(die_now die_if_ssl_error);&lt;BR /&gt;&lt;BR /&gt;Net::SSLeay::load_error_strings();&lt;BR /&gt;Net::SSLeay::SSLeay_add_ssl_algorithms();&lt;BR /&gt;Net::SSLeay::randomize();&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;# opens an ssl connection to port 443 of the passed host&lt;BR /&gt;#&lt;BR /&gt;sub openSSLconnection($)&lt;BR /&gt;{&lt;BR /&gt;    my $host = shift;&lt;BR /&gt;    my ($ctx, $ssl, $sin, $ip, $nip);&lt;BR /&gt;&lt;BR /&gt;    if (not $ip = inet_aton($host))&lt;BR /&gt;    {&lt;BR /&gt;        print "$host is a DNS Name, performing lookup\n" if $debug;&lt;BR /&gt;        $ip = gethostbyname($host) or die "ERROR: Host $hostname not found.\n";&lt;BR /&gt;    }&lt;BR /&gt;    $nip = inet_ntoa($ip);&lt;BR /&gt;    print STDERR "Connecting to $nip:443\n";&lt;BR /&gt;&lt;BR /&gt;    $sin = sockaddr_in(443, $ip);&lt;BR /&gt;    socket  (S, &amp;amp;AF_INET, &amp;amp;SOCK_STREAM, 0) or die "ERROR: socket: $!";&lt;BR /&gt;    connect (S, $sin) or die "connect: $!";&lt;BR /&gt;&lt;BR /&gt;    $ctx = Net::SSLeay::CTX_new() or die_now("ERROR: Failed to create SSL_CTX $! ");&lt;BR /&gt;    Net::SSLeay::CTX_set_options($ctx, &amp;amp;Net::SSLeay::OP_ALL);&lt;BR /&gt;    die_if_ssl_error("ERROR: ssl ctx set options");&lt;BR /&gt;    $ssl = Net::SSLeay::new($ctx) or die_now("ERROR: Failed to create SSL $!");&lt;BR /&gt;    Net::SSLeay::set_fd($ssl, fileno(S));&lt;BR /&gt;    Net::SSLeay::connect($ssl) and die_if_ssl_error("ERROR: ssl connect");&lt;BR /&gt;    print STDERR 'SSL Connected ';&lt;BR /&gt;    print 'Using Cipher: ' . Net::SSLeay::get_cipher($ssl) if $debug;&lt;BR /&gt;    print STDERR "\n\n";&lt;BR /&gt;&lt;BR /&gt;    return $ssl;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;After the connection has been established, the script must send an XML document header as the first line, which will tell the device???s HTTPS webserver that the following content is an XML script. The header must match the header used in the example exactly. After the header has been completely sent, the remainder of the script can be sent. In this example, the script is sent all at once.&lt;BR /&gt;&lt;BR /&gt;example 2: sending the XML header and script body&lt;BR /&gt;&lt;BR /&gt;# usage: sendscript(host, script)&lt;BR /&gt;# sends the xmlscript script to host, returns reply&lt;BR /&gt;sub sendscript($$)&lt;BR /&gt;{&lt;BR /&gt;    my $host = shift;&lt;BR /&gt;    my $script = shift;&lt;BR /&gt;    my ($ssl, $reply, $lastreply, $res, $n);&lt;BR /&gt;&lt;BR /&gt;    $ssl = openSSLconnection($host);&lt;BR /&gt;&lt;BR /&gt;    # write header&lt;BR /&gt;    $n = Net::SSLeay::ssl_write_all($ssl, ''."\r\n");&lt;BR /&gt;    print "Wrote $n\n" if $debug;&lt;BR /&gt;&lt;BR /&gt;    # write script&lt;BR /&gt;    $n = Net::SSLeay::ssl_write_all($ssl, $script);&lt;BR /&gt;    print "Wrote $n\n$script\n" if $debug;&lt;BR /&gt;&lt;BR /&gt;    $reply = "";&lt;BR /&gt;    $lastreply = "";&lt;BR /&gt;&lt;BR /&gt;    READLOOP:&lt;BR /&gt;    while(1)&lt;BR /&gt;    {&lt;BR /&gt;        $n++;&lt;BR /&gt;        $reply .= $lastreply;&lt;BR /&gt;        $lastreply = Net::SSLeay::read($ssl);&lt;BR /&gt;        die_if_ssl_error("ERROR: ssl read");&lt;BR /&gt;&lt;BR /&gt;        if($lastreply eq "")&lt;BR /&gt;        {&lt;BR /&gt;            sleep(2); # wait 2 sec for more text.&lt;BR /&gt;            $lastreply = Net::SSLeay::read($ssl);&lt;BR /&gt;            last READLOOP if($lastreply eq "");&lt;BR /&gt;        }&lt;BR /&gt;        print "READ: $lastreply\n" if $debug;&lt;BR /&gt;        if($lastreply =~ m/STATUS="(0x[0-9A-F]+)"[\s]+MESSAGE='(.*)'[\s]+\/&amp;gt;[\s]*(([\s]|.)*?)&amp;lt;\/RIBCL&amp;gt;/)&lt;BR /&gt;        {&lt;BR /&gt;            if($1 eq "0x0000")&lt;BR /&gt;            {&lt;BR /&gt;                print STDERR "$3\n" if $3;&lt;BR /&gt;            }&lt;BR /&gt;            else&lt;BR /&gt;            {&lt;BR /&gt;                print STDERR "ERROR: STATUS: $1, MESSAGE: $2\n";&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;    $reply .= $lastreply;&lt;BR /&gt;&lt;BR /&gt;    closeSSLconnection($ssl);&lt;BR /&gt;&lt;BR /&gt;    return $reply;&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Aug 2003 14:04:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-remote-server/ribcl-under-linux/m-p/3056672#M51</guid>
      <dc:creator>Junior Yharte</dc:creator>
      <dc:date>2003-08-27T14:04:40Z</dc:date>
    </item>
  </channel>
</rss>

