ESXGuide - System Performance Services Tasks Installation
   
     
 
 
     
 
Main Menu
Home
Articles, Tips, Solutions
Contact
Sitemap
Downloads
Login Form





Lost Password?
No account yet? Register
To add contents please register and login.

Index arrow Server arrow Linux

System Performance Services Tasks Installation PDF Print E-mail
System Performance Services Tasks Installation
chkconfig --list

This service console tool displays a table showing which daemons are enabled for the run levels for the vmnix operating system.

ntpd   0:off 1:off 2:on  3:on  4:on  5:off 6:off
syslog 0:off 1:off 2:on  3:on  4:on  5:off 6:off
snmpd  0:off 1:off 2:off 3:off 4:off 5:off 6:off

If we wanted to change a service so that it is enabled for a particular run level, then we can use chkconfig –level.

chkconfig --level 1 ntpd on

The above command would turn on ntpd for run level 1, this would not affect the run levels that ntpd was already set for. So in this example, the ntpd run levels would be

ntpd 0:off 1:on 2:on 3:on 4:on 5:off 6:off

chown Changes the owner user and optionally owner group of a directory, or a file. Optionally this command works recursively with parameter "-R". The assignment parameter is of type "user.group", or just "user". Some examples are given below:

chown -R helpdesk.vmadmins /vmfs /data

Recursively change the user-owner, and the group-owner of specified files/directories to userid.groupid.

chown helpdesk.vmadmins /vmfs/local/*

chown -R root /data/vmware

chown root.vmadmins /etc/modules.conf

 

clearEquivalent of CLS command in MS-DOS and in Windows command prompt.
crontabSchedule -tasks

The crond service must be running.
To determine if the service is running, use the command /sbin/service crond status

Each line in the /etc/crontab file represents a task and has the format:

minute hour day month dayofweek command

Example:
42 4 1 * * root run-parts /etc/cron.monthly

minute - any integer from 0 to 59
hour - any integer from 0 to 23
day - any integer from 1 to 31 (must be a valid day if a month is specified)
month - any integer from 1 to 12 (or the short name of the month such as jan or feb)
dayofweek - any integer from 0 to 7, where 0 or 7 represents Sunday (or the short name of the week such as sun or mon)
command - the command to execute (the command can either be a command such as ls /proc >> /tmp/proc
          or the command to execute a custom script)

If a cron task needs to be executed on a schedule other than hourly, daily, weekly, or monthly,
it can be added to the /etc/cron.d directory. All files in this directory use the same syntax as /etc/crontab.
Refer to following example for examples. 
# record the memory usage of the system every monday
# at 3:30AM in the file /tmp/meminfo
30 3 * * mon cat /proc/meminfo >> /tmp/meminfo
# run custom script the first day of every month at 4:10AM
10 4 1 * * /root/scripts/backup.sh

For any of the above values, an asterisk (*) can be used to specify all valid values. 
For example, an asterisk for the month value means execute the command every month within the constraints of the other values. 
A hyphen (-) between integers specifies a range of integers. For example, 1-4 means the integers 1, 2, 3, and 4. 
A list of values separated by commas (,) specifies a list. For example, 3, 4, 6, 8 indicates those four specific integers. 
The forward slash (/) can be used to specify step values. The value of an integer can be skipped within a range by following the range with /<integer> . 
For example, 0-59/2 can be used to define every other minute in the minute field. Step values can also be used with an asterisk. 
For instance, the value */3 can be used in the month field to run the task every third month. 
Any lines that begin with a hash mark (#) are comments and are not processed. 
As shown in the /etc/crontab file, it uses the run-parts script to execute the scripts in the /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, 
and /etc/cron.monthly directories on an hourly, daily, weekly, or monthly basis respectively. The files in these directories should be shell scripts. 

Users other than root can configure cron tasks by using the crontab utility. All user-defined crontabs are stored in the /var/spool/cron directory and are executed using the usernames of the users that created them. To create a crontab as a user, login as that user and type the command crontab -e to edit the user's crontab using the editor specified by the VISUAL or EDITOR environment variable. The file uses the same format as /etc/crontab. When the changes to the crontab are saved, the crontab is stored according to username and written to the file /var/spool/cron/username.

The cron daemon checks the /etc/crontab file, the /etc/cron.d/ directory, and the /var/spool/cron directory every minute for any changes. If any changes are found, they are loaded into memory. Thus, the daemon does not need to be restarted if a crontab file is changed.
 

dd

 

With this 'disk dump' command you can create ISO images and floppy images. You can also use it to create imagefiles of partitions and whole disks. Below are some example commands:

dd if=/dev/cdrom of=/local/suse90pro-dvd1.iso bs=2048

dd if=/dev/cdrom of=/local/w2003srv.iso bs=2048

The above two examples create an ISO image of a CD/DVD. You can safely ignore the error message usually shown at the end of the media.

dd if=/dev/fd0 of=/local/bootfloppy1.img bs=1440k

This command creates a floppy image quickly.

You can also use the freeware Emt4win utility for Windows download to create floppy images

dd if=/dev/fd0 of=/local/bootfloppy2.img bs=512

This might be a bit slower version of the above example.

This tool can be used to create an additional swap file.

For example, if we did not allocate a big enough swap partition for the service console during ESX installation, we can create one now in a file of 64MB.

dd if=/dev/zero of=/swapfile bs=1M count=64

If we did add a swap file, we would need to make sure it is started when ESX starts. Therefore, an entry in /etc/fstab would be needed as this file describes the local and remote file systems to mount at boot. The total amount of service console swap space is the sum of the swap partition and any swap files that are active.


See also:

mkswap, swapon, swapoff

dpkgPackage manager for .deb packages (Debian distribution).Technical difference to rpm is very small. Mostly handled through apt, dselct, aptitude, gnome-apt, synaptic, kpackage.
free -m Shows free memory in the service console. The "-m" switch specifies to display the results in megabytes
grep Search for a string from standard input or from a file. This is a powerful command.
groupadd Adds a new group to the Service Console. It is recommended to use one non-root group for VM admins and add operator/admin users there. To create that group, enter the following command:

groupadd -g 7777 vmadmins

Create a group with groupid number 7777. This number is an arbitary number. For practical (not explained here) reasons this number should have four digits.

 

gzip|gunzip These commands compress and decompress files. The recommended and default extension is .gz. The compression is quite fast, and files are quite small. Decompression is fast.

 

halt Does a nice halt on the system. Does "Force Power Off" for the VMs.
mkswapA command that must be run against a newly created swap file in
modinfo Displays the option of a loaded module.

modinfo e1000   Will produce a list of possible setting on the Network adapter as flow control

With vmkload_mod -l you can  list all loaded modules 

lsof

List open files Pipe the results into grep to check for open ports

lsof |grep IPv4.\*LISTEN

kudzu This is the RedHat's tool to detect and configure hardware: adding new and removing old. When you run kudzu, or system runs it at bootup, be careful. Kudzu might offer to remove hardware you have dedicated solely to the VMs. Know your hardware and configuration. It might be a good idea to refer to /etc/modules.conf file before running kudzu. A safe action to select in kudzu is "Do nothing". Select it when in doubt.
lsmodeshows information about all loaded modules

Lists drivers loaded for the service console linux. Remember this command differs from the vmkload_mod utility which shows the modules loaded for the VMkernel.

Module          Size   Used by Tainted: PF
vmnixmod        177056 121
e1000           68456  0 (unused)
usb-uhci        21220  0 (unused)
usbcore         50112  1 [usb-uhci]
megaraid2       32928  6

The same information can be found by cat /proc/modules

lspciList PCI devices
H1    uses direct HW access
-n    shows PCI vendor and device codes
-t     Print tree of PCI Devices -tv for verbose tree
-v    verbose mode
-vv   very verbose mode
-M   never use.It might crash ESX Server

Also check the file /proc/pci

man Displays the manual page for a specified command. Press the spacebar to go to the next screen of text. Press q to exit from the display when you are finished.

man cat
Display the manual page for the command cat.

more Display the contents of a specified file one screen at a time. Use the spacebar to move forward through the file a screen at a time; use the Enter key to move forward through the file one line at a time.

more myfile
Display the contents of the file myfile.
ntpdate This command takes an NTP server as a parameter and synchronizes the clock once. This command doesn't work when local NTP daemon is running. Example: ntpdate europe.pool.ntp.org 

 

passwd Changes the password for the userid entered as a parameter for the command. Only root can change the password for other users. They can only change their own password with command "passwd". Userids are disabled by default. They are activated by setting a password for them. An example command for root to set a password is the following command:

passwd johndoe
 
pidof

Finds the PID of a named process.

pidof vmware-ccagent

ps

Show running processes in the service console.

ps –A ps –eaf
ps –eaf |grep vmware-serverd
ps –efw

is useful as the “w” indicates wide format, so we can see the full directory path to the vmx file.

pstree -phShow process tree with PIDs and ancestors
pwdShow the path to the present working directory.
reboot Prints the manual page for a command or a configuration file entered as a parameter to this command.
reniceChange process priority. If there were many VMs running concurrently, it may be necessary to temporarily raise the priority of the MUI in order to complete administrative tasks
renice [-n increment][ -g| -p| -u] ID...

-n
increment Specify how the system scheduling priority of the specified process or processes is to be adjusted. The increment option-argument is a positive or negative decimal integer that will be used to modify the system scheduling priority of the specified process or processes. Positive increment values cause a lower system scheduling priority. Negative increment values may require appropriate privileges and will cause a higher system scheduling priority.

-p Interpret all operands (or just the pid arguments in the obsolescent version) as unsigned decimal integer process IDs.

ps –eaf |grep vmware

renice –p <pid of vmware-serverd>

renice –p <pid of httpd.vmware>

To reset the PID of these processes back to their defaults, use renice again to set the priority to zero.

renice -n 19 12345 # 12345 represents the PID of your process
You will increase the nice value all the way to 39. In fact, the 19 could be any larger number as well - nice values max out at 39 either way. And in case you are thinking your program will grind to a halt at a nice value of 39, you needn't worry. In fact, changing the nice value all the way from 20 to 39 has a surprisingly small effect on the activity of the process, but it's the best we can do.
 
rpmRed Hat Package Manager (automating software binaries and remembers what files are needed so the software will run properly
RPM tracks dependencies and will inform you if additional packages are needed.
There is a database of packages and what files they use. If you do an uninstall it will be checked if other packages will also use this files.
If you try to uninstall a package that other packages are still dependent upon, RPM informs you  about it and refuses to do the uninstall.
Single files can not be retrieved, you can only install the whole package or nothing.

Install without output:

rpm -i packagename    or      rpm --install packagename

Install with verbose output:

rpm -ivh packagename

Update a package:

rpm -U packagename   or     rpm --update packagename

Get a list of all installed packages:

rpm -qa

Get the version of an installed package:

rpm -q package

Find out to whiche package a file belonges:

rpm -qf  Filename

Display information about a package:

rpm -qi packagename

Show the files that will be installed:

rpm -qpl packagename

To initialize the RPM Database:

Careful do only initialize the database if it wasn't initialized before!!

rpm --initdb

Of course the database doesn't know anything about prior installed packages and in this cases you can install some packages without checking the dependency (for already installed packages.
 

service RedHat-made tool for daemon (service) starting/stopping/restarting/status querying. Syntax is "service daemon name [start|stop|restart|status]". Alternate to this command, which works with all Linuces is to call the script directly, like /etc/init.d/httpd.vmware restart, /etc/init.d/xinetd restart, or /etc/init.d/sshd restart.

service --status-all

This lists all the service daemons and their status. We can find running services by looking for the running status

service –-status-all |grep running

would produce an output similar to the following:

crond (pid 1423) is running
httpd (pid 1486 1482 1479) is running

syslogd (pid 1136) is running
sshd (pid 1208) is running

To avoid unnecessarily rebooting an ESX server after making certain configuration changes, we can frequently just restart the appropriate daemon. For example we could restart the Apache web server for the MUI with the command:

service httpd.vmware restart

and we can also check a named service running status with

service httpd.vmware status

Great way to do orderly restart of vmnix network configuration.

service network restart


 

setupAllows changing of NIC, region, firewall, mouse, keyboard
shutdown Generic command for shutting down or rebooting the system.  -h Halt after shutdown -r Reboot after shutdown
sshSecure shell  Login to remote Linux (ESX) machine.

To work with ssh I recommend to setup SSH Key authentication between linux (ESX) servers instructions Never need to enter password again!

suSwitch user. By default, this allows you to log in as the root user if you know the root user's password. You can also use the command to log in as any other user if you know the appropriate user name and password. Enter the command, then enter the password when prompted.

su User2
Log in as User2.
swaponEnables swap file for service console
swapoffDisables swap file for service console
topShows the running processes in the service console and lists the top consumers of CPU time.
uname -a

Outputs details of the server as shown

Example:
Linux esx002 2.4.9-vmnix2 #1 Thu Mar 17 16:09:37 PST 2005 i686 unknown

useradd Adds a new user to the Service Console with status disabled. To create an account for the new admins, enter the following commands:

useradd -c "VMware ESX Server operator" helpdesk

Create a single userid, which will be able to operate all of the VMs.

useradd -g 7777 johndoe

Create a userid, and make groupid 7777 (vmadmins) as its primary group.

useradd -g 7777 -c "Kari Mattsson" mattkar2

Create a userid, and make groupid 7777 (vmadmins) as its primary group.

 

usermod Changes settings for a user. Usually used for user group manipulation.

usermod -G wheel mattkar2

 

vmstat

Performance information. Linux command

vmstat 3 10             Runs the tool every 3 seconds for 10 times and then exit.

watchPolls on the command the running status

 

watch cat /proc/vmware/mem     Display dynamically the memory usage

 

watch –d cat /proc/vmware/mem  The -d option highlights changes

 

--interval=n  will change the refresh rate

 

 
 

Design: Digital Eye Template