Saltstack Data collection
-
I'm working on a project where I want to display data collected from Salt Minions. I can easily parse the data once I have it collected in a predictable format. Salt can output to JSON nicely, so that is probably what I will parse from. I am uncertain of the best way to go about the data collection piece though.
Requirements:
- Run a few different commands on a few of Salt minions.
- Output the commands to a JSON file for parsing later.
- Schedule the commands to run on a schedule
Let’s say I want to get 3 pieces of information. I want to get disk space usage, free memory, and cpu load. I want to obtain this information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the commands should be in JSON format. I want the output of the information to be timestamped. So the JSON file would be names something like: “minionname-DiskUsage-yyyy-MM-dd_hhmmss “
What is the best way to achieve this? Is this best achieved through a state file? (In other words, run the state on each minion on a schedule and from within the state file, output the results to the files mentioned above? If so, can someone provide an example?
Or is this better achieved in another way with Salt?
-
@fuznutz04 said in Saltstack Data collection:
information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the
Wouldn't Zabbix be better for this?
-
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the
Wouldn't Zabbix be better for this?
So my thought here is to keep the agents on the servers as minimal as possible. If I am going to use Saltstack for other things as well, is it really necessary to add another zabbix agent as welll?
-
Can be done, SodiumSuite was doing this.
-
@fuznutz04 said in Saltstack Data collection:
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the
Wouldn't Zabbix be better for this?
So my thought here is to keep the agents on the servers as minimal as possible. If I am going to use Saltstack for other things as well, is it really necessary to add another zabbix agent as welll?
I hear ya - but there's also the saying - the right tool for job. I have no clue if using SALT this way is good or not.
-
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the
Wouldn't Zabbix be better for this?
So my thought here is to keep the agents on the servers as minimal as possible. If I am going to use Saltstack for other things as well, is it really necessary to add another zabbix agent as welll?
I hear ya - but there's also the saying - the right tool for job. I have no clue if using SALT this way is good or not.
For non-real time stats, it is pretty good. If you want constant data, it is not.
-
@scottalanmiller said in Saltstack Data collection:
Can be done, SodiumSuite was doing this.
Was is exporting data to a JSON file - or just sending the data directly to the SS server?
-
@scottalanmiller said in Saltstack Data collection:
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
@Dashrender said in Saltstack Data collection:
@fuznutz04 said in Saltstack Data collection:
information every 15 minutes or so. I then want to parse the data later to display somewhere else. The output of the
Wouldn't Zabbix be better for this?
So my thought here is to keep the agents on the servers as minimal as possible. If I am going to use Saltstack for other things as well, is it really necessary to add another zabbix agent as welll?
I hear ya - but there's also the saying - the right tool for job. I have no clue if using SALT this way is good or not.
For non-real time stats, it is pretty good. If you want constant data, it is not.
Yeah, I don't need real time. Would you be willing to share how to do this, or is this secret sauce?
-
@Dashrender said in Saltstack Data collection:
@scottalanmiller said in Saltstack Data collection:
Can be done, SodiumSuite was doing this.
Was is exporting data to a JSON file - or just sending the data directly to the SS server?
It pulls down JSON, but then parses it.
-
I suggest looking into the salt Logstash engine