• Antelope Release 5.5 Mac OS X 10.8.5 2015-04-21

 

NAME

orbptrigger - ORB packet trigger

SYNOPSIS

orbptrigger [-select packet] [-start {pktid|time}] [-number number]
	       [-state file] [-background] ORB command ...

SUPPORT


Contributed code: NO BRTT support.
THIS PIECE OF SOFTWARE WAS CONTRIBUTED BY THE ANTELOPE USER COMMUNITY. BRTT DISCLAIMS ALL OWNERSHIP, LIABILITY, AND SUPPORT FOR THIS PIECE OF SOFTWARE.

FOR HELP WITH THIS PIECE OF SOFTWARE, PLEASE CONTACT THE CONTRIBUTING AUTHOR.

DESCRIPTION

orbptrigger listens to an ORB and exectutes a specified system call (command string) when specified packets are read. Simple substitution can be performed for variables in the system call using parameters/fields from parameter file or database table packets.

OPTIONS

SUBSTITUTION

The command string is scanned for pairs of '%' or '@' characters. Anything inside pairs of these delimiters is substituted with matching values of parameters/fields from parameter file or database table packets. This only works with these two types of packets, indicated by source names starting with "/pf/" or "/db/". The delimiters must fit the parameter/field name tightly, i.e. spaces inside the delimiters are treated as part of the parameter/field name. See LIMITATIONS below.

EXAMPLES

>orbptrigger ORB /archive/addbulletin %evid% -lat %lat% -lon %lon% This will execute the program /archive/addbulletin with %evid%, %lat%, and %lon% replaced with the values of their respective fields in the database packet /db/origin (the default packet) that triggered execution. The final command string might look like: "/archive/addbulletin 71 -lat 14.6784 -lon 70.8901" >orbptrigger -select /pf/orbpftrigger -number 2 ORB sendalert %start% This will execute 'sendalert' with the substituted value of 'start' taken from a /pf/orbpftrigger packet for the next two /pf/orbpftrigger packets read. >orbptrigger -select IU_KONO_BHZ ORB /bin/date >> /log/KONO.recvd.packets Sure, that's possible as well if you really want to do so. >orbptrigger -select "/pf/orbmag" ORB report_mag @origin.evid@ This will execute 'report_mag' with 'evid' taken from the database row/record for an 'origin' table inside the parameter file packet.

LIMITATIONS

- Parameters in parameter file packets must be of type string, int, or double. Array (&Arr) and table (&Tbl) values cannot be used for substitution. A special exception is when using '@' delimiters for substitution; usually database rows/records are then of type &Literal. - Required values for the command line arguments that are expecting an associated number, time, pktid, etc. are not robustly checked. - Problems abound if the specified command string contains flags that are recognized by orbptrigger. e.g. 'orbptrigger ORB calc -number %lat%', will *not* work.

NOTES

Any pre-pended spaces in the value of a database field are removed, just to make the command line a little cleaner. This program is very similar to orbpftrigger, with major differences being: - The ability to trigger on any arbitrary packet. - The ability to substitute values from a database table packets/rows. - Only simple substitution of variables, no expression evaluation is performed.

AUTHOR

Chad Trabant
ORFEUS Data Center/EC-Project MEREDIAN

Antelope User Group Contributed Software
Printer icon