#!/usr/bin/perl

# Author: Victor Severgnini
# Date: 30/06/2008

use strict;
use POSIX;
use Getopt::Long;

# globlal variables
our $name = "check_smb_plusoft";
our $version = "1.0";

our ($opt_version, $opt_help, $opt_hostgroup);

sub main(){

	# Get options
	getOptions();

	print "<a href='/opmon/planilhas/getlist/getlist.php?hostgroup=$opt_hostgroup'>Planilha de revisao da documentacao $opt_hostgroup</a>";
	exit (0);

}

#--------------------------------------------------------------------------

sub getOptions {  #command line options

        Getopt::Long::Configure('bundling');
        GetOptions(
                'v|version'             => \$opt_version,
                'h|help'                => \$opt_help,
                'g|group=s'          	=> \$opt_hostgroup,
        )or do {
                printUsage();
                exit();
        };

        if ($opt_version) {
                printVersion();
                exit();
        }

        if ($opt_help){
                printUsage();
                exit();
        }

        if (!$opt_hostgroup){
                printUsage();
                exit();
        }

}

#--------------------------------------------------------------------------

sub printUsage {

       print <<EOB

Usage: $name.pl [OPTION]...
Creates file .csv revision of the documents specified hostgroup.

        -g, --hostgroup HostGroup 
        -h, --help      Display this help and exit
        -v, --version   Output version information and exit
EOB

}


&main;
