[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.1.19p1 misidentifies if server is VMWare ESX
From: |
Mark Burgess |
Subject: |
Re: 2.1.19p1 misidentifies if server is VMWare ESX |
Date: |
Sat, 11 Mar 2006 15:36:23 +0100 |
Ok - the approach I am setting on for now is to look for a
directory /etc/vmware. If this is found, look at /etc/issue and convert
the string contents to a classname. Anyone can then alias this long name
themselves with with own class.
Would someone please test this. I think this is the only generic way of
doing it - otherwise we'll need a different rule for each type.
On Tue, 2006-03-07 at 06:58 -0500, Jamie McKnight wrote:
> Mark,
> My suggestion would be something like this:
>
> 1. Make sure you are running on Linux
> 2. Check if /etc/vmware exists (Also found on GSX and Workstation)
> 3. Check to see if VMware-esx rpm is installed
> 4. If #3, get version number from the RPM.
>
> Number 4 could be accomplished from:
>
> rpm -q --qf %{VERSION} VMware-esx
> (in our env currently this returns 2.5.1)
>
> I am not that familiar yet with how things are getting done in
> package.c to know how easy or hard this would be to implement.
>
> I can attempt to code that up, but it might take me a few days to get
> enough time to code/test it.
>
>
> Jamie
>
>
> >
> > Well, I'm just following information that someone sent me. Perhaps he
> > was confused. Please tell me how it should be done.
> > M
> >
> > On Mon, 2006-03-06 at 07:27 -0500, Jamie McKnight wrote:
> >> During testing of 2.1.19p1 I noticed that the class VMWare_ESX was
> >> defined
> >> on a machine that was not an ESX image or server. Looking at misc.c, it
> >> appears that if you can stat /etc/issue, cfengine defines the VMWare_ESX
> >> class.
> >>
> >> src/misc.c:
> >>
> >> 836 if (stat("/etc/issue",&statbuf) != -1)
> >> 837 {
> >> 838 Verbose("\nThis appears to be a VMWare ESX system.\n");
> >> 839 AddClassToHeap("VMWare_ESX");
> >> 840 ESX_version();
> >> 841 }
> >>
> >> Shouldn't that be checking for the existence of the VMware-esx rpm, or
> >> the
> >> existence of the /etc/vmware directory, and not relying on stat'ing
> >> /etc/issue? We drop /etc/motd and /etc/issue files on every host that
> >> print out a big warning banner.
> >>
> >> If I need to provide more info please let me know.
> >>
> >>
> >> Jamie
> >>
> >>
> >>
> >> _______________________________________________
> >> Bug-cfengine mailing list
> >> address@hidden
> >> http://lists.gnu.org/mailman/listinfo/bug-cfengine
> >
> >
>