6

I applied state using:

$sudo salt 'api-*' state.highstate -l debug -v

Some states failed and I scrolled down, fixed some and now I can't scroll up (my terminal doesn't save full session) to see the stdout.

Now I don't want to run high state again. I checked jobs.lookup_jid, but it doesn't display anything useful.

avi
  • 9,292
  • 11
  • 47
  • 84

3 Answers3

1

You could check the log files at /var/log/salt/minion

Christian Stade-Schuldt
  • 4,671
  • 7
  • 35
  • 30
  • I cannot check logs of particular minion. Otherwise I have start with each one of them. – avi Sep 24 '15 at 15:59
1

jobs.lookup_jid gives you the return data from that job. If you don't know the job ID, you can list recently-run jobs using salt-run jobs.list_jobs:

# salt-run jobs.list_jobs
20150924134212132446:
    ----------
    Arguments:
    Function:
        test.ping
    StartTime:
        2015, Sep 24 13:42:12.132446
    Target:
        saltmine
    Target-type:
        glob
    User:
        root

It's not clear which logs you want. If you want logs from the minion, you can try tailing the minion log using salt <minion_id> cmd.run 'tail -n100 /var/log/salt/minion.

Erik
  • 176
  • 1
  • 4
  • hi, the `lookup_jid` does not include failures etc or can you tell me exact command? – avi Sep 25 '15 at 03:14
0

You can get the job id from jobs.list_jobs

$> salt-run jobs.list_jobs --out=json
{
    "20190308173940124336": {
        "Function": "state.apply", 
        "Target": "dev-baqar-service-0", 
        "User": "ubuntu", 
        "StartTime": "2019, Mar 08 17:39:40.124336", 
        "Target-type": "glob", 
        "Arguments": []
    }
}

and then run the following to get the highstate output:

salt-run jobs.lookup_jid 20190308173940124336 --out=highstate
Bilal Baqar
  • 208
  • 2
  • 12