References > Template Reference > Linux > Linux CPU Monitoring Perl

Linux CPU Monitoring Perl

This template assesses the CPU performance of a Linux computer. It uses Perl scripts for monitoring performance.

Works with the Orion Agent for Linux.

Prerequisites:

SSH and Perl installed on the target server.

If Perl is installed in a location different from /usr/bin/perl, you should correct all components in the first line of the field ”script body” (#!/usr/bin/perl), or you can create a symbolic link to Perl (refer to the documentation for the ln command).

You can find where Perl is installed by using the following command: which perl

Operating Systems:

The following operating system versions may cause issues with certain counters in this template:

  • Red Hat Enterprise Linux 3

Credentials:

Root credentials on the target server.

Monitored Components

For details on monitors, see SAM Component Monitor Types.

Components without predetermined threshold values have guidance such as "Use the lowest threshold possible" or "use the highest threshold possible" to help you find a threshold appropriate for your application.

CPU User Time

Time, in percentages, spent running non-kernel code (user time, including nice time). This represents the time spent executing user code. It depends on the programs that the user uses.

Use the lowest threshold possible.

CPU System Time

Time, in percentages, spent running system kernel code (system time).

Use the lowest threshold possible.

Wait IO

Time, in percentages, spent waiting for input/output (IO) operations.

Use the lowest threshold possible.

If CPU waits IO is high, there may be problems with hard disk or problems with accessing NFS shares (if you use NFS).

CPU Idle Time

Time, in percentages, spent idle (this includes IO-wait time).

Use the highest threshold possible at all times.

Run queue

The number of processes waiting for run time.

This should be as low as possible, but not more than 4 per processor. If the run queue is constantly growing, it may indicate the need for a more powerful CPU or more CPUs.

Set the thresholds appropriately for your environment.

Interrupts per second

The number of interrupts per second, including the clock.

This depends on the processor. For current CPUs, use a threshold of 1500 interrupts per second. A dramatic increase in this counter value without a corresponding increase in system activity indicates a hardware problem. Identify the network adapter or disk controller card causing the interrupts. You may need to install an additional adapter or controller card.

Set the thresholds appropriately for your environment.

Context switches per second

The number of context switches per second.

High activity rates can result from inefficient hardware or poorly designed applications. The normal amount of Context Switches/Sec depends on your servers and applications. To set the threshold, you really need to baseline the server. The threshold for Context Switches/sec is cumulative for all processors, so you need a minimum of 14000 per processor (single=14000, dual=28000, quad=56000 and so forth).

Set the thresholds appropriately for your environment.

Total amount of interrupts after boot

The total number of interrupts after boot.

Total amount of CPU context switches after boot

The total number of CPU context switches after boot.