Using Email Notifications to Check Status of Automated Patching Events

Although we tend to think that BatchPatch really shines when used to execute and monitor patching operations in real-time on numerous remote computers, we have many customers who use BatchPatch to schedule various actions to occur in an automated fashion without any administrator involvement. We don’t recommend this for critical server patching because usually those servers have a very specific up-time requirement, and they need to be patched in real-time with administrator oversight, so that up-time requirements are not violated. But for all of the other times when the target computers can be patched without real-time monitoring, the BatchPatch scheduler is a great way to get things accomplished in the middle of the night without having to be awake while everything is taking place.

Now, the thing with applying Windows updates or deploying software or rebooting many computers via an automated job, whether that be in the middle of the night or on a weekend or some other time altogether, is that the administrator generally always still wants (and needs) to be able to know the status of all the jobs that are being performed without having to actually monitor the process in real-time. For this we recommend using the task scheduler to not only launch the deployments, update jobs, reboots, scripts etc, but also to send email status updates to the administrator, so that he/she can review everything without accessing the BatchPatch console. For the 3AM automated patching windows, wouldn’t it be convenient to wake up in the morning and simply check your email on your mobile phone while still lying in bed in order to determine if all 3AM operations completed without issues?

This link demonstrates the different ways you can send email notifications in BatchPatch, but below I’m going to focus on the specific case of sending a single automated email message to provide status information about all of the hosts in the grid (or about all computers in all of the grids open in the BatchPatch instance).

Configure Default Email Notification Settings

If you have not ever sent email notifications in BatchPatch before, the first thing you need to do is set your defaults.

  1. Select ‘Tools > Settings > Email notifications
  2. Fill out all of the fields and use the ‘Send test email’ button to confirm that everything is working.
  3. For this example we are using $grid as our body text. What that means is that when BatchPatch sends the email it will include a copy of the current BatchPatch grid. If you use $allgrids instead of $grid, the email will include a copy of all of the open grids in the BatchPatch instance. Since our goal in this tutorial is to have a single email provide the status of all computers in the grid, we use $grid. If you want your email to only include the status of the single host/row that is being used to send the email, then you could use $row instead.
    • $row: If you specify $row in the body, the entire contents of the BatchPatch row that initiates the email notification will be included with any email notification that is sent.
    • $grid: If you specify $grid in the body, the entire contents of the grid that contains the row that initiates the email notification will be included with any email notification that is sent
    • $allgrids: If you specify $allgrids in the body, the entire contents of the all the grids in the entire BatchPatch instance that contains the row that initiates the email notification will be included with any email notification that is sent.

Now, let’s say that you have a BatchPatch grid where all hosts are scheduled to be updated and rebooted at 3AM. And let’s assume that you expect all operations to be completed with all hosts back online by 3:30AM. Well, you could then choose to send an email notification at 3:30AM or 4AM (or whenever makes sense for your situation) that includes a copy of the entire grid as an HTML attachment to the email message. This way you can review if your patching was successful or not and if all computers have come back online or not yet etc.

Sending an HTML copy of the entire BatchPatch grid via email

  1. Create a new row in your BatchPatch grid. The host name does not really matter since it will be used strictly for sending an email notification. You could even have the host name as ‘EMAILER’ or similar, like in the screenshot below.
  2. Select the ‘EMAILER’ row and choose ‘Actions > Task scheduler > Create/modify’. Then set the task to ‘Send email notification’ for the desired time, which in this case is 03:30. Then click OK to apply that task schedule to the ‘EMAILER’ row.

  3. Lastly, make sure to enable the task scheduler by clicking on the small clock icon in the upper right corner of the BatchPatch grid. If this icon is red, the task schedule is disabled. When the icon is green it means the task scheduler is enabled/running. A scheduled task will only ever be executed if the task scheduler itself is active/enabled/running.

At 3:30AM when the task is executed it will send an email notification using the default settings that you filled out earlier under ‘Tools > Settings > Email notifications.’ This means that an HTML copy of the entire grid will be sent to the email address(es) configured in that screen. Remember we used the $grid variable to specify that we want the entire grid emailed. If you have multiple tabs/grids open in BatchPatch you might instead prefer to use $allgrids.

This entry was posted in Blog, General, Tutorials and tagged . Bookmark the permalink. Both comments and trackbacks are currently closed.