Getting data from minions that are offline.

159 views
Skip to first unread message

gotm...@gmail.com

unread,
Jul 13, 2017, 8:49:25 PM7/13/17
to Salt-users
Hello! that 

I have a master with several minions attached to it. Due to the nature of our clients, there are people who don't connect for months at a time, but we apply states pretty regularly and there are not any complaints about being behind on versions.

So I have a few questions on reporting. I aplogize if this answer is easly found, I have spend the last day and a half looking for this functionality with no success. I think I just have the wrong terminology. 

My questions:

1. I would like to be able to report  versioning of state pushes. A last date that a minion had recieved a state.apply is fine, but if I could get more information that would be even better. Success and failure logs as well. 
2. Anything in the grains information would be great if I could view it when they were not connected. Is that possible? 
3. Lastly, is there a way to know when a minion was last connected to the master?

I found a lot of this information in the minion log, however if the node is offline, that does not help.

Thank you!
Mike

Seth House

unread,
Jul 13, 2017, 10:40:46 PM7/13/17
to salt users list
I think your best-bet is to lean on Salt's Returner system [1] to send
job returns to some data store that you can query at your leisure.
That will store the whole state return including success/failure, and
a timestamp for when the minion last delivered data. If you configure
Salt's `event_return` [2] interface you can also store things like
presence events [3] for when the minion was last connected. Minion
Grains are cached on the master and available via the cache runner
[4], although you also could periodically send grains in a custom Salt
event if you wanted them to collect in that same data store.

This approach will require a little set up and glue, although less
with a hosted service like Splunk. If you're looking for very
lightweight solutions the sqlite or syslog returners are both easy
drop-ins.

[1] https://docs.saltstack.com/en/latest/ref/returners/all/
[2] https://docs.saltstack.com/en/latest/ref/configuration/master.html#event-return
[3] https://docs.saltstack.com/en/latest/topics/event/master_events.html#presence-events
[4] https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.cache.html#salt.runners.cache.grains

gotm...@gmail.com

unread,
Jul 17, 2017, 11:26:17 AM7/17/17
to Salt-users, se...@eseth.com
Thank you!
Reply all
Reply to author
Forward
0 new messages