Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Identifying and working with Salt event types


To work with Salt events, one of the most important aspects is to identify the type of Salt event. In this recipe, we will look at some of the Salt event types and how we can identify and work with them.

How to do it...

  1. A preconfigured Python script is available to listen to Salt events continuously. Download the file from the following location on the Salt master and run it using the Python command:

    [root@salt-master ~]# wget https://raw.github.com/saltstack/salt/develop/tests/eventlisten.py
    
    [root@salt-master ~]# python eventlisten.py
    
  2. Configure a new minion and start the salt-minion service daemon on the minion.

  3. Observe the events being captured on the Salt master; there should be outputs as follows:

    Event fired at Tue Feb 24 13:42:49 2015
    *************************
    Tag: salt/auth
    Data:
    {'_stamp': '2015-02-24T13:42:49.444198',
     'act': 'accept',
     'id': 'salt-minion',
     'pub': '-----BEGIN PUBLIC KEY----- \nMIICIjANBgkqhkiG9w0BAQEFAAOCA....==\n---...