#! perl -w

=head1 NAME

check_roles.pl - checks the output of C<dumpfsmos %COMPUTERNAME%> for 5 roles.

=head1 VERSION

Version 1.0

=head1 SYNOPSIS

./check_roles.pl

=head1 DESCRIPTION

This looks through the output of "dumpfsmos %COMPUTERNAME%" for a number of 5
known roles.

=head1 AUTHOR

Copyright (c) Hannes Schulz 2003

=cut

use strict;

my $cmdline = "dumpfsmos %COMPUTERNAME%";
my $output = `$cmdline`;

my $ok = ($output =~ /knows about 5 roles/is);

print($ok?"OK":"Critical");

exit 2 unless $ok;     # Nagios: Critical
exit 0 ;               # Nagios: OK

sub printHelp{
print <<EOT
$0 Version 1.0
Copyright (c) Hannes Schulz 2003

Usage: $0 [--help]

see code for documentation.

EOT
;exit 3 # Nagios: unknown
}
