"Error: Invalid option -f" while executing esxcli command "esxcli system health report get"
search cancel

"Error: Invalid option -f" while executing esxcli command "esxcli system health report get"

book

Article ID: 410179

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Executing esxcli command to get health report with -f option fail with below error message :

[root@esx:~] esxcli system health report get -r ""hostd-health"" -f /vmfs/volumes/<datastore_name>/test.txt
Error: Invalid option -f

Environment

ESX 9.0.1

Cause

The -f option was exposing a security vulnerability in the "esxcli system health report get -f" command and this option is removed from ESX 9.0.1 onwards

Resolution

Remove the -f option and use the the Linux redirect (>) method to write the result to the required path.

Example:

[root@esx:~]esxcli system health report get -r ""hostd-health"" > /vmfs/volumes/<datastore_name>/test.txt
[root@esx:~]cd /vmfs/volumes/datastore/
[root@esx:/vmfs/volumes/datastore] ls -al test.txt
-rw-r--r--    1 root     root           220 Mon HH MM:SS test.txt

Additional Information

Command Syntax:

Usage: esxcli system health report get [cmd options]

Description:
  get                   Displays one or more health reports

Cmd options:
  -r|--report-names=[ <str> ... ]
                        Specifies one or more health reports to display. The name(s) of the report can be obtained from the 'esxcli system health report list' command. (required)