VMware {code} Community
wenxin1234114
Contributor
Contributor

why host not found

1.

# perl connect.pl --url  https://192.168.16.154/sdk/vimService  --username root
Enter password:
Connection Successful
Server Time : 2012-08-07T12:41:27.765895Z

2.

#perl viperformance.pl --url  https://192.168.16.154:443/sdk/webService  --username root  --host 192.168.16.154 --countertype cpu

Host 192.168.16.154 not found.

Does anyone know this error reason ?thanks.

Tags (3)
Reply
0 Kudos
5 Replies
lamw
Community Manager
Community Manager

viperformance.pl requires you to specify the --host option, in case you connect to a vCenter Server which manages your ESXi host

Command-specific options:
   --countertype (required)
      Counter type [cpu | mem | net | disk | sys]
   --host (required)
      Name of the host
   --instance
      Name of instance to query
   --interval
      Interval in seconds
   --out
      Name of file to hold output
   --samples (default '10')
      Number of samples to retrieve

If you just want to talk directly to an ESXi host, you'll just specify the same IP/Hostname for the --host option and that should work.

You can take a look at the documentation here for more details - https://www.vmware.com/support/developer/viperltoolkit/viperl41/doc/vsperl_util_index.html

Reply
0 Kudos
wenxin1234114
Contributor
Contributor

I want to talk to esx server directly and use --host option ,but it doesn't work.And it's werid connect.pl worked fine.

Reply
0 Kudos
lamw
Community Manager
Community Manager

I noticed you specified the --url syntax, just use --server and specify the IP Address

viperformance.pl --server a.b.c.d --host a.b.c.d --countertype cpu

wenxin1234114
Contributor
Contributor

I have solved this issued .Just add record to /etc/hosts ip ,hostname ,and it work around .:smileylaugh:

Reply
0 Kudos
wenxin1234114
Contributor
Contributor

hi lamw

I found your wiritten script :

VMware vSphere Health Check Report v5.0.2,

can I tranfer these vm (cpu,mem ,net ,load ) data to mysql ?

thanks.

Reply
0 Kudos