Real-time performance monitoring and troubleshooting
Post Reply
jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Script not being executed when alarm is triggered

Post by jtweath »

I recently deployed Veeam Availability Suite One ver. 8 in our environment, but I’m having trouble getting a simple test script to run when a VM is powered off. I’m using the ‘VM power status’ alarm to monitor a test vm which should kick off a simple script.

My automate goal is to automate the failover of a highly-critical vm to a replica.

- c:/Scripts/Test.cmd

dir c:/ > c:/Scripts/test.txt

Pause

Alarm Settings
  • Action = Run Script
  • Value=c:/Scripts/Test.cmd
  • Condition=Any State

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

Hello Jay,

Can you confirm that you value is specified like this "c:/Scripts/Test.cmd" and not using "\" instead? Is it a typo in the post?

Thanks!

jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: Script not being executed when alarm is triggered

Post by jtweath »

Yes. Sorry. It is a typo. It is "C:\Scripts\Test.bat".

Alarm Settings
  • Action = Run Script
  • Value="C:\Scripts\Test.bat"
  • Condition=Any State

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

Does Veeam ONE service account have access to the location of the script? Can you trigger that script manually using our service account?

jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: Script not being executed when alarm is triggered

Post by jtweath »

Vitaliy S. wrote:Does Veeam ONE service account have access to the location of the script? Can you trigger that script manually using our service account?
The service account has local admin rights and can manually run the script. This is a simple tasks that should run with no problems. The alarm is monitoring the vm because the 'Repeat Count' is increasing every time it’s powered on/off. I just don't know why the 'Action' is not being performed.

jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: Script not being executed when alarm is triggered

Post by jtweath »

Does the script have to be a certain type of script/file type? .cmd, .bat, .ps1, etc

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

Batch script should be ok, see this topic with script examples we have used at VeeamON 2014 > ONEbelievable tricks: Veeam ONE and Automation Services
jtweath wrote:The service account has local admin rights and can manually run the script.
Try to explicitly add read write access to the folder with scripts, so that account used for Veeam ONE service can execute them. If it doesn't help, then please open a support case with our team and let me know your case ID.

jtweath
Novice
Posts: 7
Liked: 1 time
Joined: Jul 21, 2015 7:03 pm
Full Name: Jay W
Contact:

Re: Script not being executed when alarm is triggered

Post by jtweath » 1 person likes this post

I explicitly added the veeam service account, but it still didn't work. Also, one of our consultants was unsuccessful in getting it to work in their lab as well.

My veeam support case # 00975173.

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Hi,

Has this issue been resolved?
I'm experiencing same problem with my script - it's not running when an alarm is triggered.

Please advise.


Thanks,

toningzkiz

Shestakov
Expert
Posts: 7328
Liked: 773 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: Script not being executed when alarm is triggered

Post by Shestakov »

Hi Antonio,
Yes, the case mentioned above has been resolved via support by installing the private patch and the last update.
What product version are you at?
Thanks!

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Hi Nikita,

I'm using Veeam v7.0
Version 7.0.0.919

Where can I download the private patch/last update?

Thanks and regards,

Tony

Shestakov
Expert
Posts: 7328
Liked: 773 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: Script not being executed when alarm is triggered

Post by Shestakov »

You can get it via Veeam technical support.
toningzkiz wrote:
Version 7.0.0.919

The OP`s issue has been solved by installing the latest build of v8. So you need to update to v8 first and apply the latest patch.
Thanks!

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

No solution for this version (V7) on this issue?

Thanks,

Tony

Shestakov
Expert
Posts: 7328
Liked: 773 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: Script not being executed when alarm is triggered

Post by Shestakov »

The best way to check is to contact our support team.
Once you do, please post your support case # here.
Thanks!

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Here's my Case # 01111593

Latest recommendations:

1. Update to patch No. 2 (KB1927) - already done
2. check Set-Execution Policy if on Unrestricted level - already done. Powershell scripts are running and generating results. I'm using a simple batch file in my testing. It runs as standalone, but not as post script in Veeam.
3. Add Veeam One account to the Windows Administrators group - already done adding the service account for Veeam on the local administrators group of the Veeam server.

Script is still not working after doing the steps above.

I also installed one Veeam server with V8 and latest update (Version 8.0.0.1669), and still postscript is not working on this version.

Seems I'm not doing it right.
Can you tell me how to make this work on V8?

Thank you very much for your support.

Regards,

Tony

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

Tony, all you've done should be enough to make it work. What was the reply of your support engineer after reviewing the debug logs?

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Hi Vitaliy,

We tested one script he provided and it did work.
The sample script runs calc.exe when an alarm was triggered.
It did generate lots of calc instances in the Task Manager (both V7 and V8).
Seems script runs in hidden mode on Veeam One server.

However, my goal was to run a .wav file every time an alarm is triggered.
He provided me another script (I really appreciate the support) which plays .wav file.
The script runs as standalone program but not as post script from Veeam server which is a Hyper-V VM by the way.

He's testing this on lab and has yet to get back to me.

Hope he can nail it and make the .wav file play once an alarm is triggered.


Thanks and regards,

Tony

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

If you specify a script from this topic (see audible alarm section), does this work in your infrastructure?

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz » 1 person likes this post

Yes, it did work!

Finally.. :D
Seems audio plays remotely only.

Thanks Vitaliy!

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

I believe there is a way to adapt remote execution script to work locally as well, but glad that finally you have an audible alarm!

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Thanks!

I tried pointing the server path to the local machine and the audio didn't play.

Regards,

Tony

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

What's the error message you see in the script execution log?

toningzkiz
Novice
Posts: 9
Liked: 1 time
Joined: Oct 25, 2013 8:45 am
Full Name: Antonio Rodriguez
Contact:

Re: Script not being executed when alarm is triggered

Post by toningzkiz »

Hi Vitaliy,

I didn't see any errors generated on the eventlog related to non-execution of script.
Where can I find the script execution log?

Even if I point the PSexec to the Veeam host (local) server itself, the script runs successfully as a standalone program when run on same Veeam server.
But as a post-alarm script in Veeam seems it doesn't run because no audible alarm is played when triggered.


Thanks and regards,

Tony

Vitaliy S.
Product Manager
Posts: 24076
Liked: 1807 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Script not being executed when alarm is triggered

Post by Vitaliy S. »

Tony, it's either in VeeamDCS.log or somewhere else, our technical team should know for sure. Can you share your observations with your engineer while I'm trying to reproduce this in my lab?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests