Friday, May 27, 2011
Simle logs backup script
#!/bin/sh
cd /var/log/httpd/
tar -zcf httpd.tgz .
mv httpd.tgz /home/public/backup/
cd /home/public/backup
ls -la | mail -s "backup $HOSTNAME -'date'" myEmailID@companyDomainName.com
Tuesday, April 19, 2011
Samba without Password
Change it to :>
# security = user
security = share
also remove the semicolon from the below line.
guest account = nobody[ABCProject]
guest ok = yes
guest only = yes
path = /Path to ABC Project
read only = yes
browseable = yes
[Share name]
writable = yes
path = /path/to/directory
public = yes
guest ok = yes
guest only = yes
guest account = nobody
browsable = yes
save and exit
:wq
/etc/init.d/samba restart
that's all.
Tuesday, April 5, 2011
Active Directory and DNS Health Check
This is a must and will always tell you if there is trouble with your DCs and/or services associated with it
Netdiag.exe /v >> c:\Reports\pre_Netdiag.txt
This will let me know if there are issues with the networking components on the DC.
Netsh dhcp show server >> c:\Reports\pre_dhcp.txt
Some may not do this but I've felt the pain of a DHCP server somehow not being authorized after a patch. This allows me verify the server count and names.
Repadmin /showreps >> c:\Reports\pre_rep_partners.txt
This shows all my replication and if it was successful or not. Just be aware that Global Catalogs will have more info here than a normal domain controller.
repadmin /replsum /errorsonly >> c:\Reports\pre_repadmin_err.txt
This is the one that always takes forever but will let you know who you are having issues replicating with.
DNSLINT is a good tool for checking your DNS
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=dd7a00df-1a5b-4fb6-a8a6-657a7968bd11
http://technet.microsoft.com/en-us/library/cc976711.aspx
http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=CB42FC06-50C7-47ED-A65C-862661742764
Risk and Health Assessment Program for Active Directory (ADRAP) – Scoping Tool v1.6
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=22205827-C164-4B62-9F8D-C3CD6077BD82
Microsoft Assessment and Planning Toolkit
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=67240B76-3148-4E49-943D-4D9EA7F77730
Microsoft Baseline Security Analyzer 2.2 (for IT Professionals)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=02BE8AEE-A3B6-4D94-B1C9-4B1989E0900C
Microsoft Exchange Best Practices Analyzer v2.8
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=DBAB201F-4BEE-4943-AC22-E2DDBD258DF3
Microsoft Active Directory Topology Diagrammer
http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=CB42FC06-50C7-47ED-A65C-862661742764
Microsoft Office Visio 2007 Professional Add-In for Rack Server Virtualization (Virtual Rack)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3250331A-0116-4064-92D1-50B9B0727B75
Remote Server Administration Tools for Windows 7
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7D2F6AD7-656B-4313-A005-4E344E43997D
Microsoft Exchange Server User Monitor
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9A49C22E-E0C7-4B7C-ACEF-729D48AF7BC9
Thursday, February 17, 2011
error parsing the server clients.xml file windows xp
1) UnInstall KB982168 patch from "Add remove program".
2) Try to connect with vSphere Client to a server, which error messages do you get?
This was caused by a .Net 3 SP2 patch
Tuesday, January 18, 2011
MPLS Vs IPLC
A Label Switch Path (LSP) can be established in MPLS that crosses multiple Layer 2 transports like ATM, Frame Relay or Ethernet. Thus, one of the true promises of MPLS is the ability to create end-to-end circuits, with specific performance characteristics, across any type of transport medium, eliminating the need for overlay networks or Layer 2 only control mechanisms.
IPLC basically uses Layer 3 (Routing) to build a path for the data to flow in the network. Data routing in an IPLC is done using complex route lookups based on the destination IP address. The routing hardware finds the shortest path between the source and destination IP addresses to send data. This can be a hardware intensive task in times of heavy traffic leading to slower data traffic speeds. With hardware becoming more powerful every day, this is not such a major issue.
However, IPLC has major drawbacks in situations where traffic engineering and setting performance characteristics for different classes of traffic are required. Factors like delay and jitter also come into the picture in an IPLC connection that can cause major drops in QoS levels. This can cause problems in networks where data like video-conferencing are used.
MPLS has an edge over IPLC on this front since it provides network administrators the ability to set the path traffic will take through the network, and set performance characteristics for a class of traffic.
If your network requirements are such that you only need point-to-point connectivity, an IPLC typically will cost less than an MPLS circuit. Since an IPLC is your own private circuit, you can use your managed switches to prioritize traffic. But if you have any near future to add a third node to this network, MPLS will be the best way to go
MPLS could provide at least 2 types of link for this.
a) You can have a layer 2 MPLS (which sort of pretends to be an Ethernet WAN link of various flavours).
this type of service normally needs Ethernet access at each site -so you can connect directly to your LAN switches (but you shouldstill route over the WAN to control what is going on).
Or go for a L3 service - tends to cost more, but more flexible, and likely to allow other services if you want them.
Then you have to decide whether you run the CE routers on the service, or get that bundled, or hook direct to your WAN switches.
Then decide what QoS you want if any, what speed access tails and what type of connections, then possibly how much bandwidth to be rate limited.
The flip side with MPLS is someone else is looking after it for you, and you can add more sites since you have connected to a "cloud" service.
CentOS upgrade from 5.2 to 5.5 (final)
#ps auxwww | grep -i yum
#kill -9
Remove any excluded packages by commenting out any exclude=XXXXX lines in /etc/yum.conf
#yum -y upgrade
This will upgrade the kernal as well.
you need to reboot the machine to reflect the new kernel.
If you just want to upgrade the kernel not the OS packages.
#yum upgrade kernel
or
#yum upgrade kernel-smp (4+ gb ram)
when the kernel upgrade completes edit the grub.conf
nano /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.32.1.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.32.1.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-92.1.13.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-92.1.13.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.1.13.el5.img
title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img
here point to note
Grub starts at 0, so "default=0".
reboot the machine by
shutdown -r now
or
init 6
When it comes back up run uname -a to make sure it has the new kernel.
If you want to use your old kernel then set "default=1"
Monday, January 17, 2011
How to install xdebug & MysqlND on CentOS
1. yum install php-pear
2. Yum install php-devel
The pecl command can then be found at /usr/bin/pecl
You can just use the pecl command to install new extensions like
3.sudo pecl install xdebug
Build process completed successfully
Installing '/var/tmp/pear-build-root/install-xdebug-2.1.0//usr/lib/php/modules/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.1.0
You should add "extension=xdebug.so" to php.ini
At this point, you should open your php.ini file an add the line as suggested, but use the zend_extension directive as follows:
zend_extension = usr/lib/php/modules/xdebug.so
How to Test it
vim xdebug.php
function test(){
echo "Called @ ".xdebug_call_file().
":".xdebug_call_line()." from".
xdebug_call_function();
}
test();
?>
:wq (Save and exit)
now
# php -e xdebug.php
should return like
Called @ /root/phpscript.php:8 from{main}
wow, you are done....
mysqlnd is a 5.3 feature
MySQLnd will most likely be the database driver for both the PDO MYSQL extension
and mysqli extension in PHP 5.3. It is still under development, but there are
currently releases for the mysqli extension.
The MySQL native driver for PHP is part of the official PHP source code repository at
http://php.net. It is contained in the PHP source code as of PHP 5.3.
If you are compiling PHP yourself, please use the configure options
--with-mysql=mysqlnd, --with-mysqli=mysqlnd and --with-pdo-mysql=mysqlnd
to compile PHP with mysqlnd support.
Let’s see how PHP and MySQL works together. Here is the list of three extensions which PHP uses to connect to MySQL.
mysql
mysqli
pdo mysql
All of the above mentioned extensions are rely on MySQL’s client library libmysql. Mysqlnd is an another and alternative way of connecting PHP 5 and PHP 6 to the MySQL Server. Now the question arises why use Mysqlnd instead of other extensions ?
Here is the list of advantages of Mysqlnd library over other mentioned extensions.
- It is very easy to compile, it does not have any dependencies issues with mysql client programming support.
- It performs much better then libmysql in certain cases.
- It provides persistent connections for mysqli.
- It key feature is that it uses PHP memory management and it supports PHP memory limit.
- It is famous for reducing memory footprint because it stores every row only once in memory while in the case of libmysql it is saved twice in memory.
By default the MySQL database extensions are configured to use MySQL Client Library. In order to use the MySQL Native Driver, PHP needs to be built specifying that the MySQL database extensions are compiled with MySQL Native Driver support. This is done through configuration options prior to building the PHP source code.
For example, to build the MySQL extension, mysqli and PDO MYSQL using the MySQL Native Driver, the following command would be given:
./configure --with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
[other options]
As most of the pre-packaged PHP binary installations may not have the support for mysqlnd enabled by default, it is recommended to build PHP and the required database extensions with mysqlnd from the source code
Upgrade PHP 5.1 to 5.3 on CentOS 3
# yum install yum-priorities
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
# yum install httpd
# yum remove php php-*
# yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp
# vi /var/www/html/phpinfo.php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
# service httpd restart
Finally browse to your phpinfo.php http://x.x.x.x/phpinfo.php and view your newly configured PHP 5.3.3 Apache server.
Thursday, December 30, 2010
Name Name Name , What is in a Name, How to Name a machine
- Whether the system is virtual.
- Whether the system is in development or production.
- What application or operating system is running on the system.
- Whether it is the first, second, or third (etc.) of a sequence.
say a virtual server , for production use, exchange server, 001
VPxch001.yourcompanydomain.com
Thursday, November 18, 2010
Apache daily Logrotate in linux
In Linux kernel, program daemons, firewalls, etc, generate their respective log files and they are everywhere. In fact, there are so many log files of various levels that sometimes, it can be a nightmare to maintain them.
Log files are one of the most important files where almost all precious and sometimes unnecessary information are stored in regard to your server’s running state.
tail -f /var/log/messages ” is the command if you want to get feel and see the actual current logs generated by various daemons running on your system.
Now if your server also has a Apache Web server running and you want to manage their respective logs in your own fashion, then the following information might help you out.
How to see them
tail -f /var/log/httpd/access_log
First of all, you will need the program called “logrotate”. Logrotate is very useful utility which can rotate log files and archive them in a location that you specify. We will be using “logrotate” in conjunction with “cron“.
By Default the logrotate.conf file have weekly rotation of logs and logs are kept for 4 weeks.
cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files daily
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
if you want to change them then you have to change the
weekly ---->daily
rotation
4---->2
like below.....
cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files daily
daily
# keep 4 weeks worth of backlogs
rotate 2
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
minsize 1M
create 0664 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
or you can use command to do the same
perl -pi -e 's/weekly/daily/' /etc/logrotate.conf
perl -pi -e 's/rotate 4/rotate 2/' /etc/logrotate.conf
To cross check
logrotate -dv /etc/logrotate.d/httpd
Thursday, November 11, 2010
USB drive format by linux machine
#mkfs.vfat /dev/sdxx
now mount it
#mount -t vfat /dev/sdxx /media/usbdir
#umount /media/usbdir
How to check files in linux without comments
Backup of Important Files in linux
/etc/passwd
/etc/users
/etc/groups
/home/userName
save and exit by :wq
now
# tar -zcf backup-`date +%Y-%m-%d`.tar.gz -T /MyBackupFiles.txt
Mail Send by command line
#echo | mutt -a mybackup.tar -s “daily backup” abc@mydomain.com
#printf “Hello\nWorld” | mail abc@xyz.com
#printf “This is the main body of the mail\n with line break” | mail -s “Subject of the Email” to@abc.com -f from@abc.com
# echo “Welcome to Jungle ” | mail -s “Hello world” abc@xyz.com -c pqr@xyz.com -b ghi@xyz.com
#( df -h; free -m ) | mail -s "disk and RAM report" abc@xyz.com
Wednesday, November 10, 2010
Adding second harddisk to ESXi
Click "Add Storage..."
Choose the new disk, and go.
or
If you are in a non-production environment you just :
- down the server
- put into the server the new disk
- start the server and make attention to controller BIOS utility to create LUN
- create the new LUN using the new disk
- start and connect with VI client to ESX
- follow the procedure described bottom to discover and format the new disk as VMFS
Tuesday, October 19, 2010
Hyperic HQ on CentOS 5.5 and MySQL
/etc/init.d/mysql start
2. Set the password for Mysql
/usr/bin/mysqladmin -u root password 'yourPassword'
3. Login to Mysql
#mysql -u root -p
4. CREATE USER 'hqadmin'@'localhost' IDENTIFIED BY 'hqadmin'
5 . GRANT ALL ON *.* TO 'hqadmin'@'localhost';
6. create database HQ;
7. mysql>
GRANT ALL PRIVILEGES
ON HQ.*
TO 'hqadmin'@'localhost'
IDENTIFIED BY 'hqadmin'
WITH GRANT OPTION;
8. FLUSH PRIVILEGES;
[nkumar@testpedia hyperic-hq-installer]$ ./setup.sh -mysql
Unpacking JRE to temporary directory /tmp/jre
Please ignore references to missing tools.jar
Unable to locate tools.jar. Expected to find it in /tmp/lib/tools.jar
Initializing Hyperic HQ 4.4.0 Installation...
Loading taskdefs...
Taskdefs loaded
Choose which software to install:
1: Hyperic HQ Server
2: Hyperic HQ Agent
You may enter multiple choices, separated by commas.
1,2
HQ server installation path [default '/home/hyperic']:
Enter the JDBC connection URL for the MySQL Enterprise / Community Server 5.x database [default 'jdbc:mysql://localhost:3306/HQ']:
Enter the username to use to connect to the database:
hqadmin
Enter the password to use to connect to the database.:
(again):
HQ agent installation path [default '/home/hyperic']:
Loading install configuration...
Install configuration loaded.
Preparing to install...
Validating agent install configuration...
Validating server install configuration...
Checking server webapp port...
Checking server secure webapp port...
Checking server JRMP port...
Checking server JNP port...
Checking database permissions...
Verifying admin user properties
Validating server DB configuration...
Installing the agent...
Looking for previous installation
Unpacking agent to: /home/hyperic/agent-4.4.0...
Installing the agent JRE ...
Unpacking JRE x86-linux-glibc2-jre-1_5.tar.gz to: /home/hyperic/agent-4.4.0...
Setting permissions on agent binaries...
Fixing line endings on text files...
--------------------------------------------------------------------------------
Installation Complete:
Agent successfully installed to: /home/hyperic/agent-4.4.0
--------------------------------------------------------------------------------
You can now start your HQ agent by running this command:
/home/hyperic/agent-4.4.0/bin/hq-agent.sh start
Installing the server...
Unpacking server to: /home/hyperic/server-4.4.0...
Creating server configuration files...
Copying binaries and libraries to server installation...
Copying server configuration file...
Copying server control file...
Copying server binaries...
Copying server db-upgrade files...
Copying server libs...
Setting up server database...
Installing the server JRE ...
Unpacking JRE x86-linux-glibc2-jre-1_6.tar.gz to: /home/hyperic/server-4.4.0...
Setting permissions on server binaries...
Fixing line endings on text files...
--------------------------------------------------------------------------------
Installation Complete:
Server successfully installed to: /home/hyperic/server-4.4.0
--------------------------------------------------------------------------------
You can now start your HQ server by running this command:
/home/hyperic/server-4.4.0/bin/hq-server.sh start
Note that the first time the HQ server starts up it may take several minutes
to initialize. Subsequent startups will be much faster.
Once the HQ server reports that it has successfully started, you can log in
to your HQ server at:
http://10.32.1.90:7080/
username: hqadmin
password: hqadmin
To change your password, log in to the HQ server, click the "Administration"
link, choose "List Users", then click on the "hqadmin" user.
Setup completed.
A copy of the output shown above has been saved to:
/home/hyperic/hyperic-hq-installer/installer-4.4.0/logs/hq-install.log
Deleting temporary JRE
[nkumar@testpedia hyperic-hq-installer]$
[nkumar@testpedia hyperic-hq-installer]$ /home/hyperic/server-4.4.0/bin/hq-server.sh start
Starting HQ server...
Initializing HQ server configuration...
Checking jboss jndi port...
Checking jboss mbean port...
Verify HQ database schema...
Unable to locate tools.jar. Expected to find it in /home/hyperic/server-4.4.0/lib/tools.jar
Loading taskdefs...
Taskdefs loaded
Booting the HQ server (Using JAVA_OPTS=-XX:MaxPermSize=192m -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError)...
HQ server booted.
Login to HQ at: http://127.0.0.1:7080/
[nkumar@testpedia agent-4.4.0]$ cd bin/
[nkumar@testpedia bin]$ ls
hq-agent.bat hq-agent.sh
[nkumar@testpedia bin]$ ./hq-agent.sh start
Starting HQ Agent...
- No token file found, waiting for Agent to initialize
[ Running agent setup ]
What is the HQ server IP address: 10.32.1.90
Should Agent communications to HQ always be secure [default=no]:
What is the HQ server port [default=7080]:
- Testing insecure connection ... Success
What is your HQ login [default=hqadmin]:
What is your HQ password:
What IP should HQ use to contact the agent [default=10.32.1.90]:
What port should HQ use to contact the agent [default=2144]:
- Received temporary auth token from agent
- Registering agent with HQ
- HQ gave us the following agent token
1287485373135-2043646290005887556-7886790376674905170
- Informing agent of new HQ server
- Validating
- Successfully setup agent
[nkumar@testpedia bin]$
Copy and paste the windows client agent to the windows machine.
open the command prompt
C:\hyperic-hq-agent-4.4.0\bin
C:\hyperic-hq-agent-4.4.0\bin>hq-agent.bat install
wrapper | Hyperic HQ Agent installed.
C:\hyperic-hq-agent-4.4.0\bin>hq-agent.bat start
C:\hyperic-hq-agent-4.4.0\bin>hq-agent.bat install
wrapper | Hyperic HQ Agent installed.
C:\hyperic-hq-agent-4.4.0\bin>hq-agent.bat start
wrapper | Starting the Hyperic HQ Agent service...
wrapper | Hyperic HQ Agent started.
[ Running agent setup ]
What is the HQ server IP address: 10.32.1.90
Should Agent communications to HQ always be secure [default=no]: yes
What is the HQ server SSL port [default=7443]:
- Testing secure connection ... Success
What is your HQ login [default=hqadmin]:
What is your HQ password:
What IP should HQ use to contact the agent [default=10.32.1.10]:
What port should HQ use to contact the agent [default=2144]:
- Received temporary auth token from agent
- Registering agent with HQ
- HQ gave us the following agent token
1287486594154-1703742189515298800-4312413996966000623
- Informing agent of new HQ server
- Validating
- Successfully setup agent
C:\hyperic-hq-agent-4.4.0\bin>
Tuesday, October 12, 2010
How to Install SUN Java on CentOS 5.5
2. From java SE download section , select Java JDK.
3. Choose linux for 32 bit or linux x64 for a 64 bit version from "platform" section and press continute.
a. for 64 bit java
4.wget -c "location of .bin file ". if you are using putty the just right click on the hyper link and "copy link location", then just right click on the putty.
5. ./jdk-6u22-linux-i586.bin?A................. or sh jdk-...whatever version you have downloaded
5a. copy java from this location to /usr/java
6. alternatives –-install /usr/bin/java java /usr/java/jdk1.6.0_22/bin/java 2
7. alternatives --config java
9.There are 4 programs which provide 'java'.
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
* 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
+ 3 /opt/jdk1.6.0_22/bin/java
4 /usr/java/jdk1.6.0_22/bin/java
Enter to keep the current selection[+], or type selection number: 4 10. check the java installation sudo java -version [sudo] password for nkumar: java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) Also install JPackage from http://jpackage.org/yum.php configure the jpackage repositories in yum Create a new file /etc/yum.repos.d/jpackage.repo and copy the file from jpackage site. # yum install -y jpackage-utils For detailed information please visit http://wiki.centos.org/HowTos/JavaOnCentOS
Monday, October 4, 2010
500 firewall error after upgrading to exchange 2007 from exchange 2003
The issue appears when we send the bulk mails/multiple recipient with same subject and time stamp. The issue was completely random. sometimes mail delivered and sometime not.
Fix:
We have cisco router and firewall at gateway. after some debugging we found that issue was due to IP INSPECT feature in cisco IOS.
After running the below command the issues disappears.
no ip inspect name SDM_LOW esmtp
http://www.cisco.com/en/US/docs/ios/security/command/reference/sec_i2.html
ip inspect name esmtp
no ip inspect name esmtp
Tuesday, September 28, 2010
Which process is eating away the memory
which process is using up your memory using ps, awk, sort
The following command lists all the process sorted based on the used memory size.
$ ps aux | awk '{if ($5 != 0 ) print $2,$5,$6,$11}' | sort -k2n
PID VSZ RSS COMMAND
3823 3788 484 /sbin/mingetty
3827 3788 484 /sbin/mingetty
3830 3788 484 /sbin/mingetty
3833 3788 488 /sbin/mingetty
3834 3788 484 /sbin/mingetty
3873 3788 484 /sbin/mingetty
2173 3796 568 /usr/sbin/acpid
1835 3800 428 klogd
1832 5904 596 syslogd
2054 5932 540 /usr/sbin/sdpd
2281 6448 360 gpm
The above command lists the PID, Used virutal memory size, Used resident set-size and process command. The output is sorted on VSZ.
While debugging performance issues, use this command to find out which process is using up the memory.
Find out Top 10 Largest File or Directory Using du, sort and head
du command shows summarized disk usage for each file and directory of a given location (/var/log/*). The output of a sort command is reversely sorted based on the size.
# du -sk /var/log/* | sort -r -n | head -10
1796 /var/log/audit
1200 /var/log/sa
612 /var/log/anaconda.log
512 /var/log/wtmp
456 /var/log/messages.4
92 /var/log/messages.2
76 /var/log/scrollkeeper.log
72 /var/log/secure
56 /var/log/cups
48 /var/log/messages.1
How to Resolve VC Service Problem - VC data base limit 4 GB
Posting this with the permission of my colleague Mike
Problem:
Surface Problems:
No clients can connect to the Virtual Center; error usually states a problem with “remote computer”. The remote computer is the virtual center server. Upon checking the virtual center server, you should notice that the “VMWare virtual center server” service is not running. The Virtual Center service will not start. It repeatedly stops after attempting to start the service manually or after reboot (automatically).
Root Problem:
The Virtual Center Database was at the 4GB limit.
The first error I noticed was the “unexpectedly shutdown error” (first error shown above). After digging through the logs you may start to see other errors indicating a database problem.
Resolution:
Use KB article http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000125
In short, do the following:
Stop services
Backup database
Run script to trim database size
Shrink database
Restart services
Stop/Start Virtual center services:
Log into the virtual center server, go to services and stop/start the VMWare VirtualCenter Server service
Backup Database for Virtual Center
We use MSSQL Express Database for our VC environment.
Open SQL Server Management Studio application; login in with windows authentication (default settings)
Browse to the database being used by Virtual Center – In our case VIM_VCDB
Right Click the DB, select tasks and backup. A backup window will appear:
Ensure that the appropriate DB is selected and that a FULL backup is selected.
Create a name for the backup and note where the backup will be located once complete. Then press OK.
Your backup will run and the progress bar (bottom left corner) will indicate when it is complete. This can take more than 30 minutes.
Run Script to clean up database:
I have downloaded the script on our virtual center server. It is located on the mtalbot desktop. The script can be downloaded from the KB article posted above.
I highly recommend that you watch the video in the KB article! It is short and easy to understand.
In short you need to open the script; it should open in SQL server management studio. YOU MUST CHANGE THE DATABASE TO THE VIRTUAL CENTER DATABASE VIM_VCDB.
Execute the script to get an idea of how many rows will be deleted.
There are two things that need to be adjusted in order to execute the script and delete rows.
1. The “SET @DELETE_DATA = 0 “
a. If set to 0, then no data will be deleted.
b. If set to 1, then data will delete from the DB
2. The “SET @CUTOFF_DATE = GETUTCDATE – 180”
a. Change the number to the amount of days you would like to delete data
b. A suggestion is to delete minimal days and review the size of your database. If you are comfortable with the size of the database, you do not need to delete more days.
Notes about Database and Script:
*SQL Express has a data limit size of 4GB. If our database is approaching or at 4GB this is when we run into this problem. We need to backup database, trim records from db.
*The SQL script will delete tasks, events, and performance data. Simply comment or delete the applicable section of the script if any of these items are not to be purged.
*You can build a new query to monitor the transaction log progress. This will tell you how the log files and space are being updated during the execution of the original script run.
Again, review the video in the KB article for more information.
Shrink Database:
Open SQL Server Management
Browse to the database being used by Virtual Center – In our case VIM_VCDB
Right Click the DB, select tasks, shrink and database.
A window will pop up to allow you to manage the process, review your settings and click OK. Verify you are working with the correct DB. Also, note the size and free space available.
The progress bar in the bottom left corner will let you know when the process is complete.
Once the shrink is complete, restart the server or service for VMWare Virtual Center Server.
Stop/Start Virtual center services:
Log into the virtual center server, go to services and stop/start the VMWare VirtualCenter Server service

