Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Calling and catching a trigger

by shayak (Novice)
on Jun 20, 2011 at 14:55 UTC ( #910580=perlquestion: print w/ replies, xml ) Need Help??
shayak has asked for the wisdom of the Perl Monks concerning the following question:

Their are two scripts a1.pl and a2.pl; A2.pl is called by a1.pl; Now when a2.pl is running and if it encounters a condition, i want to trigger an alarm to a1.pl; Now when the trigger is called a1.pl executes a function. In the meantime a2.pl keeps on running and keeps on sending triggers wherever required without stopping. And a1.pl runs the particular functions for the triggers. How to do this? Another info. A1.pl is in the host machine and a2.pl is in a VM. I want to know exactly how can we give the trigger(alarm)from a2.pl and catch it with the main script a1.pl?

Comment on Calling and catching a trigger
Re: Calling and catching a trigger
by Anonymous Monk on Jun 20, 2011 at 14:59 UTC
    Remember all those GUI automation questions you had? All they're doing is sending messages (its like signals) to programs.

    You can do this too.

      I want to know how can i do it when the script is continuosly running?
        Whether or not the script is continuously running, makes no difference.
Re: Calling and catching a trigger
by aquarium (Curate) on Jun 21, 2011 at 04:43 UTC
    that sort of architecture is typically but not always quite messy. instead design a third program, which has a proper interface to be a controller of sorts. that way you can get some sanity
    the hardest line to type correctly is: stty erase ^H
Re: Calling and catching a trigger
by NetWallah (Abbot) on Jun 21, 2011 at 05:25 UTC
    What you are attempting sounds a lot like an SNMP Trap send and receive system.

    Configure snmpd to receive the trap, and call your 'a.pl'.

    When you need to send the trap, have your 'b.pl' call snmptrap to send it.

    Much complexity, features and cruft can be added, once the basic system starts working.

                "XML is like violence: if it doesn't solve your problem, use more."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://910580]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-08-31 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls