-
- Lurker
- Posts: 2
- Liked: never
- Joined: May 07, 2009 5:39 pm
- Full Name: Casey Cochran
- Contact:
How To: Pass alarm details to the alarm response script
I would like to pass a variable to the Script ACTION. IE: i would like to run a script with an argument including the ESXi Host name. Is this possible? Right not I am creating a script action and including a hard coded argument:
c:\script\script.vbs VMServer
Instead I would like to do something like this with a variable:
c:\script\script.vbs %VMServerinquestion%
Is the above possible? Let me know if something does not make sense.
c:\script\script.vbs VMServer
Instead I would like to do something like this with a variable:
c:\script\script.vbs %VMServerinquestion%
Is the above possible? Let me know if something does not make sense.
-
- Chief Product Officer
- Posts: 32269
- Liked: 7622 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: Alarm Script
Casey, it makes and I understand what are you trying to do. Let me check with developers on that.
-
- Chief Product Officer
- Posts: 32269
- Liked: 7622 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: Alarm Script
Here are the parameters that can be passed to script:
So in your case, it sounds like you need to use %3 (I have not tested this myself yet).
Hope this helps!
Code: Select all
%1 : Alarm name
%2 : Alarm description
%3 : VI object name on which alarm has fired
%4 : Triggering summary
%5 : Time
%6 : Status
%7 : Previous status
Hope this helps!
-
- Lurker
- Posts: 2
- Liked: never
- Joined: May 07, 2009 5:39 pm
- Full Name: Casey Cochran
- Contact:
Re: Alarm Script
That is perfect. thank you very much!!!!
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jun 02, 2009 7:02 pm
- Contact:
Re: How To: Pass alarm details to the alarm response script
Hello - wondering if you were able to successfully get variables into your script. I just started dabbling in this and it would appear that the variables that were listed here are not being set. Just curious how you're coming along.
Thanks!
Thanks!
-
- Chief Product Officer
- Posts: 32269
- Liked: 7622 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: How To: Pass alarm details to the alarm response script
Can you post here the command line you use for script action, as well as the actual script?
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Jun 02, 2009 7:02 pm
- Contact:
Re: How To: Pass alarm details to the alarm response script
I was just trying to have it run a simple batch file, echoing the variables out to a text file, like:
echo %1 > vars.txt
echo %2 >> vars.txt
echo %3 >> vars.txt
.
.
.
Just to see what comes back in each variable. Unfortunately, the resulting text file is blank. I want to make sure what I understand is really what's supposed to be happening.
echo %1 > vars.txt
echo %2 >> vars.txt
echo %3 >> vars.txt
.
.
.
Just to see what comes back in each variable. Unfortunately, the resulting text file is blank. I want to make sure what I understand is really what's supposed to be happening.
-
- Chief Product Officer
- Posts: 32269
- Liked: 7622 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: How To: Pass alarm details to the alarm response script
You can use this script as a sample.
Just be sure to create C:\TEMP folder.
c:\alarm.bat
Run script action line is:
Sample output:
Just be sure to create C:\TEMP folder.
c:\alarm.bat
Code: Select all
echo alarm is working >>C:\temp\alarm.txt
c:
cd c:\temp
date /t >> alarm.txt
time /t >> alarm.txt
echo %1 >> alarm.txt
echo %2 >> alarm.txt
echo %3 >> alarm.txt
echo %4 >> alarm.txt
echo %5 >> alarm.txt
echo %6 >> alarm.txt
echo %7 >> alarm.txt
echo ++++++++++++++++++++++++++++++++++++++++++ >> "c:\temp\alarm.txt"
Code: Select all
C:\alarm.bat %1 %2 %3 %4 %5 %6 %7
Code: Select all
alarm is working
Wed 06/03/2009
06:06 PM
"Test Alarm"
"Test Alarm"
"Marik_XP"
"Level of CPU is above 0 "
"6/3/2009 6:06:46 PM"
"Error (Red)"
"Ok (Green)"
++++++++++++++++++++++++++++++++++++++++++
alarm is working
Wed 06/03/2009
06:06 PM
"Test Alarm"
"Test Alarm"
"Igor NFS Test"
"Level of CPU is above 0 "
"6/3/2009 6:06:46 PM"
"Error (Red)"
"Ok (Green)"
++++++++++++++++++++++++++++++++++++++++++
alarm is working
Wed 06/03/2009
06:06 PM
"Test Alarm"
"Test Alarm"
"t_1"
"Level of CPU is above 0 "
"6/3/2009 6:06:47 PM"
"Error (Red)"
"Ok (Green)"
++++++++++++++++++++++++++++++++++++++++++
-
- Novice
- Posts: 6
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: How To: Pass alarm details to the alarm response script
Variables have changed slightly to:
#%1 : Alarm name
#%2 : VI object name on which alarm has fired
#%3 : Triggering summary
#%4 : Time
#%5 : Status
#%6 : Old Status
#%1 : Alarm name
#%2 : VI object name on which alarm has fired
#%3 : Triggering summary
#%4 : Time
#%5 : Status
#%6 : Old Status
-
- VP, Product Management
- Posts: 27580
- Liked: 2872 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: How To: Pass alarm details to the alarm response script
Ricky is correct. To get the latest parameters list please check out our User Guide (page 68)
-
- Novice
- Posts: 3
- Liked: never
- Joined: Feb 20, 2025 10:36 pm
- Full Name: Justin Alexander Loubser
- Contact:
Re: How To: Pass alarm details to the alarm response script
Hi,
I am trying to do the same thing but want to pass the variable to a ServiceNow field and Alarm name is that possible?
I am trying to do the same thing but want to pass the variable to a ServiceNow field and Alarm name is that possible?
-
- Veeam Software
- Posts: 1559
- Liked: 675 times
- Joined: Jul 17, 2015 6:54 pm
- Full Name: Jorge de la Cruz
- Contact:
Re: How To: Pass alarm details to the alarm response script
Hello,
Not at the moment no. As mentioned on another topic, we are trying to expedite this, will let you know if we manage to do so as hotfix or not.
But, still, you can use custom script and use these variables without any problem yes. Or email.
Thank you!
Not at the moment no. As mentioned on another topic, we are trying to expedite this, will let you know if we manage to do so as hotfix or not.
But, still, you can use custom script and use these variables without any problem yes. Or email.
Thank you!
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software
@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2025 / InfluxAce / Grafana Champion
Senior Product Manager | Veeam ONE @ Veeam Software
@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2025 / InfluxAce / Grafana Champion
Who is online
Users browsing this forum: No registered users and 40 guests