added some more files
authorHeiko Schlittermann <hs@schlittermann.de>
Thu, 19 Jan 2012 22:30:35 +0100
changeset 1 56ae2cc9eea9
parent 0 1913267b812b
child 2 bc2f76c0908a
added some more files
.hgignore
bin/checkfs
lib/Nagios.pm
--- /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
--- /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 <filesystem>
+
+=head1 DESCRIPTION
+
+B<checkfs> checks the filesystem.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h>|B<--help>
+
+=item B<-m>|B<--man>
+
+The usual help messages;
+
+
+=back
+
+
--- /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