Created
August 21, 2016 08:56
-
-
Save sky-joker/3daac595e1f2c4f8a84f085c9401786b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use VMware::VIRuntime; | |
Opts::parse(); | |
Opts::validate(); | |
# connect server. | |
Util::connect(); | |
# To get the perfCounterInfo. | |
my $perfmgr_view = Vim::get_view(mo_ref => Vim::get_service_content()->perfManager); | |
my $perfCounterInfo = $perfmgr_view->perfCounter; | |
# Column Name. | |
print "group" . "," . "counter" . "," . "rolleup type" . "," . "key number" . "," . "unit" . "," . "description", "\n"; | |
# Outputs the result. | |
foreach(@$perfCounterInfo) { | |
my $rolleup_type = $_->rollupType->val; | |
my $groupInfo_key = $_->groupInfo->key; | |
my $unit = $_->unitInfo->summary; | |
my $unit_label = $_->unitInfo->label; | |
my $name_info_summary = $_->nameInfo->summary; | |
my $name_info_key = $_->nameInfo->key; | |
my $key_num = $_->key; | |
print $groupInfo_key . "," . $name_info_key . "," . $rolleup_type . "," . $key_num . "," . $unit . "($unit_label)" . "," . $name_info_summary, "\n"; | |
} | |
# disconnect server. | |
Util::disconnect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment