rackerlabs / auter

Automatic updates for RHEL, Debian, and their derivatives, with the ability to run pre/post hooks & reboot afterwards.
Apache License 2.0
65 stars 18 forks source link

Add final STATUS line to 'output files' i.e. /var/lib/auter/last-{phase}-output-default #213

Closed mark-hyde closed 5 years ago

mark-hyde commented 5 years ago

I've a script which I run across multiple servers to determine the success/failure status of each phase of auter for reporting purposes.

/var/lib/auter/last-{phase}-output-default is generated for each phase of auter, and overwritten with the output from the latest run each time.

We wish to be able to determine, by examining this file, whether or not this specific phase of the auter run has succeeded or failed at the latest attempt.

The following approaches are currently possible but have downsides: A - grep for the auter logs in /var/log/messages. Look for 'auter --{phase} ' and then look for any 'ERROR' which follows.

B - find the datestamp at the top of the output file, look for ERRORs in the system log at that time.

C - grep -i ERROR in the 'output file' for that phase


Instead could you add a status line to the end of the /var/lib/auter/last-{phase}-output-default files with an easily parse-able status

rhodesn commented 5 years ago

Would something in the format:

STATUS:FAILED:Small description of state
//
STATUS:SUCCESS:Small description of state

On the last line work for you?

mark-hyde commented 5 years ago

That would be super!

rhodesn commented 5 years ago

I've popped a quick PR in #214. I went with a SUCCESS status for no package updates available as everything technically ran correctly. Let me know what you think, and if you want any changes made.

rhodesn commented 5 years ago

Closing now that #214 has been merged in.