Challenge
The article gives an example of how alarm data can be used in scripting actions.Cause
You would like to use alarm data in custom scripts.Solution
Run script — select this option if you want to run a custom script when the alarm is triggered or when the alarm status changes. By running a post-alarm script, you can automate routine tasks that are normally performed when specific alarms fire. For example, if a critical system is affected, you may need to immediately open a ticket with the in-house support or perform some corrective actions that will eliminate the problem.In the Value field, enter the path to the executable file (please note that the executable file must be located on the Veeam ONE server). You can use the following parameters in the command line for running the script: %1 — alarm name; %2 — fired node name; %3 — triggering summary; %4 — time; %5 — alarm status; %6 — old alarm status.
Example:
REM A script to log alarms in a text file C:\temp\alarm.txt
SET v1=%1
SET v2=%2
SET v3=%3
SET v4=%4
SET v5=%5
SET v6=%6
echo %v1%>>C:\temp\alarm.txt
echo %v2%>>C:\temp\alarm.txt
echo %v3%>>C:\temp\alarm.txt
echo %v4%>>C:\temp\alarm.txt
echo %v5%>>C:\temp\alarm.txt
echo %v6%>>C:\temp\alarm.txt
echo ================================>>C:\temp\alarm.txt