Hello,
I'm building a workflow that I need to temporarily disable alarm actions on a host. Would someone be kind enough to post a code snippet that I could create an action with? I have a PS script I made but I'm a noob with JavaScript.
The input being esxHost (VC:HostSystem)
Thanks in advance!
Here is some code to enable / disable alarm actions on a host:
// Disable alarm actions on 'host'
var alarmMgr = host.sdkConnection.alarmManager;
alarmMgr.enableAlarmActions(host, false);
// Enable alarm actions on 'host'
var alarmMgr = host.sdkConnection.alarmManager;
alarmMgr.enableAlarmActions(host, true);
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Here is some code to enable / disable alarm actions on a host:
// Disable alarm actions on 'host'
var alarmMgr = host.sdkConnection.alarmManager;
alarmMgr.enableAlarmActions(host, false);
// Enable alarm actions on 'host'
var alarmMgr = host.sdkConnection.alarmManager;
alarmMgr.enableAlarmActions(host, true);
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Post updated:
I asked for an action which queries if ESXi host alarm action are enabled?
I think, this could work:
var sdkConnection = [VC:HostSystem].sdkConnection;
return sdkConnection.alarmManager.areAlarmActionsEnabled([VC:HostSystem]);