Documentation forServer & Application Monitor
Monitoring your applications and environment is a key capability of Hybrid Cloud Observability and is also available in a standalone module, Server & Application Monitor (SAM). Hybrid Cloud Observability and SAM are built on the self-hosted SolarWinds Platform.

Linux CPU Monitoring Perl

This SAM application monitor template assesses the CPU performance of Linux servers through the use of Perl scripts.

This template supports the SolarWinds Platform Agent for Linux.

Prerequisites:

SSH and Perl are installed on the target server.

If Perl is installed in a location different from /usr/bin/perl, edit paths in the first line of the field ”script body” (#!/usr/bin/perl) for component monitors, or create a symbolic link to Perl with ln command.

To determine where Perl is installed, use the following command: which perl

Credentials:

Root credentials on the target server.

The Red Hat Enterprise Linux (RHEL) 3 OS may cause issues with certain counters in this template:

Component monitors

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. To learn more, see Manage thresholds in SAM.

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.