Hi,
I’d like to get a disk space warning in my event bus from my minions and I’d like to define this centrally, in once place. So I’ve opted for defining this in the pillar:
# /srv/pillar/top.sls
base:
'*':
- schedule.sls
- beacons.sls
# /srv/pillar/beacons.sls
beacons:
diskusage:
/: 5%
I’m using 5% so that I can see this event get triggered in the event bus to verify that it works (all my minions should be above 5% in disk usage), which I’m viewing with salt-run state.event pretty=True. And I know that the docs says you should use a different syntax for the diskusage, although this issue says that generates an error and so you should use the syntax I’m now using.
…but I can’t see anything in my event bus. Nothing. When I check for the beacons I get this:
# salt 'bs02*' beacons.list
bs02gen04:
----------
beacons:
----------
What am doing wrong?
I haven’t created/enabled beacons using any commands or anything. I’ve just defined the beacons like above. The schedule.sls is executed perfectly, so I know my pillar top.sls is working.
I’ve also changed the beacon into the load beacon, using both suggested syntaxes outlined in the same issue as mentioned above. But to me it seems beacons doesn’t work at all here.
Any ideas?
Versions report:
Salt Version:
Salt: 2015.8.8.2
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.7.0
Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: 0.6.4
gitpython: 1.0.2
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: 0.9.0
timelib: Not Installed
System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-123.el7.x86_64
system: CentOS Linux 7.2.1511 Core
Regards,
Fredrik
Here’s also the two errors I get depending on which syntax I use for diskusage.beacon: https://github.com/saltstack/salt/issues/29451#issuecomment-221282710
To me it seems that diskusage is broken.
Regards,
Fredrik
--
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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Mike,
Ah, that’s awesome.
I downloaded the new file into /etc/srv/_beacons/diskusage.py and ran a salt '*' saltutil.sync_all. I saw that this file was being synced. I then also restarted the salt-minion service everywhere.
Using the config from the example in that file, I still get an error:
beacons:
diskusage:
- /: 5%
2016-05-24 16:55:01,775 [salt.minion ][CRITICAL][14648] The beacon errored:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 1750, in handle_beacons
beacons = self.process_beacons(self.functions)
File "/usr/lib/python2.7/site-packages/salt/minion.py", line 364, in process_beacons
return self.beacons.process(b_conf)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 55, in process
interval = self._determine_beacon_config(mod, 'interval', b_config)
File "/usr/lib/python2.7/site-packages/salt/beacons/__init__.py", line 105, in _determine_beacon_config
config = config_mod[mod].get(val, False)
AttributeError: 'list' object has no attribute 'get'
Is there anything else I need to do to get this to work?
Do I also need the beacons/__init__.py?
Regards,
Fredrik
--