Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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 and; is called by; Now when is running and if it encounters a condition, i want to trigger an alarm to; Now when the trigger is called executes a function. In the meantime keeps on running and keeps on sending triggers wherever required without stopping. And runs the particular functions for the triggers. How to do this? Another info. is in the host machine and is in a VM. I want to know exactly how can we give the trigger(alarm)from and catch it with the main script

Replies are listed 'Best First'.
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 NetWallah (Canon) 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 ''.

    When you need to send the trap, have your '' 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."

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://910580]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-06-22 21:16 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.