saurabhaditya
saurabhaditya

Reputation: 86

How to increase the Total Swap used percent of a host programmatically or via a script

The host is RHEL5 and the alarm I want to trigger by running some process or a script is TotalSwapUsedPercent .. is there a quick and easy way?

Upvotes: 1

Views: 274

Answers (1)

Peter Oram
Peter Oram

Reputation: 6738

This will give you the TotalSwapUsedPercent:

free -t | grep Swap | awk '{print ($3 / $2) * 100 "%"}'

You could put that into any monitoring system or cron or whatever you want.

Upvotes: 1

Related Questions