FAQ
Hi,

I have long list of various tasks that takes around half an hour to execute
using salt. So far going good.
However during that half an hour execution I cannot really see what is
happening . I am checking this using

salt-run jobs.lookup_jid <jid>

Above does not show anything about the progress it just shows summary. So I
decided to send events after every state execution. But jobs.lookup_jid
still shows nothing but summary during the execution.

An example of such a state sending event is below:
a_test_file:
   file.managed:
     - name: /tmp/atestfile
     - source: salt://random_tests/file.txt
   event.send:
     - data:
       status: "File has been created. 100% done"


I had re-written around 20 states using above event.send , but still jobs
lookup does not tell anything.

Am I using event in right way ? What am I missing here.



--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Robert Fach at Feb 5, 2015 at 5:57 pm
    Hi,

    sending an event like that will send it to the salt event system... You can
    react to your events by implementing a corresponding reactor.

    http://docs.saltstack.com/en/latest/topics/reactor/

    In your case, the event would be published under the tag "a_test_file". You
    could write a reactor to deal with your events, or you could write your own
    application that just listens on the event bus...

    There are several examples that use reactors to do custom stuff...

    You might also have a look at the following formulas which use reactors

    - https://github.com/saltstack-formulas/vagrant-dev-vm-reactor
    - https://github.com/saltstack-formulas/ec2-autoscale-reactor
    - https://github.com/saltstack-formulas/salt-cloud-reactor

    Am Montag, 2. Februar 2015 21:57:24 UTC+1 schrieb spare...@gmail.com:
    Hi,

    I have long list of various tasks that takes around half an hour to
    execute using salt. So far going good.
    However during that half an hour execution I cannot really see what is
    happening . I am checking this using

    salt-run jobs.lookup_jid <jid>

    Above does not show anything about the progress it just shows summary. So
    I decided to send events after every state execution. But jobs.lookup_jid
    still shows nothing but summary during the execution.

    An example of such a state sending event is below:
    a_test_file:
    file.managed:
    - name: /tmp/atestfile
    - source: salt://random_tests/file.txt
    event.send:
    - data:
    status: "File has been created. 100% done"


    I had re-written around 20 states using above event.send , but still jobs
    lookup does not tell anything.

    Am I using event in right way ? What am I missing here.


    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • AMARASINGHAM, Chandra at Feb 6, 2015 at 12:02 am
    Hi,



    Is it possible to access the return data of the corresponding state you are interested in so you can send it along with the event?



    Regards,

    Chandra



    Chandra Amarasingham
    Analyst Programmer
    Specialist Diagnostic Services Pty Ltd
    17 Enterprise Grove, Mt Helen, 3350
    Federation University Technology Park

    T: (03) 5330 1056 ext 212

    This email (including any attachments) is intended only for the addressee. It may contain confidential or legally privileged information. Confidentiality and privilege are not waived or lost if you are not the intended recipient of this email, nor may you use, review, disclose, disseminate or copy any information contained in or attached to it. If you receive this email in error, please delete it and any attachments from your system and notify us immediately. It is your responsibility to check this email and any attachments, before opening or using them, for viruses or defects. You assume all liability arising from opening or using this email and any attachment.
    ________________________________
    From: salt-users@googlegroups.com [salt-users@googlegroups.com] on behalf of Robert Fach [robert.fach@gmx.net]
    Sent: Friday, 6 February 2015 4:57 AM
    To: salt-users@googlegroups.com
    Subject: [salt-users] Re: correct use of events ?

    Hi,

    sending an event like that will send it to the salt event system... You can react to your events by implementing a corresponding reactor.

    http://docs.saltstack.com/en/latest/topics/reactor/

    In your case, the event would be published under the tag "a_test_file". You could write a reactor to deal with your events, or you could write your own application that just listens on the event bus...

    There are several examples that use reactors to do custom stuff...

    You might also have a look at the following formulas which use reactors

    - https://github.com/saltstack-formulas/vagrant-dev-vm-reactor
    - https://github.com/saltstack-formulas/ec2-autoscale-reactor
    - https://github.com/saltstack-formulas/salt-cloud-reactor

    Am Montag, 2. Februar 2015 21:57:24 UTC+1 schrieb spare...@gmail.com:
    Hi,

    I have long list of various tasks that takes around half an hour to execute using salt. So far going good.
    However during that half an hour execution I cannot really see what is happening . I am checking this using

    salt-run jobs.lookup_jid <jid>

    Above does not show anything about the progress it just shows summary. So I decided to send events after every state execution. But jobs.lookup_jid still shows nothing but summary during the execution.

    An example of such a state sending event is below:
    a_test_file:
       file.managed:
         - name: /tmp/atestfile
         - source: salt://random_tests/file.txt
       event.send:
         - data:
           status: "File has been created. 100% done"


    I had re-written around 20 states using above event.send , but still jobs lookup does not tell anything.

    Am I using event in right way ? What am I missing here.




    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com .
    For more options, visit https://groups.google.com/d/optout.

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Seth House at Feb 10, 2015 at 6:46 am

    On Thu, Feb 5, 2015 at 5:01 PM, AMARASINGHAM, Chandra wrote:
    Is it possible to access the return data of the corresponding state you are
    interested in so you can send it along with the event?
    This is technically possible now but requires writing a little Python.
    We put code in place to allow for this exact kind of thing a little
    while back. That said, we haven't written an interface to actually
    pull the relevant info into the event. I filed the following issue
    just now to get this added and so it doesn't fall off our radar again.

    https://github.com/saltstack/salt/issues/20544

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Spare Slant at Feb 10, 2015 at 11:33 am
    Thank you very much :)


    On Tuesday, 10 February 2015 06:46:51 UTC, Seth House wrote:

    On Thu, Feb 5, 2015 at 5:01 PM, AMARASINGHAM, Chandra
    <Chandra.Am...@sdspathology.com.au <javascript:>> wrote:
    Is it possible to access the return data of the corresponding state you are
    interested in so you can send it along with the event?
    This is technically possible now but requires writing a little Python.
    We put code in place to allow for this exact kind of thing a little
    while back. That said, we haven't written an interface to actually
    pull the relevant info into the event. I filed the following issue
    just now to get this added and so it doesn't fall off our radar again.

    https://github.com/saltstack/salt/issues/20544
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedFeb 2, '15 at 8:57p
activeFeb 10, '15 at 11:33a
posts5
users4

People

Translate

site design / logo © 2022 Grokbase