Archive for the tag 'Commands'

SB-Shibu

Useful SMART Commands

Useful SMART Commands

Cpanel script is not very helpful, but you can certainly use these commands for predict and analyze real drive issues:

smartctl -a /dev/hda smartctl -a -d ata /dev/sda <—- for SATA Drives

smartctl -t short /dev/sdb This runs a short test on the drive, you then view the results with the above commands.

Note: you can even just schedule these to run as a cron job and pipe the output to | mail you@youremail.com to automate this.

There are also various scripts you can customize for smartd and smartctl, these scripts are usually in:
There are example scripts included with smartmontools. These are usually located in a location like:

/usr/share/doc/smartmontools-5.33/examplescripts
SB-Shibu

Using LVM CLI Commands

There are several general features of all LVM CLI commands.

When sizes are required in a command line argument, units can always be specified explicitly. If you do not specify a unit, then a default is assumed, usually KB or MB. LVM CLI commands do not accept fractions.

Where commands take volume group or logical volume names as arguments, the full path name is optional. A logical volume called lvol0 in a volume group called vg0 can be specified as vg0/lvol0. Where a list of volume groups is required but is left empty, a list of all volume groups will be substituted. Where a list of logical volumes is required but a volume group is given, a list of all the logical volumes in that volume group will be substituted. For example, the lvdisplay vg0 command will display all the logical volumes in volume group vg0.

All LVM commands accept a -v argument, which can be entered multiple times to increase the output verbosity. For example, the following examples shows the default output of the lvcreate command.

# lvcreate -L 50MB new_vg
Rounding up size to full physical extent 52.00 MB
Logical volume “lvol0″ created

The following command shows the output of the lvcreate command with the -v argument.

# lvcreate -v -L 50MB new_vg
Finding volume group “new_vg”
Rounding up size to full physical extent 52.00 MB
Archiving volume group “new_vg” metadata (seqno 4).
Creating logical volume lvol0
Creating volume group backup “/etc/lvm/backup/new_vg” (seqno 5).
Found volume group “new_vg”
Creating new_vg-lvol0
Loading new_vg-lvol0 table
Resuming new_vg-lvol0 (253:2)
Clearing start of logical volume “lvol0″
Creating volume group backup “/etc/lvm/backup/new_vg” (seqno 5).
Logical volume “lvol0″ created

All LVM objects are referenced internally by a UUID, which is assigned when you create the object.

SB-Shibu

Useful Exim Commands

Useful Exim Commands

Exim is a mail transfer agent used on Unix-like operating systems. Exim is highly configurable, and therefore has features that are lacking in other MTAs. Exim has always had substantial facilities for mail policy controls, providing facilities for the administrator to control who may send or relay mail through the system.

To print a count of the mails in the queue -> exim -bpc

Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient) -> exim -bp

To show the current configuration file of exim -> exim -bP

To show the version and configuration file of exim -> exim -bV

Generate and display Exim stats from a logfile -> eximstats /var/log/exim_mainlog

Print what Exim is doing right now -> exiwhat

To Print the message-id of the messages in queue -> exiqgrep -i

To remove a mail from the queue -> exim -Mrm

To freeze a mail -> exim -Mf

To deliver a specific mail from the queue -> exim -M

To remove all frozen mails -> exiqgrep -z -i | xargs exim -Mrm

To view the headers of a mail -> exim -Mvh

To view body of a mail -> exim -Mvb