tales from the trenches frontline

Thursday May 28, 2009

Last updated: 28th May 2009


Introduction

As more and more customers are adopting OpenSolaris on their servers it is expected that those customers will have paid for access to the additional support repositories (e.g. OpenSolaris 2008.11 standard support).  However, the rest of this blog entry applies equally to accessing the free OpenSolaris extras repository (which includes packages for Flash & Virtualbox).

This blog entry will cover the basic steps of logging in and downloading the necessary SSL keys and certificates to access the repositories.


Downloading SSL key & certificate

  • Visit http://pkg.sun.com/, you will be redirected to a login/registration site.  Use your existing Sun Online Account details or register if you are a new user
  • Once logged in you will be redirected to the Certificate Requests page.  Select the appropriate repository under Request new certificate (e.g. OpenSolaris extras or OpenSolaris 2008.11 standard support)
  • Read and accept the license agreement
  • A new key & certificate has been generated.  Click the links to download both


Installing the key & certificate

  • pfexec mkdir -m 0755 -p /var/pkg/ssl
  • pfexec cp -i XXXX.key.pem /var/pkg/ssl
  • pfexec cp -i XXXX.certificate.pem /var/pkg/ssl


Adding the new repository

Now that the key & certificate have been installed into /var/pkg/ssl either the pkg commandline utility or the Package Manager GUI can be used to add a new repository.  The end result is the same, it's just a matter of preference.

with pkg(1M)

  • pfexec pkg set-authority -k /var/pkg/ssl/XXX.key.pem -c /var/pkg/ssl/XXX.certificate.pem -O https://pkg.sun.com/opensolaris/YYY/ pkg.sun.com/YYY
  • Replace YYY with the name of the repository you are adding, e.g. support or extras
  • You can list packages from this repository with: pkg list -a 'pkg.sun.com/YYY'

with Package Manager GUI

  • Use the desktop Package Manager icon to start the application
  • Click File -> Manage Repositories...
  • Enter a friendly name for the new repository (e.g. OpenSolaris extras or OpenSolaris support)
  • Enter the repository URL: https://pkg.sun.com/opensolaris/YYY/ (YYY is the repository name, e.g. support or extras)
  • Click the Add button to display the SSL dialog
  • Enter the full path to the SSL key & SSL certificate or use Browse.  e.g. /var/pkg/ssl/XXX.key.pem  & /var/pkg/ssl/XXX.certificate.pem
  • Click OK and then Close to return to the Package Manager
  • You can browse and install packages from the newly added repository by selecting the friendly name from the Repository drop-down below the Search box

Monday Mar 16, 2009

Saving binary snoop file.

To save binary snoop file, run this command:

snoop -q -d <devicename> -o <outputfilename>

Rotating snoop file:

On a busy system, it won't take long for output file to grow massively and potentially fill in critical disk space. Below script can be used to save snoop output and rotate it at set time interval. Before running this script edit CAPTURE_DURATION, HOSTNAME and DEVICENAME variables.

#!/usr/bin/bash

logrotate() {

         LIST=$(ls -r $1*)
         COUNT="$2"
         for i in $LIST
         do
                 #echo $i;
                 TMP=$(ls $i | cut -d"." -f 2)
                 if [ $TMP = $1 ]
                 then
                         NEW=$TMP.0
                         mv $i $NEW
                 elif [ $TMP -gt $COUNT ]
                 then
                         rm $i
                 else
                         BASE=$(ls $i | cut -d"." -f 1)
                         NEW=$BASE.$(($TMP+1))
                         mv $i $NEW
                 fi
                 touch $1
         done
}

# function ensuring we're killing the right pid
kill_snoop() {

        PID_TO_KILL=`ptree $$ | grep ${FILENAME} | grep -v grep | awk '{print $1}'`
        kill ${PID_TO_KILL}
}

touch /var/tmp/snoop_out
touch /var/tmp/snoop_out.1
touch /var/tmp/snoop_out.2
touch /var/tmp/snoop_out.3
FILENAME="/var/tmp/snoop_out"

#
# Set below variables manually.
# CAPTURE_DURATION - amount of time in seconds that each snoop file will collect data for
# HOSTNAME - name of remote host to capture traffic to/from. This is not local hostname.
# DEVICENAME - name of device to capture data on (ie hme0,nge1,e1000g1, etc)
#
CAPTURE_DURATION=10
HOSTNAME="remote_hostname"
DEVICENAME="device_name"

while [ true ]
do
         snoop -q -d ${DEVICENAME} -o ${FILENAME} ${HOSTNAME} &
         sleep ${CAPTURE_DURATION}
         kill_snoop
         logrotate ${FILENAME} 2
done

Tuesday Sep 16, 2008

Last updated: 23rd February 2009
Last confirmed correct: 9th July 2009

Please bookmark this page, it will always contain an up-to-date guide to uploading data to Sun's frontline engineers based in the UK.  You may have reached here via a direct link from Sun support


General comments

  • When sending data to Sun please always include the Sun case reference (in email subject line or filename of uploaded files).  Without a valid case reference the engineer working on your case will not be notified that new data is available and it will take us longer to provide an update
  • There is a delay between files being uploaded and the engineer receiving them.  This varies depending on how busy the upload site is and how large the files are

Basic uploads


Small files (< 7MB)

Small files can be emailed directly to Sun

  • To: support@sun.com
  • Subject: must include the Sun case reference (other text may also be included)

Larger files (> 7MB)

Larger files may be uploaded via our HTTP/HTTPS web interface or anonymous FTP.  To upload files via HTTP/HTTPS:

Alternatively, upload using anonymous FTP:

% ftp ftp.sun.co.uk
Connected to ftp.sun.co.uk.
220 ** Welcome to Sun Microsystems Supportfiles FTP site **
Name (ftp.sun.co.uk): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
enter your email address here
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> binary
enable binary to ensure files are not corrupted
200 Type set to I.
ftp> cd /cores/uk/incoming
250 CWD command successful.
ftp> put 37600413.explorer.tar.gz
you must prefix the filename with the Sun case reference


Advanced uploads


Uploading large files without a web browser or FTP

If you are unable to upload files using FTP and do not have access to a web browser we provide a command line tool for uploading files

For your convenience we provide a simple script to ease the upload process, along with details of the commands involved.  Both methods require curl, which is provided for both SPARC and x86/x64 as part of the Sun Services Tools Bundle (STB) package, which includes Sun explorer:

Wrapper script:

  • Download uk-upload.sh (version 1.0) to the system you intend to upload the file(s) from
  • chmod +x uk-upload.sh
  • ./uk-upload.sh and follow the provided instructions
  • If you experience any issues using this script, please contact frontline-blog@sun.com for assistance
Manual curl instructions:
  • In the following command LOCALFILE refers to the file you want to upload (you must prefix the filename with the Sun case reference)
  • /opt/SUNWexplo/bin/curl.`uname -p` -T "LOCALFILE" "http://supportfiles.sun.com/curl?file=LOCALFILE&root=europe-cores/uk/incoming"
  • Once complete, forward confirmation to support@sun.com or directly to the engineer working on your case

Welcome to the Frontline blog.  We are a team of frontline software support engineers based at Sun's main office in the UK

The aims of this blog are to:

  • provide procedures specific to the UK solutions centre
  • answer in detail common problems/issues that customers face
  • give customers a better understanding of what we do
  • inform customers how they can help us to help them
  • cover other topics we haven't thought of yet

We do not intend to duplicate documents present on SunSolve although a certain amount of overlap is inevitable

If what we're covering sounds interesting, please subscribe to the RSS feed and don't be shy to leave feedback