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 - Updating to Windows 10 1903? Make Sure to Test!

Updating to Windows 10 1903? Make Sure to Test!

Updating to Windows 10 1903? Make Sure to Test! It’s that time of the year again. Microsoft have released their spring update and the first IT-Pro’s are getting ready to move their VDI environment over. Continue Reading
Login AT Express offers Application Compatibility Testing for up to 50 applications for FREE

[Press Release] Login VSI introduces free license for award winning solution, Login AT

Login AT Express offers Application Compatibility Testing for up to 50 applications for FREE Atlanta, USA, May 22, 2019: Login VSI, the industry standard for VDI and SBC performance testing, announced today the availability of a new, free version of Login AT for Bulk Application Compatibility Testing. Continue Reading
Login VSI Blog - LVTE 2109 - Technology Advocates & Experts

Login VSI Technology Advocates and Experts 2019

About a year ago Login VSI, the industry standard in VDI performance testing, announced a new program Recognizing those individuals that have built and displayed extensive knowledge of the Login VSI software solutions, and visibly contribute to the End-User Computing (EUC) Community. Continue Reading
Introducing Login PI 3.4

Introducing Version 3.4 of Login PI

What’s New & Different - Introducing Version 3.4 of Login PI We've updated Login PI, the benchmark in unplanned-change and gradual-deterioration detection for VDI. New features include improving the way information is collected & distributed, the way customized workloads are created & the way actual tests are executed. Continue Reading
Login VSI Blog - What's New in Login PI 3.5

What's New in Login PI 3.5?

What's New in Login PI 3.5? Netscaler, SLA Reporting, Event Logging features and so much more! At the end of June, we released a new version of Login PI 3 bursting with new features and enhancements. There are so many that I could write pages of blog about it, but let’s just keep it simple and focus on some of the big items. Continue Reading
Cookie Settings