Archive for the tag 'Information'

sar - Collect, report, or save system activity information.

To have sar read a particular data file, use the -f /var/log/sa/saDD option. You can select multiple files by using multiple -f options. Since many of sar’s reports are lengthy, you may want to pipe the output to a file.

To create a basic report showing CPU usage and I/O wait time percentage, use sar with no flags. It produces a report similar to this:

01:10:00 PM CPU %user %nice %system %iowait %idle
01:20:00 PM all 7.78 0.00 3.34 20.94 67.94
01:30:00 PM all 0.75 0.00 0.46 1.71 97.08
01:40:00 PM all 0.65 0.00 0.48 1.63 97.23
01:50:00 PM all 0.96 0.00 0.74 2.10 96.19
02:00:00 PM all 0.58 0.00 0.54 1.87 97.01
02:10:00 PM all 0.80 0.00 0.60 1.27 97.33
02:20:01 PM all 0.52 0.00 0.37 1.17 97.94
02:30:00 PM all 0.49 0.00 0.27 1.18 98.06
Average: all 1.85 0.00 0.44 2.56 95.14

“The %user and %system columns simply specify the amount of time the CPU spends in user and system mode. The %iowait and %idle columns are of interest to us when doing performance analysis. The %iowait column specifies the amount of time the CPU spends waiting for I/O requests to complete. The %idle column tells us how much useful work the CPU is doing. A %idle time near zero indicates a CPU bottleneck, while a high %iowait value indicates unsatisfactory disk performance.”

Php Security Preventing Information Disclosure

Disclosing information, such as errors, to attackers can leave your system in a vulnerable position. Before and during an attack, the attacker will need to acquire a wealth of general information about your system. This information includes your directory structure, database names, usernames, and more. Preventing PHP from printing errors to the web application’s user interface is one way to inhibit an attacker’s ability to gain information he could use to compromise your system.

When display_errors is disabled, your developers are still able to retrieve debugging information from the appropriate PHP logs.

Hard Drives going bad, how to get SATA/ATA device information.

# hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 582 MB in 2.00 seconds = 290.60 MB/sec
Timing buffered disk reads: 96 MB in 3.05 seconds = 31.49 MB/sec

Harddrives come in three kinds: Sata, Ide, and Scsi. Many type of hardware error will how up under linux if you use the command “dmesg”. In fact, almost any type of hardware error or information will show up there.

If you think your drive may be sub par, or you want to test it, then hdparm is a good command.

[~]# hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 270 MB in 2.01 seconds = 134.60 MB/sec
Timing buffered disk reads: 80 MB in 3.07 seconds = 26.10 MB/sec

If the second measurement is under 40MB/sec then you shoud change the drive for your server.

Below is the measurement for a new server.

[~]# hdparm -tT /dev/sda

/dev/sda:
Timing cached reads: 12252 MB in 2.00 seconds = 6135.69 MB/sec
Timing buffered disk reads: 212 MB in 3.01 seconds = 70.51 MB/sec

Note: SMART allows you to have a good degree of prediction on when the drive will reach its end of life.

cPanel FTP and MySQL General Information and Error Log files

FTP: Logins and General Errors.

/var/log/messages

General information and login attempts are logged here

FTP Transactions

/var/log/xferlog

This is a symbolic link in most cases to /usr/local/apache/domlogs/ftpxferlog, which contains a history ofthe transactions made by FTP users.

MySQL: General Information and Errors

/var/lib/mysql/$(hostname).err

This path could vary, but is generally located in /var/lib/mysql. Could also be located at /var/log/mysqld.log

Using smartctl to get information about your Hard Disk

smartctl controls the Self-Monitoring, Analysis and Reporting Technology (SMART) system built into any ATA-3 and later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests. This version of smartctl is compatible with ATA/ATAPI-7 and earlier standards

# smartctl -i /dev/sda

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family: HITACHI Travelstar DK23XX/DK23XXB series
Device Model: HITACHI_DK23EB-40
Serial Number: 446278
Firmware Version: 00K0A0C0
User Capacity: 40,007,761,920 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 5
ATA Standard is: ATA/ATAPI-5 T13 1321D revision 3
Local Time is: Tue Mar 30 21:06:49 2010 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

EXAMPLES

smartctl -a /dev/hda

Print all SMART information for drive /dev/hda (Primary Master).

smartctl -s off /dev/hdd

Disable SMART on drive /dev/hdd (Secondary Slave).

Next »