Monitoring and reporting for Veeam Data Platform
Kazz
Expert
Posts: 147 Liked: 18 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:
Post
by Kazz » Oct 14, 2023 1:33 pm
this post
Hi,
A blog post published here ->
https://www.veeam.com/blog/one-alarms-n ... slack.html is suggesting
Code: Select all
powershell.exe "C:\YOURPATHTOTHESCRIPTS\VeeamONE-Notification-(Slack-OR-Teams).ps1" '%1' '%2' '%3' '%4' '%5' '%6' '%7'
to be used in the Value field of the action. It's not working for me as shown, however if I add -File right after powershell.exe, the script works when action is triggered. Is it supposed to work without -File option or it was missed when article was published ?
Thanks
jorgedlcruz
Veeam Software
Posts: 1485 Liked: 653 times
Joined: Jul 17, 2015 6:54 pm
Full Name: Jorge de la Cruz
Contact:
Post
by jorgedlcruz » Oct 14, 2023 1:42 pm
this post
Hello,
I wrote that blog, geez time flies! At the time of writing, and even today, it works like that. The -File might be something to do with newer powershell versions. Which one you running?
Thanks
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software
@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2024 / InfluxAce / Grafana Champion
Kazz
Expert
Posts: 147 Liked: 18 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:
Post
by Kazz » Oct 14, 2023 3:11 pm
this post
I inherited VONE installation on an 2012 R2 server and ran in to two road blocks.
1. Script VeeamONE-Notification-Teams.ps1 would not get called unless I added -File before the file name
2. Invoke-RestMethod would be consistently denied by office.com because it was going out TLS1.0 (clearly shown in a Wireshark trace)
I had to add [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 to the script to force PS to use TLS1.2.
Don't think newer OSs have this issue.
Here is what I am showing for PS version.
Name Value
---- -----
PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.20719
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2
Kazz
Expert
Posts: 147 Liked: 18 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:
Post
by Kazz » Oct 15, 2023 11:24 pm
this post
I made the notification a bit more organized and easier to read.
Code: Select all
param([string]$AlarmName,[string]$NodeName,[string]$Summary,[string]$Time,[string]$Status,[string]$OldStatus,[string]$ID)
$uri = "YOUR HOOK URL"
Switch ([String]$Status) {
None {$Colour = ''}
Error {$Colour = 'ff0000'}
Warning {$Colour = 'ffe100'}
Reset/resolved {$Colour = '00ff00'}
Default {$Colour = ''}
}
$body = ConvertTo-Json -Depth 4 @{
Summary = 'Veeam One'
themeColor = $Colour
sections = @(
@{
title = '**' + $AlarmName + ' on ' + $NodeName + ' has been changed to: ' + $Status + '**'
activitySubtitle = (Get-Date -UFormat "%A, %B %d, %Y")
facts = @(
@{
name = "Previous state:"
value = $OldStatus
},
@{
name = "Details:"
value = $Summary
}
)
}
)
}
Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType 'application/json'
jorgedlcruz
Veeam Software
Posts: 1485 Liked: 653 times
Joined: Jul 17, 2015 6:54 pm
Full Name: Jorge de la Cruz
Contact:
Post
by jorgedlcruz » Oct 17, 2023 9:02 am
this post
Fantastic, thanks a lot. Is this for Teams?
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software
@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2024 / InfluxAce / Grafana Champion
Kazz
Expert
Posts: 147 Liked: 18 times
Joined: Feb 08, 2018 3:47 am
Full Name: Kazz Beck
Contact:
Post
by Kazz » Oct 17, 2023 10:35 pm
this post
Yep, Teams
jorgedlcruz
Veeam Software
Posts: 1485 Liked: 653 times
Joined: Jul 17, 2015 6:54 pm
Full Name: Jorge de la Cruz
Contact:
Post
by jorgedlcruz » Oct 18, 2023 2:35 pm
this post
I will give all of this a try, and update the blog post with your great work, thanks a lot.
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software
@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2024 / InfluxAce / Grafana Champion
Users browsing this forum: No registered users and 3 guests