Salt stack event system
The event system in Salt is a local ZeroMQ PUB interface, which fires salt events. It is performed by the following components.
*Event Sockets − It is used to publish events.
*Event library − It is used to listen to events and send the events into the salt system.
Salt Master Event
*A Salt master provides different types of events, which are explained in detail below
*Authentication events
*Start events
*Key events
*Job events
*Runner Events
*Presence Events
*Cloud Events
Authentication Events
These authentication events fire when a minion performs an authentication check with the master. It is represented by salt/auth.
Start Events
The start events fire whenever a minion connects to the Salt master and it is represented by salt/minion/start.
Key Events
The Key events are fired when the salt-master is accepting and rejecting keys on the Salt minion. we can access this event using the salt-key command.
Job Events
A Job event is fired whenever a new job is going to start. It is represented by salt/job/new.
Runner Events
When a runner begins execution, a runner event is fired. It is represented by salt/run/new.
Presence Events
When minions are connected or newly connected or disconnected, this event is fired at a regular interval. It is represented by – salt/presence/present and salt/presence/change. Here,
*Present − means the Salt master is currently connected to the minion's list.
*Change − used to detect a new minion – connected or disconnected.
Cloud Events
The salt-cloud events are fired on a virtual machine. Unless other events, it is not performed on the minion. we can access it using – salt/cloud//creating. It is fired when a Salt cloud starts the virtual machine execution process.
Event Tools
Now, let us go through the event tools and scripts. we can access the event bus using CLI. It is accessed by the following command.
#salt-run state.event pretty = True
Here, the runner is designed to interact with the event bus from external tools and shell scripts. Salt’s event bus can be accessed remotely via the REST API. It is represented by sample URL
#curl -SsNk https://salt-api.example.com:8000/events?token = 05A3
Recent Comments
No comments
Leave a Comment
We will be happy to hear what you think about this post