login vsi company logo login vsi company logo 250x40

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.

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-vdi-performance-summit

The VDI Performance Summit - Virtual Conference and Expo

Visit the VDI Performance Summit to gain knowledge and experience about performance and tuning VDI, improving End-User Experience and IT service. Join us at the ONLY virtual event 100% dedicated to VDI performance and tuning | May 2, 2019 This 1-day event offers key-notes presented by the best VDI performance experts in the world, technical and business oriented breakout sessions, the possibility to chat with experts directly to discuss your own situation, and a virtual exhibit hall featuring… Continue Reading

Scalability testing Parallels Remote Application Server with Login VSI

Recently I went to VMworld in Barcelona where Login VSI had a booth on the expo... While I can’t remember exactly how many conversations I had - there had been so many that I lost my voice on day one. What was new this year is that quite a few people asked if our software is compatible with the solutions from Parallels specifically their Remote Application Server (RAS) (Datasheet). Continue Reading
Login VSI Blog Article - Microsoft Windows 10 Default FTA Associations - Teaser Image

Windows 10 Default File Type Associations and Login VSI

When Login VSI 4.1 was released, the majority of desktops were running Windows 7 and life was easy. We’d set the default filetype for an application and it would simply work. The default and industry standard workloads in Login VSI include launching and using Adobe Reader as part of the virtual user simulation. Because Login VSI doesn’t always know which version of Adobe Reader is installed, or where it’s installed, the workload relies on the file type association (FTA) for .pdf documents to be… Continue Reading
Login VSI - Press Release - IGEL - Login VSI Partner to Optimize End User Computing Experience Image

[Press Release] IGEL Partners with Login VSI to Optimize the End User Computing Experience

Login PI enables organizations to better protect the performance and availability of their IGEL OS-powered virtual desktop environments San Francisco, USA, Feb. 6, 2019: IGEL, a world leader in software-defined endpoint optimization and control solutions for the secure enterprise, today announced that it is partnering with Login VSI, provider of software solutions to test and actively monitor the performance and availability of virtual desktop environments, including VDI and… 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
Investigating Online Application Performance with Login PI

Investigating Online Application Performance with Login PI

As many companies do, we use a CRM system. Recently, I have been getting complaints about our cloud CRM system, Microsoft Dynamics, being slow. I tried to investigate this by shadowing one of our users to see what was wrong. As expected, everything was fast. 15 minutes later, the same user reported slowness again. How could I investigate this without bothering the users? Continue Reading
Cookie Settings