Best to Gather Data from Several Minions? Salt Mine?

121 views
Skip to first unread message

Gabriel Galvão

unread,
Sep 22, 2014, 4:22:32 PM9/22/14
to salt-...@googlegroups.com
Hi, folks,

I just started studying Salt and it is great so far. I just can’t get to know what is the best way to run several SQL queries on the minions and store these information and maybe INSERT them into a DB on the master?

I began trying to make it work using salt_mine.

It looks like this on the /etc/salt/minion file

mine_functions:
mysql.query:
database: db
query: “etc"

mysql.query:
database: db
query: "etc"

mysql.query:
database: db
query: "etc"

mysql.query:
database: db
query: "etc"

mysql.query:
database: db
query: "etc"


The problem is: it only keeps the last defined mysql.query entry. Now it seems that I could solve this using the ‘alias’ feature documented.

It did not.

Whenever I defined something like

mine_functions:
my_function:
mine_function: mysql.query
database: db
query: “etc”

Salt would print an error telling me that he doesn’t know ‘my_function’ .


Is this task really best accomplished this way? Why didn’t the alias technique work? How could I extract the information from the mine on the master and maybe pass ir to a method that could insert into a DB?




Regards,

Gabriel Galvão

unread,
Sep 23, 2014, 7:23:18 AM9/23/14
to salt-...@googlegroups.com
Oops,

Subject was supposed to be 'Best Way*'.

I saw that the alias feature is only supported on the latest Release Candidate 2014.7. That was my fault not paying enough attention to this.

I also researched into the 'returner' attribute of the job scheduler. What is not clear is if this returner will only work on each minion or if this can be called all the way to the master, centralizing information. Anyone?

Gabriel Galvão

unread,
Sep 23, 2014, 9:32:58 AM9/23/14
to salt-...@googlegroups.com
I guess I now have the answer to my own question.


You can set up a redis, mysql, sqlite3, whatever method on the minion configuration file and then call it as the returner for your scheduled function call.
Reply all
Reply to author
Forward
0 new messages