login vsi company logo login vsi company logo 250x40

 

Get the best possible VDI performance, density and availability with Login VSI
Our Solutions

How to configure Login PI to send alerts via e-mail

How to configure Login PI to send alerts via e-mail

A huge advantage of Login PI is the fact that it will automatically generate alerts about performance in your virtualized desktop environment--before your end users start to notice issues. These alerts are displayed in the Login PI event log. But what if you are not checking the interface because you are off getting a nice cup of coffee? Wouldn’t it be great if you could automatically receive these alerts in your email Inbox as well? In this blog post I will explain how to set up Login PI to send alerts via email.

You may also be interested my colleague Omar’s recent post that goes into greater detail on associating tasks with PI alerts – today’s post shows how you can generate an email in one of those tasks.

Login PI writes every warning/error in the event log. With the task scheduler (built into Windows) you can attach tasks to the event log. So, let’s get started.

First, we should create a script that can mail the event logs. An easy way to do this is by copying the one I’ve made below. Don’t forget to adjust the email addresses and SMTP server settings: username, password, SMTP server and port (otherwise I will receive all your alerts ). Save the file afterwards as a PowerShell file (.ps1). Remember the location where you saved it because we will need it later on.

$event = get-eventlog -LogName "PI - Alerts" -newest 1
$EmailBody = $event.Message
$EmailFrom = "change.this@example.com"
$EmailTo = "change.this@example.com" 
$SMTPServer = "smtp.office365.com"
$username = "change.this@example.com"
$passwordtext = "MyP@ssw0rd!"
$password = ConvertTo-SecureString -AsPlainText $passwordtext -Force
$credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
if ($event.EntryType -eq "Warning")
{
    Write-host "Sending Email Warning"
    $EmailSubject = "Login PI - Warning"
}
elseif ($event.EntryType -eq "Error")
{
    Write-host "Sending Email Error"
    $EmailSubject = "Login PI - Error"
}
Send-MailMessage -From $EmailFrom -To $EmailTo –Subject $EmailSubject –Body $EmailBody -SmtpServer $SMTPServer -Credential $credentials -UseSsl -Port 587 

Now that we have created a mail script, we can open the event log. On the server where Login PI is installed, we go to Application and Services Logs -> PI Alerts. Right-click PI - Alerts and click Attach a Task To this Log.

how to configure login pi to send alerts via e mail attach a task to this log

A Create Basic Task Wizard will appear. Enter your task a name and continue until you can add the program or script. Add the powershell.exe in the program/script bar and add the mail script as argument. Place the ‘-file’ parameter in front of it. Be aware that if your PowerShell- or mail script location contains white spaces you will need to add quotes.

how to configure login pi to send alerts via e mail create a basic task

After we’ve added the script and pressed Next, we should mark as open the properties of the new task. Also make sure to select ‘Run whether user is logged on or not’ option, otherwise you will not be notified when you are logged off.

how to configure login pi to send alerts via e mail jasper geelen

The job is done! Time to relax and grab a cup of coffee until you get alerted.

 


 

Start using Login VSI today

Our industry-standard software is built to help you avoid problems, lower costs and improve performance. Request a Quote or get your free Trial below, and benefit from our award-winning services.

Free Price Request  Your Free Trial

 


About the company Login VSI

The company Login VSI provides end-user performance insights for virtualized desktop and server-based computing environments. Enterprise IT departments use flagship product Login VSI (for load testing) and Login PI (for continuity testing) in all phases of their virtual desktop deployment—from planning to deployment to change management—to build and safeguard a good performance, a high availability, and (as a result) a good and consistent end-user experience. For more information about Login VSI or for a free test license contact us.

About the author

Jasper Geelen (@jaspergeelen) has a background in ICT and joined Login VSI as a pre-sales engineer in 2015. He loves drinking a lot of coffee (some might call him an addict). In his spare time, Jasper enjoys a beer and he is part of a football / soccer team. He also coaches a team of younger football players.


Tags: How-to, Login PI, Monitoring, Best Practices, Support, Scripts

Popular Blogs

Login VSI Blog - Ongoing Effects CPU Flaws

The Ongoing Effects of Intel CPU Flaws

The Ongoing Effects of Intel CPU Flaws Over the last year, we’ve seen many Intel CPU hardware flaws come to light and when news first broke about Meltdown & Spectre there was a lot of panic: "should we patch?", "What’s the performance impact?", "Can we still rely on this hardware?" Continue Reading
Login VSI Blog - How-To Update, Protect Against RIDL, Fallout MDS Vulnerability

How-To: Update, Protect Against RIDL, Fallout MDS Vulnerability

RIDL & Fallout MDS vulnerabilities, impact on VDI performance & actions to take. FAQs we’re receiving & updates on performance tests executed to patch flaws Intel calls “Microarchitectural Data Sampling (M.D.S.)” aka: Rogue In-Flight Data Load (RIDL), Fallout, ZombieLoad & Store-to-Leak Forwarding. Continue Reading
Login VSI Blog - Teaser Image - A Practical Guide to VDI Change Management - Part 1

A Practical Guide to VDI Change Management

Part 1: IT Change Management in general The first in an 8-part series, this practical guide to VDI Change Management will guide you through the transformation of the IT department from a back-end function into a core competency for every modern organization. Continue Reading
Login VSI - Blog - Login PI Blog Teaser Image - Windows Virtual Desktop: How To Monitor User Experience With Login PI

Windows Virtual Desktop – How to Monitor User Experience?

Microsoft has just announced the public preview of their new Windows Virtual Desktop (WVD) offering at Microsoft Ignite on Tour in Amsterdam today. For those of you who’ve not followed the rumors or the private beta, here’s the outline... Continue Reading
A Practical Guide To VDI Change Management, Part 3

A Practical Guide to VDI Change Management

Part 3: Change Accelerates with Windows 10 The third in an 8-part series, this practical guide to VDI Change Management gives you the low-down on the what, why and how of Windows 10 updates and changes Continue Reading
Login VSI Blog - Teaser Image - A Practical Guide to VDI Change Management - Part 2

A Practical Guide to VDI Change Management

Part 2: Why VDI is very sensitive to change The second in an 8-part series, this practical guide to VDI Change Management highlights the importance of effective Change Management. With all the complexities of VDI environments, any failure can severely impact your business. Continue Reading
Cookie Settings