unix linux and storageunix linux and storageUnix Linux Storage , netapp, performance tuning, automation, hacks, tips, documents and useful hints Articles
Kernel parameter : file-nr and file-max
2008-01-29 07:08:00 file-max : The Linux Operating system kernel allocates file handles dynamically and the value in file-max denotes the maximum number of file handles that the Linux kernel will allocate. When you get a lot of error messages about "running out of file handles" , increasing this limit will help. To change the value, just write the new number into the file as below: [root@unixfoo root]# cat /proc/sys/fs/file-max 8192 [roo t@unixfoo root]# echo 943718 > /proc/sys/fs/file-max [root@unixfoo root]# cat /proc/sys/fs/file-max 943718 [r oot@unixfoo root]#This value also can be changed using "sysctl" command. To make the change permanent, add the entries to /etc/sysctl.conf [root@unixfoo root]# cat /etc/sysctl.conf fs.file-max = 943718 [root@unixfoo root]#file-nr :The three values in /proc/sys/fs/file-nr denotes the number of allocated file handles, the number of allocated but unused file handles, and the maximum number of file han... More About: File , Kernel
Simple perl ipcalc
2008-01-22 16:02:00 Here is a simple program to calculate Network address and broadcast address, given input of IP address and netmask.Perl code : #!/usr/bin/perl# Get ipaddress and netmask from usermy $ipaddr=$ARGV[0];my $nmask=$ARGV[1];my @addrarr=split(/./,$ipaddr);my ( $ipaddress ) = unpack( "N", pack( "C4",@addrarr ) );my @maskarr=split(/./,$nmask);my ( $netmask ) = unpack( "N", pack( "C4",@maskarr ) );# Calculate network address by logical AND operation of addr & netmask# and convert network address to IP address formatmy $netadd = ( $ipaddress & $netmask );my @netarr=unpack( "C4", pack( "N",$netadd ) );my $netaddress=join(".",@netarr);print "Network address : $netaddress ";# Calculate broadcase address by inverting the netmask # and do a logical or with network addressmy $bcast = ( $ipaddress & $netmask ) + ( ~ $netmask );my @bcastarr=unpack( "C4", pack( "N",$bcast ) ) ;my $broadcast=join(".",@bcastarr);print "Broadcast address: $broadcast ";# END of programHere is the output of... More About: Simple
Linux modules handling commands
2008-01-20 18:02:00 modproble - This command is used for listing and loads the modules on a linux machine.[root@unixfoo root]# modprobe -c | less# Generated by modprobe -c (2.4.25)path[boot]=/lib/modules/bootpath[ toplevel]=/lib/modules/2.4.21-40.ELsmppat h[toplevel]=/lib/modules/2.4path[updates] =/lib/modules/updatespath[kernel]=/lib/mo dules/kernelpath[fs]=/lib/modules/fspath[ net]=/lib/modules/netpath[scsi]=/lib/modu les/scsi<snip>lsmod - This command lists the loaded modules on a linux machine.insmod - This command tries to install a module into the running kernel.rmmod - This command unloads loadable modules from the running kernel. More About: Linux , Commands
AIX tips
2008-01-19 09:10:00 How to find the processors on an AIX server?[root@unixfoo-aix /]# lsdev -C -c processor -S aproc0 Available 00-00 Processor[root@unixfoo-aix /]#How to identify the disks attached to an AIX server?[root@unixfoo-aix /]# lsdev -C -c disk -S ahdisk0 Available 10-80-00-2,0 16 Bit LVD SCSI Disk Drivehdisk1 Available 10-80-00-4,0 16 Bit LVD SCSI Disk Drive[root@unixfoo-aix /]#How to identify firmware, model, systemid, memory of a AIX server?[root@unixfoo-aix /]# lsattr -El sys0 -a boottype,fwversion,modelname,systemid,rea lmemboottype disk & nbsp; N/A &n bsp; & nbsp;   ; &nbs p; Falsefwversion IBM,TCP05387 Firmware version and revision levels   ; Falsemodelname IBM,7046-B50 Machine name &n... More About: Tips
Netapp : SNMP tips
2008-01-17 08:43:00 How to enable SNMP on a netapp filerfiler1> options snmp.enable onfiler1> options snmpsnmp.access &n bsp; & nbsp; legacy snmp.enable   ; on &nb sp; filer1>How to set and modify SNMP configration values?filer1*> snmp contact unixfoo@un1xf00.org &nbs p; filer1*> snmp contact &nbs p; unixfoo@un1xf00.org &nbs p; filer1*>You can use Cacti ( http://www.cacti.net/index.php ) to monitor your netapp. This tool uses Netapp SNMP and plots graphs using RRD.Few Other opensource SNMP monitoring tools, that can monitor heterogenous unix linux machines : OpenNMSZenossZabbixNagios More About: Tips
KDE 4.0 released
2008-01-17 05:51:00 After a long period of planning and development, KDE 4.0 has been released last week ( Jan 11 2008 ). Some major developments includes .. The KDE 4 Libraries have seen major improvements in almost all areas. The Phonon multimedia framework provides platform independent multimedia support to all KDE applications, the Solid hardware integration framework makes interacting with (removable) devices easier and provides tools for better power management. The KDE 4 Desktop has gained some major new capabilities. The Plasma desktop shell offers a new desktop interface, including panel, menu and widgets on the desktop as well as a dashboard function. KWin, the KDE Window manager, now supports advanced graphical effects to ease interaction with your windows. Lots of KDE Applications have seen improvements as well. Visual updates through vector-based artwork, changes in the underlying libraries, user interface enhancements, new features, even new applications -- you name it, KDE 4.0 has it. ... More About: Released
Netapp - Linux iscsi setup
2008-01-04 17:12:00 A quick guide to setup IP SAN using Linux -Netapp-iscsi.On Linux server : Install iSCSI initiator (iscsi-initiator-utils rpm) on your linux machine. This will create the necessary binaries and will create /etc/iscsi.conf and /etc/initiatorname.iscsiAdd iscsi-iname to /etc/initiatorname.iscsi .[root@unixfoo ~]# iscsi-inameiqn.1987-05.com.cisco:01.44c65 d9587d9[root@unixfoo ~]#Add the output to /etc/initiatorname.iscsiAdd the below lines to /etc/iscsi.confContinuous=noHeaderDigest= neverDataDigest=neverImmediateData=http:/ /unixfoo.blogspot.com//yesDiscoveryAddres s=192.185.12.12DiscoveryAddress should be the IP address of the storage. On Netapp filer : Make sure you have iscsi license enabled.Create volume for holding the iscsi luns.filer1> vol create iscsivol aggr01 100gCreate lun on the volumefiler1> lun create -s 50g -t linux /vol/iscsivol/lun1Create an igroup and add the Linux iscsi-iname to it.filer1> igroup create -i -t linux iscsigrpfiler1> igroup add iscsigrp iqn.1987-... More About: Setup
Linux tips : tftpd
2007-12-28 09:40:00 When you are trying to analyze/debug tftpd service on your linux boot server , you expect tftpd to return more debug information on the logs. To setup tftp in debug mode, use -v option in "server_args". As many as "-v" option you use , more debug log information you get. Try it.service tftp{ disable = no &nb sp; socket_type   ; = dgram protocol &nb sp; &n bsp; = udp &n bsp; wait & nbsp; = yes &n bsp; user & nbsp; = root &nbs... More About: Linux , Tips
Netapp : Pocket Survival Guide
2007-12-19 15:39:00 The url http://www.cs.fiu.edu/~tho01/psg/netapp.h tml has good information on netapp command set and its usage. A quick reference guide for a netapp admin. The site also has tips for Solaris, Veritas, EMC, HPUX .... Good & useful one. More About: Guide , Survival , Pocket
Netapp Tips : Changing exports
2007-12-17 11:14:00 /etc/exports file controls the nfs exports on a netapp filer. An easy way to edit this file is described below.From your unix box : rsh netapp rdfile /etc/exports > /tmp/exportsvi /tmp/exportsrsh netapp wrfile /etc/exports < /tmp/exportsrsh netapp exportfs -a More About: Tips , Changing , Exports
Perl : Xen API
2007-12-16 06:58:00 Xen host can be monitored and controlled via Xen API ( it uses XML-RPC communications). Here is a sample how to program using XenAPI. For XenAPI to work, you should have the below enty in /etc/xen/xend-config.sxp. You can also control which hosts can connect through API. -- /etc/xen/xend-config.sxp--(xen-api-server ((9363 none)   ; (unix none))) --Here is a sample perl script which can query and get details from Xen host using Xen API.x------------------------------------ --------x#!/usr/bin/perl# Xen API Programming.# unixfoo - http://unixfoo.blogspot.com/use Net::Ping;use RPC::XML;use RPC::XML::Client;my $xenhost = $ARGV[0];my $user = $ARGV[1];my $passwd = $ARGV[2];my $xenport = 9363;my $state = { &nbs p; "Running" => "ON", "Halted" => "OFF",  ... More About: Perl
Filesystem : noatime
2007-12-15 15:07:00 Most file systems store and maintain three separate time stamps per file. They are create timelast modified timelast accessed time The last accessed time stamp may have to be updated quite frequently. For example, listing the directory contents will make all the containing files to get a new last accessed time stamps - this causes additional writes and adding to the file system overhead. The filesystem mount option "noatime" can be used to disable the last accessed time stamp updates to the filesystem, resulting in reduced file system overhead. File systems with lot of small files (like file servers, home areas) will experience noticeable improvement in performance. More About: Filesystem
Netapp : disk zero spares
2007-12-06 08:23:00 To clean up the spare disks and zero them, use the below command. Having a zero'd spare disks can reduce time when on volume creation or on volume reconstruction.filer1> disk zero spares.filer1> vol status -sSpare disksRAID Disk Device HA SHELF BAY CHAN Pool Type RPM Used (MB/blks) Phys (MB/blks)---------   ; ------ ------------- ---- ---- ---- ----- -------------- --------------Spare disks for block or zoned checksum traditional volumes or aggregatesspare &n bsp; 2a.37 2a 4 13 FC:A - FCAL 10000 68000/139264000 68444/140174232 (zeroing, 10% done)spare & nbsp; 3a.56 3a 3 8 FC:A - FCAL 10000 68000... More About: Ares , Pare
Linux VLAN configuration
2007-12-01 15:56:00 1. Connect the eth0 interface of your linux machine to the switch.2. Remove the IP Address information on the eth0 interface # ifconfig eth0 0.0.0.0 # ifconfig eth0 up3. Configure 2 VLANs on the eth0 interface using vconfig as follows (100,200 are the VLAN id's). If the 8021q.o module is not loaded, the vconfig command (when invoked first time) will automatically load the module. # vconfig add eth0 100 # vconfig add eth0 200 4. Configure IP on the VLAN interfaces # ifconfig eth0.100 xxx.xxx.xxx.xxx netmask 255.255.252.0 up # ifconfig eth0.200 yyy.yyy.yyy.yyy netmask 255.255.255.0 up5. Preserve the vlan configuration across reboots by adding it to configuration files. Create the appropriate ifcfg files for eth0, eth0.100 and eth0.200 in /etc/sysconfig/network-scripts/ &nbs p; # cd /etc/sysconfig/network-scripts/ &nbs p; ... More About: Linux , Configuration
Netapp tips : Disk firmware upgrade
2007-11-30 07:49:00 After a Netapp failed disk swap, if an autosupport message is sent saying that the disk firmware is downrev, please run the following command.filer1> disk_fw_updateMake sure that the disk firmware is upto-date by checking /etc/messages file for the below message-- Firmware downloaded on disk -- Firmware is up-to-date on all disk drives More About: Tips , Disk
Xen Wireless
2007-11-27 07:19:00 Details on howto setup Xen on WiFi network : http://wiki.xensource.com/xenwiki/XenWifi . Good one. More About: Wireless
Xen virtualization tutorial
2007-11-24 05:25:00 Dready has created a tutorial for Xen based on his virtualization setup using RHEL5, Xen and GFS. Good one, please have a read: Open source Virtualization Day OneOpen source Virtualization Day Two Open source Virtualization Day ThreeOpen source Virtualization Day FourOpen source Virtualization Day Five More About: Tutorial
Files used by process
2007-11-23 11:27:00 To check what files are being used by a process, you can use lsof with option -p.Example: # lsof -p 2791COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEsyslogd 2791 root cwd DIR &n bsp; 8,2 8192 2 /syslogd 2791 root rtd DIR &n bsp; 8,2 8192 2 /syslogd 2791 root txt REG &n bsp; 8,2 35712 1046656 /sbin/syslogdsyslogd 2791 root mem REG &n bsp; 8,2 52152 523300 /lib/libnss_files-2.3.2.sosyslogd 2791 root mem REG &n bsp; 8... More About: Files , Process
Managing Xen
2007-11-21 12:17:00 Here are some xm and virsh commands for creating, managing, and troubleshooting xen virtual machines.Staring and Stopping VMsxm create - Create a domain based on config filexm destroy - Terminate a domain immediatelyxm pause - Pause execution of a domainxm reboot - Reboot a domainxm shutdown - Shutdown a domainxm save - Save a domain state to restore laterxm restore - Restore a domain from a saved stateStatus monitoringxm uptime   ; - Displays uptime for a domainxm top &n bsp; - Monitors a host and its domains in real timexm list & nbsp; - Displays domain informationxm info & nbsp; - Displays host informationxm vcpu-list&...
Netapp performance monitoring : sysstat : Part II
2007-11-16 10:56:00 Here are some explanations on the columns of netapp sysstat command. Cache age : The age in minutes of the oldest read-only blocks in the buffer cache. Data in this column indicates how fast read operations are cycling through system memory; when the filer is reading very large files, buffer cache age will be very low. Also if reads are random, the cache age will be low. If you have a performance problem, where the read performance is poor, this number may indicate you need a larger memory system or analyze the application to reduce the randomness of the workload. Cache hit : This is the WAFL cache hit rate percentage. This is the percentage of times where WAFL tried to read a data block from disk that and the data was found already cached in memory. A dash in this column indicates that WAFL did not attempt to load any blocks during the measurement interval. CP Ty : Consistency Point (CP) type is the reason that a CP started in that interval. The CP types are as follows... More About: Performance , Part , Monitoring , Perform
Netapp performance monitoring : sysstat - Part I
2007-11-16 10:39:00 Netapp sysstat is like vmstat and iostat rolled into one command. It reports filer performance statistics like CPU utilization, the amount of disk traffic, and tape traffic. When run with out options, sysstat will prints a new line every 15 seconds, of just a basic amount of information. You have to use control-C (^c) or set the interval count (-c count ) to stop sysstat after time. For more detailed information, use the -u option. For specific information to one particular protocol, you can use other options. I'll list them here. -f FCP statistics -i iSCSI statistics -b SAN (blocks) extended statistics -u extended utilization statistics -x extended output format. This includes all available output fields. Be aware that this produces output that is longer than 80 columns and is generally intended for "off-line" types of analysis and not for "real-time" viewing. -m Displays multi-processor CPU utilization statistics. In addition to the percentag... More About: Performance , Part , Monitoring , Perform
Dont pipe cat
2007-11-12 10:15:00 A basic-but-common grep usage error involves pipe'ing the output of cat to grep to search the contents of a single file. This is absolutely unnecessary and a waste of time, because tools such as grep take file names as arguments. You simply do not need to use cat in this situation at all, as in the following example:[root@un1xf00 root]# time cat passwd | grep rootroot:x:0:0:root:/root:/bin/bashoperat or:x:11:0:operator:/root:/sbin/nologinrea l 0m0.021suser 0m0.000ssys 0m0.030s[root@un1xf00 root]# time grep root passwdroot:x:0:0:root:/root:/bin/bashoper ator:x:11:0:operator:/root:/sbin/nologinr eal 0m0.002suser 0m0.000ssys 0m0.000s[root@un1xf00 root]#Checkout the time taken for both the commands. Dont pipe cat!. More About: Pipe
Disk information using smartctl
2007-11-12 10:05:00 /usr/sbin/smartctl - controls the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive, give detailed information and and predict drive failures, and to carry out different types of drive self-tests. With "-a" option it prints all the SMART information on the disk.[root@un1xf00 root]# smartctl -a /dev/sdasmartctl version 5.1-11 Copyright (C) 2002-3 Bruce AllenHome page is http://smartmontools.sourceforge.net/Devi ce: SEAGATE ST343427UC & nbsp; Version: D713Serial number: MK63N0OQDevice type: diskDevice supports SMART and is EnabledTemperature Warning EnabledSMART Sense: Ok!Current Drive Temperature: 31 CDrive Trip Temperature:   ; 68 CError counter log: & nbsp; Errors Corrected ... More About: Information , Disk
Linux performance tuning - /proc/sys/vm/swappiness
2007-11-12 08:21:00 Linux kernel 2.6 has improved memory subsystem, with which administrators now have a simple interface to finetune the swapping behavior of the kernel. The parameter stored in /proc/sys/vm/swappiness can be used to define how aggressively memory pages are swapped to disk. Linux moves memory pages that have not been accessed for some time to the swap space even if there is enough free memory available. By changing the percentage in /proc/sys/vm/swappiness you can control the swapping behavior, depending on the system configuration. If swapping is not desired, /proc/sys/vm/swappiness should have low values. Systems with memory constraints that run batch jobs (processes that sleeps for long time) might benefit from an aggressive swapping behavior.To change swapping behavior, use either echo or sysctl# sysctl -w vm.swappiness=90Tuning the Linux memory subsystem is a tough task that requires constant monitoring to ensure that changes do not negatively affect other components in the ... More About: Linux , Performance , Proc , Perform
How to identify whether the machine supports full-virtual guests?
2007-11-02 07:32:00 To run fully virtualized guests, host CPU support is needed. This is typically referred to as Intel VT, or AMD-V. To check for Intel VT support look for the 'vmx' flag, or for AMD-V support check for 'svm' flag: Intel# grep vmx /proc/cpuinfo flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lmAMD# grep svm /proc/cpuinfoflags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacyIf you have the 'svm' or 'vmx' flags, then your CPU is capable of fully-virt. More About: Machine , Guests , Virtual , Full , Mach
How to identify whether the machine supports para virtual guests?
2007-11-02 07:29:00 If the machine supports para virtual guests, then you should see a "pae" flag in /proc/info. This means - the machine has PAE support and can run para virtual guests.[root@unixfoo root]# cat /proc/cpuinfo | grep paeflags &nb sp; : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm[root@unixfoo root]#If there is no output for the above command, then the machine is not capable of running a para-virtualized guest. More About: Machine , Guests , Virtual , Para , Mach
Netapp - how to identify disk speed
2007-11-02 05:48:00 Command: storage show disk –a (or) vol status –r Filer> storage show disk –a Disk : 2b.18Shelf: 1Bay:   ; 2Serial: &nb sp; XYZASDFVendor: &nb sp; NETAPPModel:   ; X266_MTOMC320PADRev: &nb sp; &n bsp; R5VVRPM: &nb sp; &n bsp; 5400WWN: &nb sp; &n bsp; x:200:xxxx:1817d2 Filer> vol status -r RAID Disk Device HA SHELF BAY CHAN Pool Type RPM Used (MB/blks) ... More About: Speed
Netapp performance troubleshooting - nfs_hist
2007-11-02 05:41:00 This command displays the latency details of each NFS call and its histogram. Zero the counter with –z option before you start debugging. You should be in advanced privilege to use this command. We can find out from nfs_hist if any particular NFS operation takes more time to respond. What it does, is measure the response time a filer takes to handle a type of nfs call. The key concept is if there is a performance problem dealing with NFS on a filer, you can tell if it's a network problem, or a filer problem by checking how long the filer is taking to respond to calls. If we are quick, then the network should be investigated. If our responses are slow, we need to concentrate on the filer, and not the network.Filer*> nfs_histv3 getattr: 48342 (blocking requests) - millisecond units 0 &nbs p; 1 &nbs p; 2 &nbs p; 3 &... More About: Performance , Troubleshooting , Perform
Load Average
2007-11-01 12:48:00 A very good article on Unix Load averages and how it is calculated [ http://www.linuxjournal.com/article/9001 ] . Worth reading for every sysadmin and performance engineers. More About: Average
OpenProj - Project tool
More articles from this author:2007-11-01 09:08:00 In project management tools, now there is an alternative to MS Project . OpenProj is a new open source solution for project management. It’s simple user interface is very similar to that of Microsoft Project. OpenProj is ideal for desktop project management and is available on Linux, Unix, Mac or Windows. It even opens existing Microsoft or Primavera files. OpenProj shares the industry's most advanced scheduling engine with Project-ON-Demand and has Gantt Charts, Network Diagrams (PERT Charts), WBS and RBS charts, Earned Value costing and more. There is literally no time or effort involved in switching to OpenProj, and your teams can manage projects on any platform for free. URL : http://openproj.org/openproj More About: Tool 1, 2, 3 |



