From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/134273-check_cpu_perfdata.diff | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 web/attachments/134273-check_cpu_perfdata.diff (limited to 'web/attachments/134273-check_cpu_perfdata.diff') diff --git a/web/attachments/134273-check_cpu_perfdata.diff b/web/attachments/134273-check_cpu_perfdata.diff new file mode 100644 index 0000000..c841234 --- /dev/null +++ b/web/attachments/134273-check_cpu_perfdata.diff @@ -0,0 +1,31 @@ +--- check_cpu 2005-05-12 15:26:00.273073312 -0700 ++++ check_cpu.orig 2005-05-12 15:26:56.617507656 -0700 +@@ -146,25 +146,17 @@ + ### state, and exit the plugin. + + +-# if critical or warning is not set on the command line, then set it to zero +-# this keeps the performance data from having negative values for warn and crit +-if critical == -2: +- critical = 0 +-if warning == -1: +- warning = 0 +- +- + if idleValue <= critical: + status = "CPU CRITICAL" +- print status + ": CPU is only " + idleCPU + "% idle | CPU_idle=" + idleCPU +"%;" + `warning` + ";" + `critical` + ";" ++ print status + ": CPU is only " + idleCPU + "% idle" + sys.exit(2) + elif idleValue <= warning: + status = "WARNING" +- print status + ": CPU is only " + idleCPU + "% idle | CPU_idle=" + idleCPU +"%;" + `warning` + ";" + `critical` + ";" ++ print status + ": CPU is only " + idleCPU + "% idle" + sys.exit(1) + elif warning < idleValue: + status = "OK" +- print status + ": CPU is " + idleCPU + "% idle | CPU_idle=" + idleCPU +"%;" + `warning` + ";" + `critical` + ";" ++ print status + ": CPU is " + idleCPU + "% idle" + sys.exit(0) + else: + status = "CPU STATUS UNKNOWN" -- cgit v1.2.3-74-g34f1