Powershell script to forward alarms

Monitoring and reporting for Veeam Backup & Replication, VMware vSphere and Microsoft Hyper-V

Re: Powershell script to forward alarms

Veeam Logoby sandsturm » Mon May 29, 2017 10:37 am 1 person likes this post

sounds great

thx a lot
sandsturm
sandsturm
Enthusiast
 
Posts: 44
Liked: 1 time
Joined: Mon Mar 23, 2015 8:30 am

Re: Powershell script to forward alarms

Veeam Logoby Horace27 » Tue Aug 08, 2017 1:09 pm

Hi all.
I'm trying to launch like sandsturm a .cmd to take variables and after call a powershell .ps1, but I'm experiencing strange behavior: ps1 (without variables) works fine but if I launch .cmd it doesn't work.
I configure alarm action like this:

Action: Run script
Value: "C:\script\script.cmd"
Condition: Warning and errors

Where I make mistake? I've latest version of Veeam ONE (9.5.0.3254) Thanks

H.
Horace27
Novice
 
Posts: 5
Liked: never
Joined: Fri May 26, 2017 12:02 pm

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Tue Aug 08, 2017 5:25 pm

sandsturm was asking for unique ID for alarms, I guess the provided script did not work.
Could you describe your use case?
Shestakov
Veeam Software
 
Posts: 5145
Liked: 430 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Powershell script to forward alarms

Veeam Logoby Horace27 » Wed Aug 09, 2017 6:59 am

Hi Shestakov.
My goal is to forward alarm with a telegram message, which I can generate with a powershell script like this:

Invoke-WebRequest -Uri 'https://api.telegram.org/[...]'

So because of I can't use directly variables, I'm trying to configure veeam ONE to execute .cmd using variables and after will call powershell script. But the problem is that if I launch script from windows it works well, otherwise if I run script using action in veeam ONE it doesn't work.
Horace27
Novice
 
Posts: 5
Liked: never
Joined: Fri May 26, 2017 12:02 pm

Re: Powershell script to forward alarms

Veeam Logoby Horace27 » Thu Aug 10, 2017 8:19 am

I resolved issue giving execute privilege at everyone user to run .cmd script.

H.
Horace27
Novice
 
Posts: 5
Liked: never
Joined: Fri May 26, 2017 12:02 pm

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Thu Aug 10, 2017 9:04 am

Sounds interesting. Do you have notifications sent to Telegram now?
Shestakov
Veeam Software
 
Posts: 5145
Liked: 430 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Powershell script to forward alarms

Veeam Logoby Horace27 » Fri Aug 11, 2017 7:31 am

Yes, now I have.
For the exec privilege of .cmd, there is another way to handle whithout use of everyone?
In KB I read that user have to be machine's administrator, so it means I have to nest "Veeam ONE administrators" group in local administrator?

Thanks.
H.
Horace27
Novice
 
Posts: 5
Liked: never
Joined: Fri May 26, 2017 12:02 pm

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Fri Aug 11, 2017 10:00 am

You may add
Code: Select all
whoami > c:\user.txt

into script to check how it is executed.
Could you provide the KB number you are referring to?
Thanks!
Shestakov
Veeam Software
 
Posts: 5145
Liked: 430 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Previous

Return to Veeam ONE



Who is online

Users browsing this forum: No registered users and 1 guest