Saturday, March 30, 2013

Life

Learning from life is slow, but Life keep us teaching a new lesson each day.


How Beautiful life is.......


Love Sharing
Amit Chopra

We are Slaves !

Hey Friends,

A thought struck in my mind, that what our life is and we are heading it towards.

The first thought came in mind:-

* We are slaves of our Thought.
* We are slave of our desires which took birth from Thought.
* We are slaves of our work, which is done for achieving the desire.
* We are slaves of our targets, which is part of work.
* We are slaves of Money, which we get after achieving targets.
* Money brings more thoughts and then desires arises.
* Then this cycle repeats.

The Second thought comes in mind:-

When we are doing all above things, we get indulge in above activities like any thing.

* We forget to live our lives.
* We forget to think freely. which can take us to any height which we desire.
* We forget to work for others. with those we are living.
* We forget to give time to our lovely families. for those we are earning.
* We forget to manage our selves.

The Third thought which comes in mind:-

* We need to fulfill our day to day needs,
* sometimes we are not able to fulfill those needs also. How this problem can be overcome, I donot know and still have to learn about it.

and in this two player are playing with our lives,  DESIRE and NEED.



As i see fault in myself , I am slave of giving suggestion to others.


Love Sharing
Amit Chopra







 

Command to check CPU, CORE and SOCKET + LINUX

Hi Friends,

In RHEL, we have simple commands to get the informantion about number of CPU, CORE and SOCKET.

#lscpu
#dmidecode
#cat /proc/cpuinfo


#dmidecode will give entire information about Hardware on which RHEL is installed and running. we can grep the number of CPU, COREs and SOCKET on the server.
#lscpu will list the number of CPU given to the server or there on the server.

Thanks and appreciate reading my blogs and posts.

All comments invited as the purpose is to share and learn. so please let me know, what all other ways to look upon it.

Love Sharing
Amit Chopra

Tuesday, March 26, 2013

Basic monitoring commands for solaris SUN 5.10

Hey Friends,

Please find some basic commands which may come in your use while extracting resource status of the server, details of the sun server. These commands can be collected and put together to run simultaneously in a script and append the o/p to a file. which can be read easily later.

below append shows the symbol of two "GREATER THAN SIGN" so please use those sign in two numbers. as i tried to show but it changed to any code. sorry for the inconvinience caused.



#sar 2 5 append /tmp/logs.txt :- SAR is a utility to provie information about system performance.
#sar -mu 2 5 append /tmp/logs.txt :- it will provide detail about current CPU usage
#/usr/sbin/prtdiag -v append /tmp/logs.txt :- prtdiag will show complete hardware details, like CPU, MEMORY, Serial Number, Firmware, OBP, etc.
#/usr/sbin/prtconf |grep -i "Memory" append /tmp/logs.txt :- it will extract Hardware config information. here we are extracting only Memeory detail with grep.
#vmstat 2 5 append /tmp/logs.txt :- It provide current usage of memory detail.
#psrinfo -p append /tmp/logs.txt :- it carries information about processor. -p will show number of socket.
#prinfo -pv append /tmp/logs.txt :- it will show -p socket -v virtual CPU.
#/usr/sbin/prtdiag -v append /tmp/logs.txt :- detailed hardwareinformation.
#ps -ef |grep -i ora append /tmp/logs.txt :- ps command is to check the process. to check if it is running or not
#sar -d 2 5 append /tmp/logs.txt :- to check the server disk utilization currently.
#ps -ef |grep -i scx append /tmp/logs.txt :- it is to check if SCOM agent is running or not.
#uname -a append /tmp/logs.txt :- it gives details about OS version installed.
#hostname append /tmp/logs.txt :- the hostname of the server.
#uname append /tmp/logs.txt :- the solaris OS
#cat /etc/release append /tmp/logs.txt :- it will show the release of SUN OS.
#/usr/sbin/top append /tmp/logs.txt :- top is a utility to shows you current CPU, Memory, SWAP usage.
#top append /tmp/logs.txt
#/usr/bin/zonename append /tmp/logs.txt :- will show whether the server is physical or VM. if the o/p comes global then  it is physical
#cat /etc/resolve.conf append /tmp/logs.txt :- it will show the DNS name of the server. i.e. where the server is going to get resolved.

all above commands can be put together in /tmp and any directory. giving executable rights only. it will extract the infomration and put it under tmp file logs.txt

to create a script file :-

#touch logs.sh
or
$touch logcollector.sh
$
now open the same file in vi editor and insert all below lines. and the save and quit with :wq!

uname -a append /tmp/logs.txt
hostname append /tmp/logs.txt
uname append /tmp/logs.txt
cat /etc/release append /tmp/logs.txt
/usr/bin/zonename append /tmp/logs.txt
cat /etc/resolve.conf append /tmp/logs.txt
sar 2 5 append /tmp/logs.txt
sar -mu 2 5 append /tmp/logs.txt
/usr/sbin/prtdiag -v append /tmp/logs.txt
/usr/sbin/prtconf |grep -i "Memory" append /tmp/logs.txt
vmstat 2 5 append /tmp/logs.txt
psrinfo -p append /tmp/logs.txt
prinfo -pv append /tmp/logs.txt
/usr/sbin/prtdiag -v append /tmp/logs.txt
ps -ef |grep -i ora append /tmp/logs.txt
sar -d 2 5 append /tmp/logs.txt
ps -ef |grep -i scx append /tmp/logs.txt
/usr/sbin/top append /tmp/logs.txt
top append /tmp/logs.txt
echo |format
raidctl |more
and then run the script, it wil collect all required information in a while and you can read or get the desired information.

Love Sharing
Amit Chopra

Saturday, March 23, 2013

How to remove Logical Drive + HP UX

Hello Friends,

We may sometimes need to remove logical drive online in HP UX 11.31i

* First step we can do is check with sautil utility, i.e. sautil /dev/ciss0.
* The same can be checked with saconfig /dev/ciss0, it will also show how many disks and in which logical drive they all fall and belongs. this command can be used to identify BAY of the disk which are used in the Logical drive.
* SAM and SMH can also be used for checking disk details and we can also check wether Logical Drive made is in use or not. screenshot attached below.

Note :- please do it with proper planning only.

extract for MANUAL OF SACONFIG

The saconfig command is a command line configuration tool for the HP SmartArray RAID Controller Family. This command provides the ability to create a logical drive, add a spare drive to existing logical drive, display configuration, delete a logical drive, and clear configuration. This command also enables the cache when it is used to create the first logical drive on the SmartArray RAID Controller. Furthermore it allows the option of changing the percentage of total cache size used for read caching and write caching. The auto-fail missing disks at boot feature can be enabled or disabled using this command.

saconfir command o/p :-

---------- LOGICAL DRIVE 1 ----------
Device File     = c0t0d1
RAID Level      = 1+0
Size            = 139982 MB
Stripe Size     = 128 KB
Status          = OK
Participating Physical Drive(s):
Ct  Enc  Bay         WWID
2I    1    4  0x5000c5000eb332ad
2I    1    3  0x5000cca015432435

Participating Spare Drive(s):
NONE



* Now After confirmation that the disk is not being used anywhere i.e in any VG any LV. when confirmed thne you can run delete saconfig. syntax is below.

#
# /opt/raidsa/bin/saconfig /dev/ciss0 -D 1
Are you sure you want to delete logical drive 1 on
SmartArray RAID controller /dev/ciss0? (y/[n]): y
Logical drive 1 deleted
#


Now those two disk are free now to be exracted and can be used in any other server for space requirement.

Love Sharing
Amit Chopra

 

Friday, March 22, 2013

“IOError: urlopen error unknown url type: media” + RHEL Linux

Hey Friends,

Today i faced a different and new problem i.e. while using yum.repo. media error started coming. so i did some googling on it. find some good answers and used them.

1. the first answer i got was to check your repo file.
2. to check the dvd.
3. yes i want to mention that, yum list all, yum update commands were running properly.
but when it came to yum install "rpm" then it started giving problem or media error.

“IOError:

4. the google search suggested to use createrepo command while sitting on the directory where your dvd is or if you have copied all dvd data on your system for repository. this repository can be used to sync using HTTP, NFS, etc.

5.In my case createrepo command itself was not there in the OS. that is createrepo was not installed.

6. the create repo rpm was there in dvd but i was not able to install it due to that error again and again.
7. so just downloaded the rpm from RHEL site named as createrepo.
8. ran rpm -ivh "createrepo......" It got installed.
9. now ran the command from

#pwd
/mnt/Server/
#createrepo /mnt/Server

it created one repo and removed the media error after yum clean all.

10. Now #yum install "package name " worked.


[root@redhat yum.repos.d]# yum install xorg-x11-proto-devel.i386 Loading "installonlyn" plugin Loading "rhnplugin" plugin This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Setting up repositories

Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies

--> Populating transaction set with selected packages. Please wait.

---> Downloading header for xorg-x11-proto-devel to pack into transaction set.

media://1170972069.396645%232/xorg-x11-proto-devel-7.1-9.fc6.i386.rpm: [Errno 4] IOError: Trying other mirror.

Error: failed to retrieve xorg-x11-proto-devel-7.1-9.fc6.i386.rpm from Installer error was [Errno 4] IOError: [root@redhat yum.repos.d]# [root@redhat yum.repos.d]#

 

Script for finding and removing old data + UNIX

Hi Friends,

In day to day job of Unix Admin, we need to remove old data which is not required or not being accessed for more than ten days, twenty days or a month or some times a year.

this is applicable for any UNIX platform. we can use find command and very much use the manual of the same. It is very useful command, which can be used to find data located at any place in the desired directory or internal directories.

before using remove command, we can use list command to check whether the command is working properly or as desired or not.


#find /var/log/ -type f -atime +10 -exec ls -ltr {} \;

 
now if this command is useful and working fine for you then use rm i.e. remove command to remove the content.
 

find /var/log -type f -atime +10 -exec rm -rf {} \;

in my case data listed and then removed is set for 10 days i.e. the data which is not being accessed for more than ten days will be listed or removed respectively.
 
Thanks & Regards
Love Sharing
Amit Chopra

Tuesday, March 12, 2013

Guys ever tried Bungy Jumping?

Hey Friends,

Ever tried bungy jumping? Is yes then please share your comments on it and if not then please do it. You will feel it and it is a test for you and of your strengths.....



Love Sharing
Amit Chopra

Friday, March 1, 2013

how to send message to all users + HP UX

Hey Friends,

A good command to send message to all users, who are currently logged in on the server is "WALL". we can make use of this command prior to reboot, shutdown, any services which can affect users work. the usage of the same is as below :-

# wall
Admin uSer is working.
.
Broadcast Message from root (pts/0) Fri Mar  1 11:01:23...
Admin user is working.
.
#

root user is sending a message :-


# wall
Hi This is server Admin, we are putting a test message to all users.
.
Broadcast Message from root (pts/0) Fri Mar  1 11:06:47...
Hi This is server Admin, we are putting a test message to all users.
.
#
A user below logged in got a message using WALL command.
$
Broadcast Message from root (pts/0) Fri Mar  1 11:06:47...
Hi This is server Admin, we are putting a test message to all users.
.

$

Love Sharing
Amit Chopra

Basic commands of NPAR and VPAR + HP UX

Hi Friends,

Some of the basic commands of NPAR and VPAR.
 
1.       #vparenv
2.       #vparenv –m npars :- to boot into npar mode. it means on boot it will go to npar.
3.       #vparenv –m vpars :- to boot into vpar mode. It means on boot it will go to vpar.
4.       #vparstatus :- to check the status
5.       #parstatus –c 0 :- shows information about specified cell, here like it is for 0. 6.      #parstatus –v :- status in verbose mode i.e. more detailed status.
7.      #parstatus –w:  it will show where we are sitting i.e. on which NPAR we are sitting.
8.       #vparstatus –A: Will show the devices which are free, like IO devices and CPUs etc.
9. #vparcreate
10. #vparremove
11. #icapstatus :- shows information about vpar, about its CPU, Memory, and devices assigned. it also provides serial number, OS info, product number, etc informations of the VPAR server.
this was used in earlier versions.


Love Sharing
Amit Chopra