Class ProtocolHealthCheckStrategy
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy
org.sentrysoftware.metricshub.engine.strategy.collect.ProtocolHealthCheckStrategy
A strategy that aims to perform health check over a hostname on each protocol
(HTTP, SNMP, IPMI, ...).
This aims to report the responsiveness of configured protocols on a resource. The health check is performed at the beginning of each data collection cycle, and a metric is generated for each protocol indicating whether it is responding or not.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DoubleProtocol down status value '0.0'static final StringHTTP Up metricstatic final StringIPMI Up metricstatic final StringThe SNMP OID value to use in the health check teststatic final StringSNMP Up metricstatic final StringSSH test command to executestatic final StringSSH Up metricstatic final DoubleProtocol up status value '1.0'static final StringWQL Query to test WBEM protocol health checkstatic final StringWBEM Up metricList of WBEM protocol health check test Namespacesstatic final StringWINRM Up metricstatic final StringWMI and WinRM protocol health check test Namespacestatic final StringWQL Query to test WMI and WinRM protocols health checkstatic final StringWMI Up metricFields inherited from class org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy
CONNECTOR_ID_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionProtocolHealthCheckStrategy(@NonNull TelemetryManager telemetryManager, @NonNull Long strategyTime, @NonNull ClientsExecutor clientsExecutor) Constructs a newHealthCheckStrategyusing the provided telemetry manager, strategy time, and clients executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckHttpHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check HTTP protocol health on the hostname for the host monitor.voidcheckIpmiHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check Ipmi protocol health on the hostname for the host monitor.voidcheckSnmpHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check SNMP protocol health on the hostname for the host monitor.voidcheckSshHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check SSH protocol health on the hostname for the host monitor.voidcheckWbemHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check WBEM protocol health on the hostname for the host monitor.voidcheckWinRmHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check WINRM protocol health on the hostname for the host monitor.voidcheckWmiHealth(String hostname, Monitor hostMonitor, MetricFactory metricFactory) Check WMI protocol health on the hostname for the host monitor.Provide the current time from which the strategy starts.longGet the timeout of the strategy.voidrun()
-
Field Details
-
UP
Protocol up status value '1.0' -
DOWN
Protocol down status value '0.0' -
HTTP_UP_METRIC
HTTP Up metric -
SNMP_UP_METRIC
SNMP Up metric -
SSH_UP_METRIC
SSH Up metric -
IPMI_UP_METRIC
IPMI Up metric -
WBEM_UP_METRIC
WBEM Up metric -
WMI_UP_METRIC
WMI Up metric -
WINRM_UP_METRIC
WINRM Up metric -
SNMP_OID
The SNMP OID value to use in the health check test- See Also:
-
SSH_TEST_COMMAND
SSH test command to execute- See Also:
-
WBEM_UP_TEST_NAMESPACES
List of WBEM protocol health check test Namespaces -
WBEM_TEST_QUERY
WQL Query to test WBEM protocol health check- See Also:
-
WMI_AND_WINRM_TEST_QUERY
WQL Query to test WMI and WinRM protocols health check- See Also:
-
WMI_AND_WINRM_TEST_NAMESPACE
WMI and WinRM protocol health check test Namespace- See Also:
-
-
Constructor Details
-
ProtocolHealthCheckStrategy
public ProtocolHealthCheckStrategy(@NonNull @NonNull TelemetryManager telemetryManager, @NonNull @NonNull Long strategyTime, @NonNull @NonNull ClientsExecutor clientsExecutor) Constructs a newHealthCheckStrategyusing the provided telemetry manager, strategy time, and clients executor.- Parameters:
telemetryManager- The telemetry manager responsible for managing telemetry-related operations.strategyTime- The time when the strategy is executed.clientsExecutor- The executor for managing clients used in the strategy.
-
-
Method Details
-
run
public void run() -
getStrategyTimeout
public long getStrategyTimeout()Description copied from interface:IStrategyGet the timeout of the strategy.- Specified by:
getStrategyTimeoutin interfaceIStrategy- Overrides:
getStrategyTimeoutin classAbstractStrategy- Returns:
- long value representing the timeout in seconds.
-
getStrategyTime
Description copied from interface:IStrategyProvide the current time from which the strategy starts.- Returns:
Longvalue representing the start time of the strategy.
-
checkHttpHealth
Check HTTP protocol health on the hostname for the host monitor. Criteria: The HTTP GET request to "/" must return a result.- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-
checkSnmpHealth
Check SNMP protocol health on the hostname for the host monitor. Criteria: SNMP Get Next on '1.3.6.1' SNMP OID must be successful.- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-
checkSshHealth
Check SSH protocol health on the hostname for the host monitor. Criteria: The echo command must be working.- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric metric
-
checkIpmiHealth
Check Ipmi protocol health on the hostname for the host monitor. Criteria: The getChassisStatusAsStringResult IPMI Client request request must return a result.- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-
checkWbemHealth
Check WBEM protocol health on the hostname for the host monitor.- Criteria: The query must not return an error for at least one of the following namespaces: "root/Interop", "interop", "root/PG_Interop", "PG_Interop"
- Query: SELECT Name FROM CIM_NameSpace.
- Success Conditions: CIM_ERR_INVALID_NAMESPACE and CIM_ERR_NOT_FOUND errors are considered successful, indicating that the protocol is responding.
- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-
checkWmiHealth
Check WMI protocol health on the hostname for the host monitor.- Criteria: The query must not return an error for at least one of the root\cimv2 namespace.
- Query: SELECT Name FROM Win32_ComputerSystem.
- Success Conditions: No errors in the query result, indicating that the protocol is responding.
- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-
checkWinRmHealth
Check WINRM protocol health on the hostname for the host monitor.- Criteria: The query must not return an error for at least one of the root\cimv2 namespace.
- Query: SELECT Name FROM Win32_ComputerSystem.
- Success Conditions: No errors in the query result, indicating that the protocol is responding.
- Parameters:
hostname- The hostname on which we perform health checkhostMonitor- An endpoint host monitormetricFactory- The metric factory used to collect the health check metric
-