timestamp of minion's last state.highstate

955 views
Skip to first unread message

Jared Smith

unread,
Dec 5, 2014, 1:35:45 PM12/5/14
to salt-...@googlegroups.com
I want to add a line to MOTD that I can glance at when logging in to a server and see the last time state.highstate ran.  Where can I grab a timestamp to through into the MOTD?

C. R. Oldham

unread,
Dec 5, 2014, 1:36:44 PM12/5/14
to salt-...@googlegroups.com

> On Dec 5, 2014, at 11:35 AM, Jared Smith <jsm...@smithbunch.org> wrote:
>
> I want to add a line to MOTD that I can glance at when logging in to a server and see the last time state.highstate ran. Where can I grab a timestamp to through into the MOTD?

Can you just file.manage the MOTD at the end of highstate to put the data there?

--cro

signature.asc

Jared Smith

unread,
Dec 5, 2014, 5:22:56 PM12/5/14
to salt-...@googlegroups.com

Yes.  I planned on managing with salt.  I want the MOTD to be dynamic and present me with the latest timestamp of when state.highstate was run.  My issue is finding the timestamp it was last run on the minion.  Is there a log file on the minion that has it?

Thanks,
Jared

--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/1OIJZbKw9DI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Place

unread,
Dec 5, 2014, 5:29:28 PM12/5/14
to salt-...@googlegroups.com
Grab the mtime of the highstate.p in /var/cache/salt/minion.

-mp

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.

Warren Turkal

unread,
Dec 5, 2014, 5:54:36 PM12/5/14
to salt-...@googlegroups.com
Well, you could scrape it from /var/log/salt/minion. However, I think you could also write your motd with "order: last"[1] and use the current date.


wt

Jared Smith

unread,
Dec 5, 2014, 6:09:11 PM12/5/14
to salt-...@googlegroups.com
Bingo!!  That is what I was looking for.  Thanks.

Jared Smith

unread,
Dec 5, 2014, 8:11:50 PM12/5/14
to salt-...@googlegroups.com
Warren...I like where you are going with that.  I will certainly look into your idea as well.

thanks
Reply all
Reply to author
Forward
0 new messages