Hello everyone.
I want to say right away, maybe I'm on the wrong path
And if someone tells me a way how to collect IOPs more correctly. I will be grateful.
I had an idea to collect OIPs metrics from PowerCli.
Wrote a script.
From bash all right
But from the zabbix web
new item
pw_getHDD.sh["-server","win10"]
output "test" button
Connect-VIServer' command was found in the module 'VMware.VimAutomation.Core', but the module could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'
Any ideas what's wrong?
I want to say right away, maybe I'm on the wrong path
And if someone tells me a way how to collect IOPs more correctly. I will be grateful.
I had an idea to collect OIPs metrics from PowerCli.
Wrote a script.
param(
[Parameter()]
[String]$server
)
Import-Module VMware.VimAutomation.Core
$vCenter='vca.local.local'
$username='[email protected]'
$password='pass'
Connect-VIServer -Server $vCenter -User $username -Password $password
Get-Stat -Entity $server -Realtime -MaxSamples 1 -Stat virtualDisk.writeOIO.latest | Select @{L='{#HDDLOCATION}';E={$_.Instance}} | ConvertTo-Json
Disconnect-VIServer -Server $vCenter -Force -confirm:$false -ErrorAction SilentlyContinue -WarningAction 0 | Out-Null
[Parameter()]
[String]$server
)
Import-Module VMware.VimAutomation.Core
$vCenter='vca.local.local'
$username='[email protected]'
$password='pass'
Connect-VIServer -Server $vCenter -User $username -Password $password
Get-Stat -Entity $server -Realtime -MaxSamples 1 -Stat virtualDisk.writeOIO.latest | Select @{L='{#HDDLOCATION}';E={$_.Instance}} | ConvertTo-Json
Disconnect-VIServer -Server $vCenter -Force -confirm:$false -ErrorAction SilentlyContinue -WarningAction 0 | Out-Null
From bash all right
./pw_getHDD.sh -server win10
Name Port User
---- ---- ----
vca.local.local 443 VSPHERE.LOCAL\user
[
{
"{#HDDLOCATION}": "scsi0:0"
},
{
"{#HDDLOCATION}": "scsi0:1"
}
]
Name Port User
---- ---- ----
vca.local.local 443 VSPHERE.LOCAL\user
[
{
"{#HDDLOCATION}": "scsi0:0"
},
{
"{#HDDLOCATION}": "scsi0:1"
}
]
new item
pw_getHDD.sh["-server","win10"]
output "test" button
[91mImport-Module:
[96mLine |
[96m 12 | [0m [96mImport-Module VMware.VimAutomation.Core[0m
[96m | [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[91m[96m | [91mThe type initializer for 'VMware.VimAutomation.ViCore.Util10.SettingsManage r' threw an exception.[0m
[91mConnect-VIServer:
[96mLine |
[96m 19 | [0m [96mConnect-VIServer[0m -Server $vCenter -User $username -Password $passwo …
[96m | [91m ~~~~~~~~~~~~~~~~
[91m[96m | [91mThe 'Connect-VIServer' command was found in the module 'VMware.VimAutomation.Core', but the module could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.[0m
[91mGet-Stat:
[96mLine |
[96m 24 | [0m [96mGet-Stat[0m -Entity $server -Realtime -MaxSamples 1 -Stat virtualDisk.wr …
[96m | [91m ~~~~~~~~
[91m[96m | [91mThe 'Get-Stat' command was found in the module 'VMware.VimAutomation.Core', but the module could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.[0m
[91mDisconnect-VIServer:
[96mLine |
[96m 25 | [0m Disconnect-VIServer -Server [96m$vCenter[0m -Force -confirm:$false -ErrorA …
[96m | [91m ~~~~~~~~
[91m[96m | [91mCannot process argument transformation on parameter 'Server'. The type initializer for 'VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFa ctory' threw an exception.[0m
[96mLine |
[96m 12 | [0m [96mImport-Module VMware.VimAutomation.Core[0m
[96m | [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[91m[96m | [91mThe type initializer for 'VMware.VimAutomation.ViCore.Util10.SettingsManage r' threw an exception.[0m
[91mConnect-VIServer:
[96mLine |
[96m 19 | [0m [96mConnect-VIServer[0m -Server $vCenter -User $username -Password $passwo …
[96m | [91m ~~~~~~~~~~~~~~~~
[91m[96m | [91mThe 'Connect-VIServer' command was found in the module 'VMware.VimAutomation.Core', but the module could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.[0m
[91mGet-Stat:
[96mLine |
[96m 24 | [0m [96mGet-Stat[0m -Entity $server -Realtime -MaxSamples 1 -Stat virtualDisk.wr …
[96m | [91m ~~~~~~~~
[91m[96m | [91mThe 'Get-Stat' command was found in the module 'VMware.VimAutomation.Core', but the module could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.[0m
[91mDisconnect-VIServer:
[96mLine |
[96m 25 | [0m Disconnect-VIServer -Server [96m$vCenter[0m -Force -confirm:$false -ErrorA …
[96m | [91m ~~~~~~~~
[91m[96m | [91mCannot process argument transformation on parameter 'Server'. The type initializer for 'VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFa ctory' threw an exception.[0m
Any ideas what's wrong?
Comment