Tuesday, December 1, 2009

How to see the path of a process that's listening on specific port

From time to time you can have multiple instances of Apache installed on your server. As ps aux only shows the entire path, if you started the process using full path convention; you need to check /proc presudo file system to gather path information for the process. I generally use the below one liner to fetch this info :

[root@VM1 bin]# ls -altr /proc/`netstat -natp | grep 80 |  awk '{print $7}' | awk -F/ '{print $1}'`/exe
lrwxrwxrwx 1 root root 0 Nov 30 13:03 /proc/25316/exe -> /apache_test/bin/httpd

It uses netstat to gather process ID for specific port (also lsof can be used) then checks the /proc/$PROCESS_ID/exe soft link to see where the process resides. 



Saturday, November 21, 2009

How to increase the Logging Level of NFSD

NFS Server logging is by default very good, but in case you need more logging for deeper inspection you can use :
echo 32767 > /proc/sys/sunrpc/nfsd_debug 
echo 32767 > /proc/sys/sunrpc/rpc_debug 
And for the client side use :
echo 32767 > /proc/sys/sunrpc/nfs_debug
In order to return back to old debugging level use :
echo 0 > /proc/sys/sunrpc/nfsd_debug
echo 0 > /proc/sys/sunrpc/rpc_debug
echo 0 > /proc/sys/sunrpc/nfs_debug 

Sunday, November 15, 2009

Master Certificate in Experts-Exchange

I really find Experts-Exchange a great way of challenging yourself for different problems then you have in your daily job. As I contribute in various areas, I could finally got enough points to get Master Certificate. Next target is Guru ;-)

How to Rescan SCSI Bus in Linux

I have a RHEL5 lab on my laptop, that's hosted on Vmware 7. For my RHCE prep I usually add/remove disks while the VM is up and running (hot swap). In order to make Redhat recognize the new disk you need to trigger the rescan of the SCSI bus :
echo “- - -” > /sys/class/scsi_host/hostX/scan
instead of hostX use the HBA ID. It's host0 in my case. Immediately after you can see the new disk on "fdisk -l"


NOTE : This works on 2.6 kernel only.

Friday, October 30, 2009

SCVMM Unknown Error 0x80338104

If you get the below error message on SCVMM while connecting to your hosts :

VMM does not have appropriate permissions to access the WSMan resources on the vmtest server.
 (Unknown error (0x80338104))
Make sure you have the Service Account for VMM is under Local Administrator Group of each host you manage and this is not blocked by group policy enforcements.

Saturday, October 17, 2009

SCVMM Error 403 : %ComputerName; is not a valid network computer name

While adding your Hyper-V hosts to your VMM inventory. If you get the error below :

Error 403 : %ComputerName; is not a valid network computer name

please make sure you are resolving the DNS entry for that host correctly. Especially check /etc/hosts file for any incorrect static entries (that's was the problem in my case)

Sunday, September 6, 2009

Windows 2008 Failover Clustering and HP EVA Storage

If you are using HP EVA and getting the below error during the WCS validation phase in Windows 2008 :


Failed to read drive layout of Cluster disk 0 from node ****, status 21
Cluster Disk 0 does not support Persistent Reservation
Test failed. Please look at the test log for more information

Make sure Windows LH Host Mode is configured for your LUN. Below article is a guidance for Win2k8 and HP EVA config :

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01764063/c01764063.pdf

Page 17 :

Configuring EVA host connections


Make sure the Windows LH Host mode is enabled for each node on the Enterprise Virtual Array
(EVA) through command view. Depending on what command view you have installed, if in the drop-
down there is no "Microsoft Windows LH" then choose custom and type in the custom type field the
following HEX number 00000004198009A8 (Figure 1). If the wrong connection type is configured,
you cannot share the disks between the cluster nodes and the cluster check will fail with a non-SCSI-3
compliant message.