# HG changeset patch # User Heiko Schlittermann # Date 1327008635 -3600 # Node ID 56ae2cc9eea9c28855be2f6324be204cf47955f9 # Parent 1913267b812bcbc247a7007effd62c741142495d added some more files diff -r 1913267b812b -r 56ae2cc9eea9 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Thu Jan 19 22:30:35 2012 +0100 @@ -0,0 +1,3 @@ +_build +blib +Build diff -r 1913267b812b -r 56ae2cc9eea9 bin/checkfs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/checkfs Thu Jan 19 22:30:35 2012 +0100 @@ -0,0 +1,48 @@ +#! /usr/bin/perl +use strict; +use warnings; +use Pod::Usage; +use Getopt::Long; +use Nagios; + +my $fs; + +GetOptions( + "h|help" => sub { pod2usage(-exit => 0, -verbose => 1) }, + "m|man" => sub { pod2usage(-exit => 0, -verbose => 2, + -noperldoc => system("perldoc -V 2>/dev/null 1>&2")) }, +) and $fs = shift // pod2usage; + +return Nagios::CRITICAL; + + +__END__ + +=head1 NAME + + checkfs - check the current file system + +=head1 SYNOPSIS + + checkfs [-h|--help] + checkfs [-m|--man] + checkfs + +=head1 DESCRIPTION + +B checks the filesystem. + +=head1 OPTIONS + +=over 4 + +=item B<-h>|B<--help> + +=item B<-m>|B<--man> + +The usual help messages; + + +=back + + diff -r 1913267b812b -r 56ae2cc9eea9 lib/Nagios.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/Nagios.pm Thu Jan 19 22:30:35 2012 +0100 @@ -0,0 +1,46 @@ +package Nagios; + +use strict; +use warnings; + +sub UNKNOWN { 3 } +sub CRITICAL { 2 } +sub WARNING { 1 } +sub OK { 0 } + +1; + +__END__ + +=head1 NAME + + Nagios - nagios support perl module + +=head1 SYNOPSIS + + use Nagios; + + return NAGIOS::UNKNOWN; + return NAGIOS::CRITICAL; + return NAGIOS::WARNING; + return NAGIOS::OK; + +=head1 CONSTANTS + +=head2 UNKNOWN() + +Returns the "unknown" status (3). + +=head2 CRITICAL() + +Returns the "critical" status (2). + +=head2 WARNING() + +Returns the "warning" status (1). + +=head2 OK() + +Returns the "OK" status (0). + +=cut