tickets #18432
closedsaltstack: result reports of salt run on minions
0%
Description
Right now saltstack is running on our production machines and we have no idea what it is doing. We need at least one of the followings:
- email reporting on changes
- a web interface with combined results (saltpad partially has the functionality)
- store the salt run of every minion in plain logfiles or in a database
- nagios alerts for failed runs on minions
Updated by aboe76 over 7 years ago
possible solution:
#pillar schedule returner rawfile_json
schedule:
highstate:
function: state.apply
minutes: 60
returner: rawfile_json
This will generate a file /var/log/salt/events
#nagios
nagios-check_file_content
check_file_content.pl -f /var/log/salt/events -i success -n 1
output:
OK for /var/log/salt/events (1 found)
Updated by aboe76 over 7 years ago
Found some interesting documenation on how foreman solved the salt reporting:
https://theforeman.org/plugins/foreman_salt/2.0/
It seems that salt scheduling with pillar won't return it's full event report..
they mention: https://github.com/saltstack/salt/issues/12653
in which a user scubahub proposes a solution...maybe this can help...
Updated by aboe76 about 7 years ago
The latest 2017.7.0 (Nitrogen) had a new function:
https://docs.saltstack.com/en/latest/ref/returners/all/salt.returners.highstate_return.html#module-salt.returners.highstate_return
an example:
salt:
minion:
master: salt
schedule:
highstate:
function: state.apply
minutes: 60
return_job: True
returner: highstate
return_kwargs:
report_failures: true
report_changes: true
report_everything: false
report_format: html
report_delivery: file
file_output: /var/log/salt/highstate.html
Updated by tampakrap almost 6 years ago
- Status changed from New to Rejected
We won't do this, running state.apply manually only on the affected hosts and checking the output immediately has served us well all those years