Unsolved

5 Posts

505

December 1st, 2022 13:00

UEMCLI filter output based on specific health state

I am trying to filter the UEMCLI output for only those state is degraded

uemcli.exe -d 10.10.10.1 -u admin -securePassword /remote/host show -filter "Name,Health state, Health details"

I need a way to list out only those hosts that are degraded based on "Health details" rather than displaying all the hosts with its name, health state, and health details

 

I am using Powershell to execute this command and filter them. 

Moderator

 • 

7.9K Posts

December 2nd, 2022 03:00

Hello vks_001,

It is best to open a support case for this.

5 Posts

December 2nd, 2022 10:00

Will support work on these types of requests? I will open one though. Thanks for the suggestion and will post the solution once I have them

1 Rookie

 • 

14 Posts

December 4th, 2022 17:00

Maybe you can use "-output csv" format?

```bash

uemcli -sslPolicy accept -noHeader -d ${unity} -u ${admin_user} -p ${admin_new_pass} /remote/host show -filter "Name,Health state, Health details" -output csv
"Name","Health state","Health details"
"esxi01.metaage.lab","OK (5)","""The component is operating normally. No action is required."""
"esxi02.metaage.lab","OK (5)","""The component is operating normally. No action is required."""
"10.7.150.2","Major failure (20)","""The system cannot connect to the host. Check the network connection. If the problem persists, contact your service provider. (https://10.7.155.85/help/webhelp/en_US/index.html?#unity_t_unable_to_refresh_managed_server_because_of_a_connection_issue.html)"""
"10.7.150.3","OK (5)","""The component is operating normally. No action is required."""
"10.7.150.5","OK (5)","""The component is operating normally. No action is required."""
"MyHost","OK (5)","""The component is operating normally. No action is required."""

```

I use `uemcli` with BASH.

```bash

$ uemcli -sslPolicy accept -noHeader -d ${unity} -u ${admin_user} -p ${admin_new_pass} /remote/host show -filter "Name,Health state, Health details" -output csv | sed '1d' | grep -v "OK (5)"
"10.7.150.2","Major failure (20)","""The system cannot connect to the host. Check the network connection. If the problem persists, contact your service provider. (https://10.7.155.85/help/webhelp/en_US/index.html?#unity_t_unable_to_refresh_managed_server_because_of_a_connection_issue.html)"""

``` 

Top