VMware Cloud Community
SKIRK505
Enthusiast
Enthusiast
Jump to solution

vSphere CLI: Error: Unknown Command

This could be as simple as me just missing something, but since I don't use the CLI very much at all, I thought I would just ask. I can connect to the CLI, but no matter what command I use the host just responds with either "<command> not found" or when using vSphere CLI "Error: Unknown command or namespace"

I've even tried connecting through my vCenter Server and then out to the host using --vihost command, which works, but I still get the error that the command I am trying use it recognized.

vSphere CLI

C:\Program Files (x86)\VMware\VMware vSphere CLI>esxcli --server <servername> --username <my username> --password <my password> vicfg-snmp.pl --server <servername> -c public

Error: Unknown command or namespace vicfg-snmp.pl


1 Solution

Accepted Solutions
jrmunday
Commander
Commander
Jump to solution

You need to run this command from the vSphere CLI command prompt (not the shell as per above) and make sure that the bin folder is in your path. If not execute this from here;

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl --server <servername> --username <my username>--password <my password> --show

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77

View solution in original post

6 Replies
jrmunday
Commander
Commander
Jump to solution

You seem to be mixing two separate commands (esxcli and the perl script vicfg-snmp.pl).

Try this as an example;

vicfg-snmp.pl --server <servername> --username <my username>--password <my password> --show

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
Reply
0 Kudos
SKIRK505
Enthusiast
Enthusiast
Jump to solution

The "esxcli --server <servername> --username <my username> --password <my password>" is how vSphere CLI application connects to the ESXi Host, and then it runs the "vicfg-snmp.pl --server <servername> -c public" against the host.

I have also tried using the same vicfg-snmp.pl command while logged into the host using putty, and get the same thing.. "-sh: vicfg-snmp.pl: not found"

So far I have tried vSphere CLI, PowerGUI,and  Putty (both telnet and SSH), all connect to the ESXi Host fine, but no matter the command I try and send to the host, the host tells me ii doesn't know the command.


Below is the sanitized output of the command that you recommended using Putty to the connect to the ESXi Host.


VMware offers supported, powerful system administration tools.  Please
see www.vmware.com/go/sysadmintools for details.

The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
~ # vicfg-snmp.pl --server <server> --username <user> --password <password> --show
-sh: vicfg-snmp.pl: not found
~ #

Reply
0 Kudos
jrmunday
Commander
Commander
Jump to solution

You need to run this command from the vSphere CLI command prompt (not the shell as per above) and make sure that the bin folder is in your path. If not execute this from here;

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl --server <servername> --username <my username>--password <my password> --show

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
SKIRK505
Enthusiast
Enthusiast
Jump to solution

Outstanding.. that is what I was missting.. I didn't have it in the \bin directory. I knew it had to be something simple.

MrJohnson
Enthusiast
Enthusiast
Jump to solution

Hello Guys,

I'm trying to do the same thing but I don't have a bin directory.  I'm re-installing the VMware vSphere PowerCLI to see it that will do the trick.  Can you guys tell me what I'm doing wrong?

Reply
0 Kudos
MrJohnson
Enthusiast
Enthusiast
Jump to solution

I installed VMware vSphere CLI... didn't know there was a diff...

Reply
0 Kudos