The load balanced application's virtual server health has dropped below the configured threshold.
One or more of the Web or Application servers attached to the virtual server may have failed.
Click Implement to dynamically provision new server virtual machines that will be attached to the load balanced virtual server, to improve the overall health of the application. Or, click Dismiss and resolve the state of the failed servers.
Target | Citrix.NeScaler.VirtualServer.Health.PRO.VMMServer | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | Custom | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Citrix.NetScaler.TimedScript.TwoStateMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Citrix.NetScaler.NetscalerDevice.Deteriorating.Virtual.Server.Health.Pro.Monitor2" Accessibility="Public" Enabled="false" Target="Citrix.NeScaler.VirtualServer.Health.PRO.VMMServer" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Citrix.NetScaler.TimedScript.TwoStateMonitorType" ConfirmDelivery="false">
<Category>Custom</Category>
<AlertSettings AlertMessage="Citrix.NetScaler.NetscalerDevice.Deteriorating.Virtual.Server.Health.Pro.Monitor2_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="CitrixNSPRO!Citrix.NeScaler.PRO.VMMServer"]/IPAddress$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='VirtualServerName']$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Citrix.NetScaler.NetscalerDevice.Deteriorating.Virtual.Server.Health.Pro.Monitor1.HealthState.Healthy" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Citrix.NetScaler.NetscalerDevice.Deteriorating.Virtual.Server.Health.Pro.Monitor1.HealthState.Unhealthy" MonitorTypeStateID="Error" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<ScriptName>WebServerHealthPRO.PS1</ScriptName>
<Arguments>$Target/Property[Type="CitrixNSPRO!Citrix.NeScaler.PRO.VMMServer"]/IPAddress$</Arguments>
<ScriptBody>
$TargetComputer = $Args[0];
$NetScalerIPAddress = $Args[1];
$NetScalerUserID = $Args[2];
$NetScalerPassword = $Args[3];
$VirtualServerName = $Args[4];
$Threshold = $Args[5];
$WebServerHttp = "http://";
function Log-Event ($EventType, $EventID, $Description)
{
eventcreate /T $EventType /ID $EventID /L APPLICATION /SO CitrixNSPRO /D $Description;
}
function Load-NetScalerAPIDLL ()
{
$NetScalerStatAPIDLL = $env:ProgramFiles + '\Citrix\NetScaler\SystemCenter\Scripts\NSStat.dll';
$Error.Clear();
$LoadAPIDLL = [Reflection.Assembly]::LoadFile($NetScalerStatAPIDLL);
if ($Error.Count -ne 0)
{
Log-Event Error 4 'WebServerHealth Monitor: NetScaler Stat API DLL load failed.';
return -1;
}
return 0;
}
function Get-LbvserverHealth()
{
$client = new-object NetScaler.API.NSStatServiceEx(($WebServerHttp + $TargetComputer),$NetScalerUserID,$NetScalerPassword);
if(!$client)
{
Log-Event Error 5 'WebServerHealth Monitor: NetScaler client login failed.';
return -1;
}
$loginResult = $client.Login();
if( $loginResult.rc -ne 0)
{
Log-Event Error 5 'WebServerHealth Monitor: NetScaler client login failed.';
return -1;
}
$statlbvserverResult = $client.statlbvserver($VirtualServerName);
if ($statlbvserverResult.rc -ne 0)
{
Log-Event Error 7 'WebServerHealth Monitor: NetScaler Stat Service statlbvserver API failed.';
return -1;
}
$logoutReturn = $client.Logout();
return $statlbvserverResult.list[0].vslbhealth;
}
function Validate-ScriptArguments ()
{
if ($NetScalerIPAddress -ine $TargetComputer)
{
return -1;
}
if (!$NetScalerIPAddress)
{
Log-Event Warning 8 'WebServerHealth Monitor Override: NetScalerIPAddress is empty.';
return -1;
}
if (!$VirtualServerName)
{
Log-Event Warning 9 'WebServerHealth Monitor Override: VirtualServerName is empty.';
return -1;
}
if ($Threshold -le 0)
{
Log-Event Warning 10 'WebServerHealth Monitor Override: Threshold is less than or equal to zero.';
return -1;
}
if (!$NetScalerUserID)
{
Log-Event Warning 11 'WebServerHealth Monitor : NetScaler Authentication Profile not attached to valid RunAS Account.';
return -1;
}
if (!$NetScalerPassword)
{
Log-Event Warning 11 'WebServerHealth Monitor : NetScaler Authentication Profile not attached to valid RunAS Account.';
return -1;
}
return 0;
}
function Main
{
$oAPI = new-object -comobject MOM.ScriptAPI;
$oBag = $oAPI.CreateTypedPropertyBag(3);
$ValidateArgumentResult = Validate-ScriptArguments;
if ($ValidateArgumentResult -lt 0)
{
$oBag.AddValue("State","Unknown");
$oAPI.Return($oBag);
return;
}
$LoadAPIDLLResult = Load-NetScalerAPIDLL;
if ($LoadAPIDLLResult -lt 0)
{
$oBag.AddValue("State","Unknown");
$oAPI.Return($oBag);
return;
}
$VServerHealth = Get-LbvserverHealth;
if ($VServerHealth -lt 0)
{
$oBag.AddValue("State","Unknown");
$oAPI.Return($oBag);
return;
}
$oBag.AddValue("NetScalerSource", $TargetComputer);
$oBag.AddValue("VirtualServerName", $VirtualServerName);
$oBag.AddValue("Health", $VServerHealth);
if ($VServerHealth -lt $Threshold)
{
$oBag.AddValue("State","Unhealthy");
}
else
{
$oBag.AddValue("State","Healthy");
}
$oAPI.Return($oBag);
} Main; </ScriptBody>
<TimeoutSeconds>600</TimeoutSeconds>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Unhealthy</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Healthy</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
<NetScalerIPAddress/>
<UserID>$RunAs[Name="CitrixNSPRO!Citrix.NetScaler.PRO.NS.PrivilegedAccount"]/UserName$</UserID>
<Password>$RunAs[Name="CitrixNSPRO!Citrix.NetScaler.PRO.NS.PrivilegedAccount"]/Password$</Password>
<VirtualServerName/>
<Threshold>50</Threshold>
</Configuration>
</UnitMonitor>