Project

General

Profile

tickets #18432

saltstack: result reports of salt run on minions

Added by tampakrap over 3 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Configuration management (CM)
Start date:
2017-04-07
Due date:
% Done:

0%

Estimated time:
Duration:

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

History

#1 Updated by tampakrap over 3 years ago

  • Private changed from Yes to No

#2 Updated by aboe76 about 3 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)

#3 Updated by aboe76 about 3 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...

#4 Updated by aboe76 about 3 years ago

tampakrap,

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

#5 Updated by tampakrap almost 2 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

Also available in: Atom PDF