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: 48
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: 5778
Liked: 495 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: 5778
Liked: 495 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: 5778
Liked: 495 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Powershell script to forward alarms

Veeam Logoby kge8889 » Fri Jan 19, 2018 10:40 pm

Shestakov - Would you be able to provide me a copy of the .bat file you wrote which executes the PowerShell? I am working through a similar problem trying to get Veeam One to run a PowerShell from an alert and it does not want to work with just a PS command.
kge8889
Lurker
 
Posts: 2
Liked: never
Joined: Mon Jun 12, 2017 1:34 pm
Full Name: Ken Everett

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Tue Jan 23, 2018 12:23 pm

Hello Ken,
I don't have the file.
Yes, you can convert you powershell script into a batch file or create the .bat file responsible for execution your PowerShell script.
Shestakov
Veeam Software
 
Posts: 5778
Liked: 495 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Powershell script to forward alarms

Veeam Logoby sandsturm » Tue Jun 12, 2018 5:46 am

Shestakov wrote:Nothing is impossible for our R&D :)
The question is when we have got time for it.
Thank you for that request, it really makes sense, I`ll add it to our road map.


Hi Shestakov

How about the unique ID for Veeam ONE? Were you able to add it to the road map or is it implemented in the meantime?

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

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Tue Jun 12, 2018 6:29 pm

Yes, we are working on it. The feature is goring to be implemented in the next releases.
Thanks!
Shestakov
Veeam Software
 
Posts: 5778
Liked: 495 times
Joined: Wed May 21, 2014 11:03 am
Location: Saint Petersburg
Full Name: Nikita Shestakov

Re: Powershell script to forward alarms

Veeam Logoby sandsturm » Wed Jun 13, 2018 8:05 am

Thank you. I would be happy if you can post here as soon as this is implemented and available.

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

Re: Powershell script to forward alarms

Veeam Logoby Shestakov » Thu Jun 14, 2018 8:29 am

I'll try to remember. You can also find it in What's New document of the release.
Shestakov
Veeam Software
 
Posts: 5778
Liked: 495 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 7 guests