Project

General

Profile

Actions

tickets #18432

closed

saltstack: result reports of salt run on minions

Added by tampakrap about 7 years ago. Updated over 5 years ago.

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

0%

Estimated time:

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
Actions #1

Updated by tampakrap about 7 years ago

  • Private changed from Yes to No
Actions #2

Updated by aboe76 almost 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)

Actions #3

Updated by aboe76 almost 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...

Actions #4

Updated by aboe76 over 6 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
Actions #5

Updated by tampakrap over 5 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

Actions

Also available in: Atom PDF