[Spacewalk-list] Need commands both before and after update

Spacewalk User spacewalk at epperson.homelinux.net
Fri Dec 21 20:38:04 UTC 2012


 

On 2012-12-21 9:25, Paul Robert Marino wrote: 

> While in theory
that sonds like a great idea I can see a few problems with doing it that
way.
> 1) don't you have to re-enable the monitoring after the reboot
>
2) you have enter the actions in every time you push an update any
way.
> 3) there is some planing being done to add a reboot requiered
field in the future either throught the errata or the rpm itself the
holdup is those are larger dicussions because they don't just effect
spacewalk. 
> 
> For this level of complexity I would either write a
script that directly used the apis or use a full scheduler like
jobscheduler from SOS Berlin.
> The scheduler rought is the more robust
route because it will allow to define more robust workflows which could
be triggered by spacewalk or vica versa 
> On Dec 21, 2012 7:54 AM,
"Spacewalk User" <spacewalk at epperson.homelinux.net> wrote:
> 
>> When
pushing patches, I need to run remote commands both before and after the
updates, but the UI seems to offer me only one or the other as part of
the update. Is there a way that I have not found to have both a pre- and
a post- transaction command integral to the software update? 
>> 
>>
Specifics are that I need to send a "cease monitoring" e-mail to the
network operations center and the server team duty manager, run the
update, then reboot the system. I can schedule one of the commands as a
separate scheduled event, but that's not optimal. 
>> 
>> Thanks for any
tips anyone can offer. 
>> 
>> --j.

Thanks for the input. Regarding 1),
the message is to "discontinue monitoring until xx:xx hours on
mm/dd/yy", with the time being the end of the approved change window. At
that point, monitoring resumes and an on-call gets a ticket if there are
any issues. On 2), yes, but it's a simple script paste for the message
and "shutdown -r 0" for the reboot, so no big deal. We do fairly large
groups of servers, and it only has to be done once for each patch group.


Since we have to do change requests and have them approved, ideally we
wouldn't have to send such a message, the monitoring team would check
for change windows before opening tickets, but the monitoring team isn't
on board with that. Which is why I take some pleasure in sending them
one message per server. ;) 

Thus:

HOST=`hostname`
IP=`/usr/bin/dig
+short $HOST`
CHANGE="C9999999"
mail -s"$HOST $CHANGE: cease monitoring,
ignore alerts" notifications at example.com << EOF
Server $HOST with IP $IP
is having patches applied and will be rebooted per $CHANGE. Please
suspend monitoring until 12:00:00 hours on 12/23/2012, the end of the
change window.x

EOF

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20121221/2c6dc101/attachment.htm>


More information about the Spacewalk-list mailing list