Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running on ESXi 3.5 #16

Closed
RobMarshall109 opened this issue Feb 1, 2013 · 2 comments
Closed

Issue running on ESXi 3.5 #16

RobMarshall109 opened this issue Feb 1, 2013 · 2 comments

Comments

@RobMarshall109
Copy link

I've been running ghettoVCB for a while now and it has been working great. I just updated to the latest version and found that on my 1 ESXi 3.5 host the script would fail with the error - "You're not running ESX(i) 3.5, 4.x, 5.x!".

I found by changing following line, the issue was resolved

 ESX_VERSION=$(vmware -v | awk '{print $3}')

to

 ESX_VERSION=$(vmware -v | awk '{print $4}')

The vmware version info comes back as the following on my host:

 ~ # vmware -v
 VMware ESX Server 3i 3.5.0 build-207095
 ~ # vmware -v | awk '{print $3}'
 Server
 ~ # vmware -v | awk '{print $4}'
 3i
@fdleersn
Copy link

fdleersn commented Feb 1, 2013

Hi Rob,

I believe this would break the check for the other versions.
Perhaps using sed or grep to match the version is more suitable.

something like the following sed does the trick

ESX_VERSION=$(vmware -v | sed -e 's#.([3-9].[0-9].[0-9]).#\1#')

but that wouldn't catch 3i. Although it does match any version formatted x.x.x. So that might be good enough as 3.5.0 is also in the line.

using grep on the other hand might be more flexible/readable if syntax is changed in future versions

ESX_VERSION=$(vmware -v)

if echo "${ESX_VERSION}" | grep -E '5.0.0|5.1.0' >/dev/null 2>&1; then
VER=5
elif echo "${ESX_VERSION}" | grep -E '4.0.0|4.1.0' >/dev/null 2>&1; then
VER=4
elif echo "${ESX_VERSION}" | grep -E '3.5.0' >/dev/null 2>&1; then
VER=3
else
echo "You're not running ESX(i) 3.5, 4.x, 5.x!"; exit 1;
fi

Best regards,
Fréderic

On 1-feb.-2013, at 01:05, RobMarshall109 notifications@github.com wrote:

I've been running ghettoVCB for a while now and it has been working great. I just updated to the latest version and found that on my 1 ESXi 3.5 host the script would fail with the error - "You're not running ESX(i) 3.5, 4.x, 5.x!".

I found by changing following line, the issue was resolved

ESX_VERSION=$(vmware -v | awk '{print $3}')

to

ESX_VERSION=$(vmware -v | awk '{print $4}')

The vmware version info comes back as the following on my host:

~ # vmware -v
VMware ESX Server 3i 3.5.0 build-207095
~ # vmware -v | awk '{print $3}'
Server
~ # vmware -v | awk '{print $4}'
3i


Reply to this email directly or view it on GitHub.

@lamw
Copy link
Owner

lamw commented Mar 24, 2013

@fdleersn Thanks for helping out, it looks like the change in the case statement did in fact break ESXi 3.5 version checking. I've gone ahead and implemented your solution and will be pushing it up to the development branch. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants