#! /usr/bin/perl
#
# check_stuff  -  Check stuff
#
# Copyleft 2006-2007 Thomas Guyot-Sionnest <tguyot@gmail.com>
#
# This program is public domain software
#

use strict;
use warnings;
use vars qw($PROGNAME $VERSION);
use Nagios::Plugin;

$PROGNAME = 'check_stuff';
$VERSION = '1.00';

my $np = Nagios::Plugin->new(
  usage => 'Usage: %s -D <arg1>[,<arg2>...]',
  version => $VERSION,
  plugin  => $PROGNAME,
  shortname => uc($PROGNAME),
  blurb => 'Check stuff',
  timeout => 20,
);

$np->add_arg(
  spec => 'data|D=s@',
  help => "-D, --data=<arg_list>\n"
    . '   Comma-separated list of arguments (can be specified multiple times).',
  required => 1,
);

$np->getopts;

my (@data) = ();
for (@{$np->opts->data}) {
  push @data, split(/,/);
}

my $status = 'Arguments: ';
for (@data) {
  $status .= "$_,";
}
chop $status;

$np->nagios_exit('OK', $status)

