Closed ckoelewijn1 closed 3 years ago
Hello, please replace %VCenter%, %username% and %PW% %VCenter% = your VCenter FQDN %Username% = your VCenter username %PW% = your VCenter Password
For Example -f="PRTG-VMware-Snapshot.ps1" -p="vcenter.contoso.com" "contosoadmin" "secredpassword"
Jannos,
I get this error
XML: Structural error in xml file, 1 open items. -- JSON: The returned JSON does not match the expected structure (No mapping for the Unicode character exists in the target multi-byte code page). (code: PE231)
Van: Jannos-443 @.> Verzonden: donderdag 15 april 2021 20:18 Aan: Jannos-443/PRTG-VMware-Snapshot @.> CC: Christiaan Koelewijn @.>; Author @.> Onderwerp: Re: [Jannos-443/PRTG-VMware-Snapshot] error (#1)
Hello, please replace %VCenter%, %username% and %PW% %VCenter% = your VCenter FQDN %Username% = your VCenter username %PW% = your VCenter Password
For Example -f="PRTG-VMware-Snapshot.ps1" -p="vcenter.contoso.com" "contosoadmin" "secredpassword"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Jannos-443/PRTG-VMware-Snapshot/issues/1#issuecomment-820635059, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWFHW47Y2BC45UNU4I3UVTTI4UWVANCNFSM427UDMRQ. Met vriendelijke groet / Best regards / Mit freundlichen Grüßen, Christiaan KoelewijnIT Administrator
T: +31 33 299 7642 M: +31 6 1324 8150 Teams: @.***
Produktieweg 12 - 3751 LN - Bunschoten Spakenburg - Netherlands Please, consider before printing... Read our green manifesto! De Algemene Inkoopvoorwaarden van Heinen & Hopman Engineering BV zijn van toepassing op alle offerteaanvragen, onderhandelingen en overeenkomsten, met betrekking tot door ons te verstrekken opdrachten inzake aan ons te leveren goederen en/of voor ons te verrichten diensten. Deze voorwaarden liggen bij ons ter inzage en worden op verzoek direct kosteloos toegezonden. The general purchasing conditions of Heinen & Hopman Engineering BV apply to all tender requests, negotiations and agreements, related to the work we provide and/or the services provided for us. These conditions are available for inspection and can be sent to you free of charge upon request.
I get this error.
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VMware-S napshot.ps1 : Cannot convert value "Cannot find an overload for "ToString" and the argument count: "1"." to type "System.Int32". Error: "Input string was not in a correct format." At line:1 char:1
+ CategoryInfo : InvalidArgument: (:) [PRTG-VMware-Snapshot.ps1],
RuntimeException
+ FullyQualifiedErrorId : InvalidCastFromStringToInteger,PRTG-VMware-Snaps
hot.ps1
Van: Jannos-443 @.> Verzonden: donderdag 15 april 2021 20:18 Aan: Jannos-443/PRTG-VMware-Snapshot @.> CC: Christiaan Koelewijn @.>; Author @.> Onderwerp: Re: [Jannos-443/PRTG-VMware-Snapshot] error (#1)
Hello, please replace %VCenter%, %username% and %PW% %VCenter% = your VCenter FQDN %Username% = your VCenter username %PW% = your VCenter Password
For Example -f="PRTG-VMware-Snapshot.ps1" -p="vcenter.contoso.com" "contosoadmin" "secredpassword"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Jannos-443/PRTG-VMware-Snapshot/issues/1#issuecomment-820635059, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWFHW47Y2BC45UNU4I3UVTTI4UWVANCNFSM427UDMRQ. Met vriendelijke groet / Best regards / Mit freundlichen Grüßen, Christiaan KoelewijnIT Administrator
T: +31 33 299 7642 M: +31 6 1324 8150 Teams: @.***
Produktieweg 12 - 3751 LN - Bunschoten Spakenburg - Netherlands Please, consider before printing... Read our green manifesto! De Algemene Inkoopvoorwaarden van Heinen & Hopman Engineering BV zijn van toepassing op alle offerteaanvragen, onderhandelingen en overeenkomsten, met betrekking tot door ons te verstrekken opdrachten inzake aan ons te leveren goederen en/of voor ons te verrichten diensten. Deze voorwaarden liggen bij ons ter inzage en worden op verzoek direct kosteloos toegezonden. The general purchasing conditions of Heinen & Hopman Engineering BV apply to all tender requests, negotiations and agreements, related to the work we provide and/or the services provided for us. These conditions are available for inspection and can be sent to you free of charge upon request.
This is the error i get:
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\PRTG-VMware-Snapshot.ps1 : Cannot convert value "Cannot find an overload for "ToString" and the argument count: "1"." to typ e "System.Int32". Error: "Input string was not in a correct format."
Please try it again now with the new Version and without PSx64.exe. New parameter are on the readme Page
i'm getting this error
line:198 char:48 --- message: Cannot find an overload for "ToString" and the argument count: "1". --- line: $ErrorVMs += "VM=$($Snap.VM) Created=$(($snap.Created).ToString("yy-MM-dd_HH-mm")) Size=$([math]::Round(($Snap.SizeGB),2))GB; "
Thank you, I think I found the error. Could you try it again?
Goodmorning,
I m getting now this error:
To disable this warning and set your preference use the following command and restart PowerShell: Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false. Disconnect-VIServer : 21-4-2021 08:22:41 Disconnect-VIServer Could not find an y of the servers specified by name. At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG-VMwar e-Snapshot.ps1:72 char:17
+ CategoryInfo : ObjectNotFound: (VMware.VimAutom...Server[] Serv
er:RuntimePropertyInfo) [Disconnect-VIServer], ServerObnFailureException
+ FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ServerSpec
ifiedButNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.DisconnectVI
Server
please try again
goodmorning, this is now the error
Could you try it again and if it´s stil the same error please try to comment out the "Set-PowerCLIConfiguration" with a "#"
When i want to login i get the error Could not connect to vCenter server. When i use the connect-Viserver in Powershell and i log in with the server and the credentials i can login.
Could you try to run the Script without PRTG and please check the Parameters again.
Dear Jannos, do you mayby have a solution?
maybe it´s working now, got some problem with the date.
Still the same error
Hi Jannos, I´ve got the same error as ckoelewijn1:
Hi, please try the new code and screenshot the error :)
Hi, this is the error
Hi, the new error is:
I´ve replaced "$Snap.Size" with "$Snap.SizeGB" but then I get the error:
Seems to be a problem, if the VM has more than one Snapshot?
Thanks for the help! New Version should be able to handle more than one Snapshot for a VM. Please try again :)
thanks it is working.
one question how can i exclude vm's from scanning. I've tried it but i did not get it working.
Working if I replace:
line 209: $snap.Size with $snap.SizeGB line 214: $snap.Size with $snap.SizeGB
@ckoelewijn1 please try something like -IgnorePattern '(Test1VM|VM2)'
as parameter.
This excludes "Test1VM", "Test1VM123" and "VM2" for example
@BartoPhotographer right, it should be $snap.SizeGB. I changed it.
please try the new version again.
Thanks, that works
Van: Jannos-443 @.> Verzonden: woensdag 5 mei 2021 12:10 Aan: Jannos-443/PRTG-VMware-Snapshot @.> CC: Christiaan Koelewijn @.>; Mention @.> Onderwerp: Re: [Jannos-443/PRTG-VMware-Snapshot] error (#1)
@ckoelewijn1https://github.com/ckoelewijn1 please try something like -IgnorePattern '(Test1VM|VM2)' as parameter. This excludes "Test1VM", "Test1VM123" and "VM2" for example
@BartoPhotographerhttps://github.com/BartoPhotographer right, it should be $snap.SizeGB. I changed it.
please try the new version again.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Jannos-443/PRTG-VMware-Snapshot/issues/1#issuecomment-832572165, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWFHW5SM7RROM4VTPTGQRTTMEKP7ANCNFSM427UDMRQ. Met vriendelijke groet / Best regards / Mit freundlichen Grüßen, Christiaan KoelewijnIT Administrator
T: +31 33 299 7642 M: +31 6 1324 8150 Teams: @.***
Produktieweg 12 - 3751 LN - Bunschoten Spakenburg - Netherlands Please, consider before printing... Read our green manifesto! De Algemene Inkoopvoorwaarden van Heinen & Hopman Engineering BV zijn van toepassing op alle offerteaanvragen, onderhandelingen en overeenkomsten, met betrekking tot door ons te verstrekken opdrachten inzake aan ons te leveren goederen en/of voor ons te verrichten diensten. Deze voorwaarden liggen bij ons ter inzage en worden op verzoek direct kosteloos toegezonden. The general purchasing conditions of Heinen & Hopman Engineering BV apply to all tender requests, negotiations and agreements, related to the work we provide and/or the services provided for us. These conditions are available for inspection and can be sent to you free of charge upon request.
@Jannos-443: I´ve added two regions to your scripts:
$ResourcePool = "PoolName" $IgnoreList = Get-ResourcePool $ResourcePool -ErrorAction SilentlyContinue if ($IgnoreList -ne $null) { $IgnoreList = Get-ResourcePool $ResourcePool|Get-VM $Result = New-Object -TypeName "System.Collections.ArrayList" foreach ($Snapshot in $AllSnaps) { if ($IgnoreList.Name -notcontains $Snapshot.VM.Name) { $null = $Result.Add($Snapshot) } } } $AllSnaps = $Result
$CSVPath="C:\Users\mph\Desktop\ignore.csv" $IgnoreList = Get-Content $CSVPath -ErrorAction SilentlyContinue if ($IgnoreList -ne $null) { $IgnoreList = Import-CSV -Path $CSVPath -Delimiter ~ $Result = New-Object -TypeName "System.Collections.ArrayList" foreach ($Snapshot in $AllSnaps) { if ($IgnoreList.Name -notcontains $Snapshot.VM.Name) { $null = $Result.Add($Snapshot) } } $AllSnaps = $Result }
With the first region, I exclude all VMs from a whole ResourcePool, with the second one, I use a CSV list, to exclude VMs.
Added Support to Exclude VMware Folder and VMware Ressources.
The CSV exclude will not be added for now.
I'm getting this error. Can you tell me what i do wrong