tbsend-short.pl.in 808 Bytes
Newer Older
1
#!/usr/bin/perl
Mike Hibler's avatar
Mike Hibler committed
2 3 4 5 6 7
#
# EMULAB-COPYRIGHT
# Copyright (c) 2002-2004 University of Utah and the Flux Group.
# All rights reserved.
#

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#
# This is a sample event generator to send TBEXAMPLE events to all nodes
# in an experiment. Like tbsend.pl, but uses the shorter EventSendFatal
# function, to show off how easy it is. This function, though, should only
# be used in scripts the only occasionally send events.
#

#
# Configure variables
#
use lib '@prefix@/lib';

use event;
use Getopt::Std;
use strict;

sub usage {
    warn "Usage: $0 <event>\n";
    return 1;
}

my %opt = ();
getopt(\%opt,"h");
if ($opt{h}) { exit &usage; }
if (@ARGV != 1) { exit &usage; }

print "Sent at time " . time() . "\n";

EventSendFatal(objtype   => "TBEXAMPLE",
	       eventtype => $ARGV[0],
	       host     => "*" );

exit(0);