Wednesday 23 December 2009

Flash player in Google Chrome Linux

Copy flash library from mozilla to chrome plugin directory.Then restart chrome.

# cd /opt/google/chrome
# mkdir plugins
# cp /usr/lib/mozilla/plugins/flashplugin-alternative.so /opt/google/chrome/plugins/

Install Tora on Ubuntu 9.10

Tora is client for oracle like Toad. http://torasql.com

OS: Ubuntu 9.10
Tora version: 2.2.0
Oracle client version: 11.1.0.1


Download oracle client packages for linux from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
oracle-instantclient-basiclite-11.1.0.1-1.i386.rpm
oracle-instantclient-sqlplus-11.1.0.1-1.i386.rpm
oracle-instantclient-devel-11.1.0.1-1.i386.rpm

Install alien for rpm packages on Ubuntu
# sudo apt-get install alien

Install oracle client packages.
# sudo alien -i oracle-instantclient-basiclite-11.1.0.1-1.i386.rpm
# sudo alien -i oracle-instantclient-sqlplus-11.1.0.1-1.i386.rpm
# sudo alien -i oracle-instantclient-devel-11.1.0.1-1.i386.rpm


Edit /etc/ld.so.conf.d/oracle.conf
# sudo vi /etc/ld.so.conf.d/oracle.conf
add this line /usr/lib/oracle/11.1.0.1/client/lib
# sudo ldconfig
# sudo apt-get install libaio1


run sqlplus and see it is working.
# sqlplus
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Dec 22 10:06:27 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Enter user-name


Building TORA
Continue as root
# sudo -i
Get packages for compiling.
# apt-get build-dep tora
# apt-get install libqt3-mt-dev libqt3-compat-headers libqscintilla-dev build-essential g++ gcc autoconf automake flex zlib1g-dev docbook-xsl debhelper alien libaio1 dpatch fakeroot xsltproc texi2html texinfo libqt3-mt-psql libqt3-mt-odbc config-package-dev cmake qt4-dev-tools
# cd tora-2.0.0
Environment variables also add this lines to your users .bashrc file.
# export ORACLE_HOME="/usr/lib/oracle/11.1.0.1/client"
# export LD_LIBRARY_PATH="${ORACLE_HOME}/lib"
# export TNS_ADMIN="${ORACLE_HOME}"
# ln -s /usr/include/oracle/11.1.0.1/client/ ${ORACLE_HOME}/include
# debian/rules binary
# dpkg -i ../tora_2.0.0-4build2_i386.deb

Now you can run Tora. Log out and log in to be sure you set environment variables. Also put your tnsnames.ora here /usr/lib/oracle/11.1.0.1/client

Saturday 19 December 2009

How to boot from an existing Windows 7 partition under Ubuntu

This configuration could damage your Windows 7 installation, Backup you data.

Disk structure
Device Boot Start End Blocks Id System
Windows 7 /dev/sda1 * 1 46 364544 7 HPFS/NTFS
Windows 7 /dev/sda2 46 8515 68029440 7 HPFS/NTFS


# sudo apt-get install mbr
# sudo -i
# cd .Virtualbox


Create mbr
# install-mbr --force myBootRecord.mbr

Create your sda1 pointer
# VBoxManage internalcommands createrawvmdk -filename ./Win71.vmdk -rawdisk /dev/sda -partitions 1 -mbr ./myBootRecord.mbr -relative -register

Create sda2 pointer
# VBoxManage internalcommands createrawvmdk -filename ./Win72.vmdk -rawdisk /dev/sda -partitions 2 -relative -register

Now you can create your machine and add Win71.vmdk and Win72.vmdk disks.

Thursday 17 December 2009

M$ Office Communicator on Linux

Use pidgin plugin for logon to Microsoft Office Communicator. This is for ubuntu.

# sudo apt-get install pkg-config libglib2.0-dev libgtk2.0-dev pidgin-dev libpurple-dev libtool intltool comerr-dev

Get plugin from http://sourceforge.net/projects/sipe/

# tar -xjvf pidgin-sipe*.tar.gz
# cd pidgin-sipe*
# ./configure --prefix=/usr
# make
# sudo make install

Now you can find M$ Office Communicator in Pidgin.

Tuesday 10 November 2009

Can't log in after upgrade to 9.10

There is a bug in Ubuntu 9.10. Description is just like this stated in http://ubuntuforums.org/showthread.php?t=1305693

"I get as far as the gdm login screen, enter my info, get a brief flash, and am promptly returned to the login screen again. No error message; nothing."

First you have to edit .bashrc in your home directory and comment out this line
# export XAUTHORITY=$HOME/.Xauthorit

than delete monitors.xml file under $HOME/.config

Tuesday 28 July 2009

Performance Analysis of Logs (PAL) Tool

This tool helps to analyse and create report from perfomance counter of Windows systems.
Just collect performance counters and you will find everything in the gui.
Best part is you can select server types like Exchange or Sql is running on server.
http://www.codeplex.com/PAL

Thursday 16 July 2009

Configure smart host sendmail

Install sendmail
# yum install sendmail sendmail-cf
Edit sendmail.mc change the line
define(`SMART_HOST', `your.smart.host')dnl

Edit your /etc/hosts file and define your.smart.host
x.x.x.x your.smart.host

Friday 3 July 2009

ubuntu clean /var/cache/apt/archives

Clean /var/cache/apt/archives directory with command;
# sudo apt-get clean

Tuesday 2 June 2009

Process check in nagios with python

I wanto to implement nagios plugin to check process if it is running for servers. I used paramiko module for ssh in python
My restrictions:
I do not want to install any nagios agent to servers.
I do not want to use ssh autologin.
Reason I am lazy I do not want to visit all servers to generate public keys and copy to nagios server.


nagios configuration file command line
define command{
command_name check_process.py
command_line $USER1$/check_process.py $HOSTADDRESS$ $ARG1$ $ARG2$
}




Add lines below to check_process.py and make executable.

#!/usr/bin/python
# useage command ipaddress process maxcount
import paramiko, getpass
import os,sys,re
import signal


userName="user"
userPass="password"
server=sys.argv[1]
command="ps -ef | grep " + sys.argv[2] + " | grep -v grep |wc -l"
maxcount=int(sys.argv[3])


t = paramiko.Transport((server,22))
try:
t.connect(username=userName,password=userPass,hostkey=None)
except:
print server + ": Bad password or login!"
t.close()
else:
ch = t.open_channel(kind = "session")
ch.exec_command(command)
if (ch.recv_ready):
if int( ch.recv(1000) ) >= maxcount:
print "OK " + sys.argv[2]
t.close()
sys.exit(0)
else:
print "NOK " + sys.argv[2]
sys.exit(2)
t.close()

Thursday 28 May 2009

How to convert snoop output to read in Ethereal

Snoop to a file in Solaris
# snoop -o test.snoopraw

Transfer your file in binary mode to your windows machine.
under your wireshark installation folder find editcap application and convert your file to wireshark
"D:\Program Files\Wireshark\editcap.exe" "d:\testsnoopraw" "d:\testsnoopraw.snoop"

Wednesday 20 May 2009

Load balance and failover in Red Hat with qla driver

OS Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
HBA Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02)

download and install driver hp_qla2x00src-8.01.03p4-20b
backup your initrd files under /boot directory.

# cat /proc/scsi/qla2xxx/0
# cat /proc/scsi/qla2xxx/1

See your LUNs there under "SCSI LUN Information:"
SCSI LUN Information:
(Id:Lun) * - indicates lun is not registered with the OS.
( 0: 0): Total reqs 3, Pending reqs 0, flags 0x0*, 1:0:81 00
( 0: 1): Total reqs 58, Pending reqs 0, flags 0x0, 1:0:81 00

cd /opt/hp/src/hp_qla2x00src/
# ./set_parm
Choice: 1
Writing new /etc/hp_qla2x00.conf...done
adding line to /etc/modprobe.conf: alias scsi_hostadapter1 qla2xxx_conf
adding line to /etc/modprobe.conf: alias scsi_hostadapter2 qla2xxx
adding line to /etc/modprobe.conf: alias scsi_hostadapter3 qla2300
adding line to /etc/modprobe.conf: alias scsi_hostadapter4 qla2400
adding line to /etc/modprobe.conf: alias scsi_hostadapter5 qla6312
adding line to /etc/modprobe.conf: options qla2xxx ql2xmaxqdepth=16 qlport_down_retry=30 ql2xloginretrycount=16 ql2xfailover=1 ql2xlbType=1 ql2xautorestore=0x80

Would you like to create a new initrd to reflect the changes in the parameters (Y/n)? Y
Creating new initrd - initrd-2.6.9-55.0.2.ELsmp.img

---Press ENTER to continue---


reboot server.

If you want to be sure disconnect fiber cables and test failover. You will see dmesg output like below


qla2300 0000:42:01.0: LOOP DOWN detected (2).
qla2x00: FAILOVER device 0 from wwn-> wwn- LUN 01, reason=0x2
qla2x00: FROM HBA 0 to HBA 1
qla2300 0000:42:01.0: LIP reset occured (f700).
qla2300 0000:42:01.0: LOOP UP detected (2 Gbps).
scsi(0) :Loop id 0x0081 is an XP device
qla2x00: FAILBACK device 0 -> wwn LUN 01
qla2x00: FROM HBA 1 to HBA 0

vmware booting USB-harddrives workaround

I have installed Ubuntu to my usb disk. And later try to open ubuntu on usb disk from vmware. Vmware could not boot from usb disk. So I attach my usb disk physically to Vmware guest.

Edit preferences
in the hardware tab, delete hard disk
click add
choose hard disk
use physical disk (for advanced user) click next
in the device tab select your usb disk, it is physicaldrive3 for me. You can identify with disconnecting and trying it again.
click next and boot your machine

HP Product Bulletin

The HP Product Bulletin application provides you with the latest QuickSpecs, photos, drawings etc.
It is good, if you are working with HP hardware
http://h18000.www1.hp.com/products/quickspecs/productbulletin.html#intro


The HP Product Bulletin website is a convenient central resource providing technical overviews and specifications for HP hardware and software. The downloadable HP Product Bulletin application is loaded with features to aid with the purchase, sale and support of HP products.

QuickSpecs
Quick Quote
Product Photos
Locate by Name
Advanced Search Capabilities
Favorites
Retired Products
Tip of the Day

Monday 18 May 2009

Repair Master Boot Record

When installing Ubuntu you may delete MBR. MBR point grub instead of Windows bootloader. If you want to move Windows bootloader again you can use fixmbr command.
Fixmbr - Repair Master Boot Record with MBRFix from Windows 2000, XP etc. instead of using fdisk /mbr. FixMbr could help you recreating original master boot record (MBR) that works with any Windows (Win2k), XP, 95, 98 when Linux LILO damaged it.
download from here http://www.ambience.sk/fdisk-master-boot-record-windows-linux-lilo-fixmbr.php
If you have one disk enter this command. If you have more than 1 physicial hard disk (hard drive), you have to use proper number for your disk
mbrfix /drive 0 fixmbr

If you could not boot your OS then use Windows Cd boot in recovery mode and in the command prompt use fdisk /mbr

Thursday 14 May 2009

Bootchart

Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process.


Get bootchart http://www.bootchart.org/download.html
# bunzip2 bootchart-0.9.tar.bz2
# tar xvf bootchart-0.9.tar
# cd bootchart-0.9
# ./install.sh
# vi /boot/grub/grub.conf
change default=0 which is "title Bootchart logging"
# bootchartd init
# reboot


For compiling image processing
wget ftp://ftp.univie.ac.at/systems/linux/fedora/releases/10/Everything/i386/os/Packages/libgcj-src-4.3.2-7.i386.rpm
rpm -ivh libgcj-src-4.3.2-7.i386.rpm
# yum --disablerepo=\* --enablerepo=alteredupdate,alteredbase,dag install ant.i386


# cd bootchart-0.9
run for java compiling
# ant

Run bootchart to get your image
# java -jar bootchart.jar
Parsing /var/log/bootchart.tgz
Wrote image: ./bootchart.png


Here is my boot process image fedora 10 running on Vmware

Comparison of SVN and CVS

Concurrent Versions System (CVS), also known as the Concurrent Versioning System, is a free software revision control system
Subversion (SVN) is a version control system , maintain current and historical versions of files such as source code, web pages, and documentation

You can find a comparison here
http://www.pushok.com/soft_svn_vscvs.php

Tuesday 12 May 2009

/var/spool/clientmqueue filling up

You can delete files in this directory.
Files are coming from script output in crontab. You can check which script causing this files with more and cat command in that directory
Edit your crontab file and add below to end of your crontab entries.
>/dev/null 2>&1

Thursday 7 May 2009

Upgrade Fedora 7 to Fedora 8 Fedora 9 and finally to Fedora 10

Ok I am very late to upgrade from Fedora 7, but I found a mirror for Fedora 8 packages.

Fedora 7 to Fedora 8
# yum clean all

Get release files for fedora 8
# wget ftp://mirror.fraunhofer.de/archives.fedoraproject.org/fedora/linux/releases/8/Fedora/i386/os/Packages/fedora-release-notes-8.0.0-3.noarch.rpm
# wget ftp://mirror.fraunhofer.de/archives.fedoraproject.org/fedora/linux/releases/8/Fedora/i386/os/Packages/fedora-release-8-3.noarch.rpm

Install release files
# rpm -Uvh fedora*


Create test.repo file /etc/yum.repos.d/test.repo
Add the lines below:
[alterede]
name=alterercore
baseurl=ftp://mirror.fraunhofer.de/archives.fedoraproject.org/fedora/linux/releases/8/Everything/i386/os/
enabled=1
gpgcheck=0


Now start upgrade process
# yum --disablerepo=\* --enablerepo=alterede upgrade



Fedora 8 to Fedora 9
# yum clean all

edit /etc/yum.repos.d/test.repo
change
baseurl=ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/9/Everything/i386/os/

# wget ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/9/Everything/i386/os/Packages/fedora-release-9-2.noarch.rpm
# wget ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/9/Everything/i386/os/Packages/fedora-release-notes-9.0.0-1.noarch.rpm
# rpm -Uvh fedora-release-*
# yum --disablerepo=\* --enablerepo=alterede upgrade





Fedora 9 to Fedora 10

edit /etc/yum.repos.d/test.repo change line below
baseurl=ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/10/Everything/i386/os/

# yum clean all
# wget ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/10/Fedora/i386/os/Packages/fedora-release-10-1.noarch.rpm #
# wget ftp://mirror.fraunhofer.de/download.fedora.redhat.com/fedora/linux/releases/10/Fedora/i386/os/Packages/fedora-release-notes-10.0.0-1.noarch.rpm
# rpm -Uvh fedora-release-*



# yum --disablerepo=\* --enablerepo=alterede upgrade

If avahi package fails Error: Missing Dependency: libcap.so.1 is needed by package avahi-0.6.17-1.fc7.i386 (installed)
do uninstall of avahi with noscripts option
# rpm -e avahi-0.6.17-1.fc7.i386 --noscripts

Receive remote machine syslog messages.

Edit /etc/sysconfig/syslog file
change SYSLOGD_OPTIONS="-m 0 "
to
SYSLOGD_OPTIONS="-m 0 -r"

Restart syslogd deamon
service syslog restart

Wednesday 29 April 2009

nagios directory update plugin

nagios plugin for checking a directory is updated. You need to give two argument first for directory and second for minutes.

PROGNAME=`basename $0`
PROGPATH=`echo $0 sed -e 's,[\\/][^\\/][^\\/]*$,,'`
. $PROGPATH/utils.sh

SEARCH=$1
MIN=$2
COUNT=$(find $1 -mmin -$2 wc -l sed -e 's/ //g' )


if [[ $COUNT -eq 0 ]]
then
echo "NOK " $SEARCH $COUNT "" $SEARCH"COUNT="$COUNT";;;; "
exit $STATE_CRITICAL
else
echo "OK " $SEARCH $COUNT "" $SEARCH"COUNT="$COUNT";;;;"
exit $STATE_OK
fi

nagios file count plugin

nagios plugin for checking a directory for count of file. You need to give two argument first for directory and second for file count.

PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
. $PROGPATH/utils.sh

SEARCH=$1
MAX=$2
COUNT=$(find $1 | wc -l| sed -e 's/ //g')


if [[ $COUNT -gt $MAX ]]
then
echo "NOK " $SEARCH $COUNT "|" $SEARCH"COUNT="$COUNT";;;;"
exit $STATE_CRITICAL
else
echo "OK " $SEARCH $COUNT "|" $SEARCH"COUNT="$COUNT";;;;"
exit $STATE_OK
fi

Friday 24 April 2009

Nagios Installation CentOS 5.2

Change your repository
http://tlepsh.blogspot.com/2009/03/yum-ftp-only-repository.html
Add dag repository to your configuration

[dag]
name=CentOS-5 - Plus
baseurl=ftp://ftp-stud.fht-esslingen.de/dag/redhat/el5/en/x86_64/dag/
enabled=0
gpgcheck=0

Install nagios
#yum --disablerepo=\* --enablerepo=dag,alteredbase install nagios

Start nagios
#/etc/init.d/nagios start

Restart web service
#/etc/init.d/httpd restart

Create a password for nagiosadmin user
#htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

Install nagios plugins and perl module that you will need
#yum --disablerepo=\* --enablerepo=alteredbase,dag install nagios-plugins.x86_64
#yum --disablerepo=\* --enablerepo=alteredbase,dag install perl-DBI perl-DBD-ODBC,perl-Convert-BER.noarch

device not accepting address , error -71

I had issues with usb hd. I got error like below
usb 6-7: new high speed USB device using address 2
usb 6-7: device not accepting address 2, error -71

run the command below
modprobe -r ehci_hcd

Wednesday 1 April 2009

Move server RSA fingerprint to new server

I am using ssh auto login for transfering files between servers. I move RSA fingerprint to new server for preventing these warnings : REMOTE HOST IDENTIFICATION HAS CHANGED or confirming RSA key fingerprint Are you sure you want to continue connecting (yes/no).
Copy files under /etc/ssh directory to new server.
scp youroldserver:/etc/ssh/ssh_host_* /etc/ssh
You should move your ipadress to old server. If not you will get confirmation again.Or you can duplicate related entries in known_hosts file and change old ip adresses or hostname.

Friday 27 March 2009

Access Linux Partitions (ext2/ext3) From Windows OS

Explore2fs: http://www.chrysocome.net/explore2fs
Ext2 Installable File System For Windows: http://www.fs-driver.org/index.html
DiskInternals Linux Reader: http://www.diskinternals.com/linux-reader

Thursday 26 March 2009

Fedoa 10 linux adding encrypted partition with cryptsetup luks

Install related package
# yum -y install cryptsetup-luks

Here my disk is /dev/hdd1. Encypt partition with luksFormat option. Do not forget your passphrase
# cryptsetup --verbose --verify-passphrase luksFormat /dev/sdd1

Create mapping for enctypted partition under /dev/mapper. Enter your passphrase here.
# cryptsetup luksOpen /dev/sdd1 /dev/mapper anynameyougive(udisk2 for me)

Now you can find your mapping in under the mapper directory
# ls /dev/mapper

Format the disk.
# /sbin/mkfs.ext3 -j -m 1 /dev/mapper/udisk2

Mount the disk
# mount /dev/mapper/udisk2 /path/to/decide

Now you can use your encrypted partition.

Wednesday 25 March 2009

Share ntfs partition with nfs

ntfs-3g module enable to read write access to ntfs partitions. Latest distributions support this module.
For exporting to read write access you have to use umask option, which enables everyone to write ntfs partition.
mount -o umask=000 /dev/sdb1 /media/disk

And entry for nfs /et/exports
/media/disk *(fsid=0,rw,sync,no_subtree_check)

Do not forget to restart nfs server.

Thursday 19 March 2009

Yum Ftp only repository

I need to update servers but do not want to permit server to access internet via http, I created repository below which requires only ftp access.
Only "mirror.fraunhofer.de" is permitting ftp access so I use this server. Probably you can find other distros under same server. I go for CentOS here.
you have to use this command to update and install packages
yum --disableplugin=fastestmirror --disablerepo=\* --enablerepo=alteredbase install yum-fastestmirror
yum --disableplugin=fastestmirror --disablerepo=\* --enablerepo=alteredupdates update


create file /etc/yum.repos.d/x.repo with content below
[alteredbase]
name=CentOS-$releasever - Base
baseurl=ftp://mirror.fraunhofer.de/centos.org/5.2/os/x86_64/
gpgcheck=1
gpgkey=ftp://mirror.fraunhofer.de/centos.org/RPM-GPG-KEY-CentOS-5

[alteredupdates]
name=CentOS-$releasever - Updates
baseurl=ftp://mirror.fraunhofer.de/centos.org/5.2/updates/x86_64/
gpgcheck=1
gpgkey=ftp://mirror.fraunhofer.de/centos.org/RPM-GPG-KEY-CentOS-5

[alteredaddons]
name=CentOS-$releasever - Addons
baseurl=ftp://mirror.fraunhofer.de/centos.org/5.2/addons/x86_64/
gpgcheck=1
gpgkey=ftp://mirror.fraunhofer.de/centos.org/RPM-GPG-KEY-CentOS-5

[alteredextras]
name=CentOS-$releasever - Extras
baseurl=ftp://mirror.fraunhofer.de/centos.org/5.2/extras/x86_64/
gpgcheck=1
gpgkey=ftp://mirror.fraunhofer.de/centos.org/RPM-GPG-KEY-CentOS-5

[alteredcentosplus]
name=CentOS-$releasever - Plus
baseurl=ftp://mirror.fraunhofer.de/centos.org/5.2/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=ftp://mirror.fraunhofer.de/centos.org/RPM-GPG-KEY-CentOS-5

Yum cdrom dvd repository

Mount dvd under /media/cdrom

use command
yum --enablerepo=c5-media install pango-devel-1.14.9-3.el5.centos.x86_64.rpm

Wednesday 4 February 2009

Motion capture linux

Motion application makes snapshots of the movement which can be converted to MPEG movies in realtime (or later for low cpu usage), making it usable as an observation or security system. It can take actions like sending out email and SMS messages when detecting motion. It also has its own build-in streaming webserver.
OS: Fedora 10
Webcam: Eyetoy Namtai (Playstation 2 camera)

Installing motion
http://motion.sourceforge.net/
# tar zxvf motion-3.2.11.tar.gz
# cd motion-3.2.11

I will not use database, disabled configuration.
# ./configure --without-mysql --without-pgsql
# yum install libjpeg
# yum install libjpeg-devel
# make
# make install
# yum install libjpeg-static

Motion option file motion-dist.conf is under /usr/local/etc
You can run option file witch -c switch
# motion -c /usr/local/etc/motion-dist.conf
change setup_mode off for getting image at http://127.0.0.1:8081
and
webcam_localhost off if you want to connect from another computer.


Eyetoy camera
gspca_main and gspca_ov519 is not working fine, I was getting corrupt image errors.
Download drivers

# rmmod gspca_main gspca_ov519
# wget http://www.rastageeks.org/downloads/ov51x-jpeg/ov51x-jpeg-1.5.9.tar.gz
# tar xzvf ov51x-jpeg-1.5.9.tar.gz
# cd ov51x-jpeg-1.5.9
# modprobe ov51x_jpeg

Thursday 15 January 2009

Storage configuration management for 3510 and 2540

OS: solaris 10 intel
Server: x4150 , x4100 M2
Storage: SAN(HITACHI,EMC), StorageTek 3510, StorageTek 2540

I need to do kind of configuration management or change management. In case of any problem I want to know what was it before. So my script collects generic information like df, ifconfig, cfgadm,vfstab,luxadm outputs,. If you have storage device 2540 then collect information sscs , if you have 3510 then collects information with sccli command. I added information related to aLom and iLom via ipmitool.
I scp info to central machine. You can find how to do it from this blog, check previous articles.


#!/usr/bin/bash
command=/opt/SUNWstkcam/bin/sscs
OUTPUT=/path/storageinfo_$(hostname)_$(date +%Y%m%d)
echo /dev/null > $OUTPUT
date >> $OUTPUT
prtdiag >> $OUTPUT
df -h >> $OUTPUT
cat /etc/vfstab >> $OUTPUT
ifconfig -a >> $OUTPUT
netstat -rn >> $OUTPUT
cfgadm -al >> $OUTPUT
luxadm display $(luxadm probe | grep "Logical Path" | awk -F: '{print $2}') >> $OUTPUT
luxadm -e port | awk '{print $1}' | while read dump_map
do
luxadm -e dump_map $dump_map >> $OUTPUT
done

# Sun StorageTek 2540 Array part
if [[ $(luxadm display $(luxadm probe | grep "Logical Path" | awk -F: '{print $2}') | grep "Product ID" | grep -v Universal | awk -F: '{print $2}' | grep LCSM100_F |wc -l) -ge 1 ]]
then
$command list array | awk '{print $2}' | while read array
do
$command list -a $array controller >> $OUTPUT
$command list -a $array date >> $OUTPUT
$command list -a $array disk >> $OUTPUT
$command list -a $array fcport >> $OUTPUT
$command list -a $array firmware >> $OUTPUT
$command list -a $array host >> $OUTPUT
$command list -a $array hostgroup >> $OUTPUT
$command list -a $array initiator >> $OUTPUT
$command list -a $array jobs >> $OUTPUT
$command list -a $array license >> $OUTPUT
$command list -a $array mapping >> $OUTPUT
$command list -a $array os-type >> $OUTPUT
$command list -a $array pool >> $OUTPUT
$command list -a $array profile >> $OUTPUT
$command list -a $array registeredarray >> $OUTPUT
$command list -a $array snapshot >> $OUTPUT
$command list -a $array tray >> $OUTPUT
$command list -a $array vdisk >> $OUTPUT
$command list -a $array volume >> $OUTPUT
$command list -a $array volume-copy >> $OUTPUT
$command list -d $array fru
done

$command list alarm >> $OUTPUT
$command list array >> $OUTPUT
$command list device >> $OUTPUT
$command list devices >> $OUTPUT
$command list event >> $OUTPUT
$command list log >> $OUTPUT
$command list mgmt-sw >> $OUTPUT
$command list notification >> $OUTPUT
$command list site >> $OUTPUT
$command list storage-system >> $OUTPUT
$command list userrole >> $OUTPUT
fi


if [[ $(luxadm display $(luxadm probe | grep "Logical Path" | awk -F: '{print $2}') | grep "Product ID" | grep -v Universal | awk -F: '{print $2}' | grep "StorEdge 3510" |wc -l) -ge 1 ]]
then
command="sccli $(sccli -l|awk '{print $1}' | head -n 1)"
$command show access-mode >> $OUTPUT
$command show auto-write-through-trigger >> $OUTPUT
$command show battery-status >> $OUTPUT
$command show bypass raid >> $OUTPUT
$command show cache-parameters >> $OUTPUT
$command show channels >> $OUTPUT
$command show clone >> $OUTPUT
$command show controller-date >> $OUTPUT
$command show controller-name >> $OUTPUT
$command show disks >> $OUTPUT
$command show disk-array >> $OUTPUT
$command show drive-parameters >> $OUTPUT
$command show enclosure-status >> $OUTPUT
$command show events >> $OUTPUT
$command show frus >> $OUTPUT
$command show host-parameters >> $OUTPUT
$command show host-wwn-names >> $OUTPUT
$command show inquiry-data >> $OUTPUT
$command show ip-address >> $OUTPUT
$command show logical-drives >> $OUTPUT
$command show logical-volumes >> $OUTPUT
$command show lun-maps >> $OUTPUT
$command show media-check >> $OUTPUT
$command show network-parameter >> $OUTPUT
$command show partitions >> $OUTPUT
$command show peripheral-device-status >> $OUTPUT
$command show port-wwns >> $OUTPUT
$command show protocol >> $OUTPUT
$command show redundancy-mode >> $OUTPUT
$command show redundant-controller-configuration >> $OUTPUT
$command show rs232-configuration >> $OUTPUT
$command show safte-devices >> $OUTPUT
$command show sata-mux >> $OUTPUT
$command show sata-router >> $OUTPUT
$command show ses-devices >> $OUTPUT
$command show shutdown-status >> $OUTPUT
$command show stripe-size-list >> $OUTPUT
$command show unique-identifier >> $OUTPUT
#actually command below includes all information above
$command show configuration >> $OUTPUT

fi


echo "###############################IPMPITOOl##################################" >> $OUTPUT
ipmitool lan print >> $OUTPUT
ipmitool chassis status >> $OUTPUT
ipmitool mc info >> $OUTPUT
ipmitool sdr >> $OUTPUT
ipmitool sensor >> $OUTPUT
ipmitool fru >> $OUTPUT
ipmitool sel >> $OUTPUT
ipmitool user list 1 >> $OUTPUT



scp $OUTPUT tbackup@machine:/path/storageinfo_$(hostname)_$(date +%Y%m%d)

Background Processes in Unix/Linux

The & is an important little character in UNIX; it means "run the command in the background"; i.e., detach it from the window it was started from, so it does not block the command line.

Should the program ever try to read from the terminal window, it will be suspended, until the user "brings it to the foreground"; i.e., brings it to the state it would have had without the & to begin with.

To bring a program to the foreground, use "fg" or "%". If you have more than one background job to choose from ("jobs" will show you), then use for example "%2" to choose the second one.
Important:

If you forget to give the & at the end of line, and the process blocks the command input to the terminal window, you can put the process in the background "after the fact", by using Ctrl-Z. The process is suspended, and you get the command prompt back. The first thing you should do then is probably to give the command "bg", that resumes the process, but now in the background.

taken from http://www.astro.ku.dk/comp-phys/tutorials/background.shtml