monitoring-plugins/plugins/t/check_disk.t
Ton Voon 595b2571a4 Invalid mount point doesn't make sense because most df implementations
would work out the actual mount point. And fixed typo in check_procs.t


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1271 f882894a-f735-0410-b71e-b25c423dba1c
2005-11-03 15:13:13 +00:00

29 lines
822 B
Perl

#! /usr/bin/perl -w -I ..
#
# Disk Space Tests via check_disk
#
# $Id$
#
use strict;
use Test;
use NPTest;
use vars qw($tests);
BEGIN {$tests = 8; plan tests => $tests}
my $successOutput = '/^DISK OK - /';
my $failureOutput = '/^DISK CRITICAL - /';
my $mountpoint_valid = getTestParameter( "mountpoint_valid", "NP_MOUNTPOINT_VALID", "/",
"The path to a valid mountpoint" );
my $t;
$t += checkCmd( "./check_disk 100 100 ${mountpoint_valid}", 0, $successOutput );
$t += checkCmd( "./check_disk -w 0 -c 0 ${mountpoint_valid}", 0, $successOutput );
$t += checkCmd( "./check_disk -w 1\% -c 1\% ${mountpoint_valid}", 0, $successOutput );
$t += checkCmd( "./check_disk 0 0 ${mountpoint_valid}", 2, $failureOutput );
exit(0) if defined($Test::Harness::VERSION);
exit($tests - $t);