1

I've got a master and minion connected, and I'm trying to set up some monitoring via the reactor system on the master. I haven't gotten far at all though, because so far as I can tell, events aren't occurring on the master. A simple execution of:

salt-call event.send "foo/bar" '{key:value}' -l debug

from the minion seems to try to send the event:

[DEBUG   ] Sending event - data = {'_stamp': '2015-11-20T21:40:35.414647'}
[DEBUG   ] Sending event - data = {'pretag': None, '_stamp': '2015-11-20T21:40:36.415859', 'tag': 'foo/bar', 'data': {'__pub_fun': 'event.send', '__pub_jid': '20151120154035413430', '__pub_pid': 59391, '__pub_tgt': 'salt-call'}, 'events': None}

However, the master doesn't seem to want much to do with it. I've been running the master with debuggin on and the only foo-related lines seem to be:

[DEBUG   ] Sending event - data = {'tgt_type': 'glob', 'fun_args': ['foo/bar', '{key:value}'], 'jid': '20151120164246710357', 'return': True, 'retcode': 0, 'tgt': 'myminion', 'cmd': '_return', '_stamp': '2015-11-20T21:42:46.712050', 'arg': ['foo/bar', '{key:value}'], 'fun': 'event.send', 'id': 'myminion'}
[DEBUG   ] Gathering reactors for tag salt/job/20151120164246710357/ret/myminion
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/minion.d/ca.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/ca.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: saltmaster
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/reactor.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/reactor.conf

Now correct me if I'm wrong, but I think that the event that is getting sent in the first line is the event for the event.send job, and not the actual event sent by said job. The output of

salt-run state.event pretty=True

seems to agree, as it doesn't see any event tagged foo/bar, but it does see the event triggered by the job:

salt/auth   {
    "_stamp": "2015-11-20T21:47:39.128795", 
    "act": "accept", 
    "id": "myminion", 
    "pub": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1eiIALNfjxI2JN+SUop\nsZGEDUnWy30J5TJsiSmWezfpDbIklb4zl1RmfoCx529KhK349nvDMtlCP0/F4Yq1\nSlKH4FDt8x4XzkErEGFGkbQ1+2a9LXYpA61hHCnq8mLSPCqX6dS3EVq0hzyaQMP2\nt3bquyXTjtlzcQ1/5+9egaHv21ofArBZzU7PDV2pGP9pI4yg4rjg6RJIOHSRyqYb\nEwhkUtWhZUBc/Yx5PL9Ji543JCyXi8jDc7NSyBZyTMadxSZkKmqXBlhdQsa4OVP2\nFuuoyjjvqF6O3P7qOl0kX45O/mBOudDdrskAv/8m1Emh6kuP4Yy/fKCryzcBhiRg\n4QIDAQAB\n-----END PUBLIC KEY-----\n", 
    "result": true
}
salt/job/20151120164745515025/ret/myminion  {
    "_stamp": "2015-11-20T21:47:45.517110", 
    "arg": [
        "foo/bar", 
        "{key:value}"
    ], 
    "cmd": "_return", 
    "fun": "event.send", 
    "fun_args": [
        "foo/bar", 
        "{key:value}"
    ], 
    "id": "myminion", 
    "jid": "20151120164745515025", 
    "retcode": 0, 
    "return": true, 
    "tgt": "myminion", 
    "tgt_type": "glob"
}

It seems to me that I'm missing something quite simple, but I can't quite put my finger on it. I'm assuming the reason my reactor isn't reacting is because there's nothing to respond to. No attempt is made to gather reactors for foo/bar, but here's the config from /etc/salt/master.d/reactor.conf:

reactor:
  - 'foo/bar':
    - /srv/salt/reactor/foo.sls

and the contents of /srv/salt/reactor/foo.sls:

log_foo:
  local.file.append:
  - tgt: myminion
  - arg:
    - /tmp/reactor_example.txt
    - {{ data }}

/tmp/reactor_example.txt, of course, is empty.

Can anyone see what I'm doing wrong? Any help is appreciated. Master version is salt-master 2015.5.3 (Lithium) and minion version is salt-minion 2015.5.3 (Lithium) as well. Both systems Ubuntu.

fromClouds
  • 155
  • 6

1 Answers1

1

on your master config did you uncomment the following line

default_include: master.d/*.conf

If you don't then the reactor.conf you added will never work

Mike
  • 21,910
  • 7
  • 55
  • 79