mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-13 21:06:37 -04:00
For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
24 lines
520 B
Perl
24 lines
520 B
Perl
#! /usr/bin/perl -w -I ..
|
|
#
|
|
# Logged in Users Tests via check_users
|
|
#
|
|
#
|
|
|
|
use strict;
|
|
use Test;
|
|
use NPTest;
|
|
|
|
use vars qw($tests);
|
|
BEGIN {$tests = 4; plan tests => $tests}
|
|
|
|
my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
|
|
my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
|
|
|
|
my $t;
|
|
|
|
$t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
|
|
$t += checkCmd( "./check_users 0 0", 2, $failureOutput );
|
|
|
|
exit(0) if defined($Test::Harness::VERSION);
|
|
exit($tests - $t);
|
|
|