Using vmktree with ESX 3.5

7 views
Skip to first unread message

stu_m...@hotmail.com

unread,
Jul 9, 2008, 4:27:28 AM7/9/08
to vmktree
I am having trouble configuring VMKTree for ESX 3.5. On the last
paragraph of the quick start guide is says to edit the Crond file and
add the line "username ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/
esxtop". I have done this but after restarting the machine there is
an error in the boot up sequence that say something like "username,
command not found".

Can anyone offer some further assistance to get this working?

Many Thanks

lar...@colargol.tihlde.org

unread,
Jul 9, 2008, 5:34:51 AM7/9/08
to vmk...@googlegroups.com
On Wed, Jul 09, 2008 at 01:27:28AM -0700, stu_m...@hotmail.com wrote:
>
> I am having trouble configuring VMKTree for ESX 3.5. On the last
> paragraph of the quick start guide is says to edit the Crond file and
> add the line "username ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/
> esxtop". I have done this but after restarting the machine there is
> an error in the boot up sequence that say something like "username,
> command not found".

You will need to replace "username" with the local esx console user
that you specified when you ran vmktree-addesx

Lars

Ian Cumbers

unread,
Jul 9, 2008, 5:08:07 AM7/9/08
to vmk...@googlegroups.com
Hi Stu,

The Crond entry should be something like:


From: stu_m...@hotmail.com
To: vmktree [mailto:vmk...@googlegroups.com]
Sent: Wed, 09 Jul 2008 09:27:28 +0100
Subject: [vmktree] Using vmktree with ESX 3.5



I am having trouble configuring VMKTree for ESX 3.5. On the last
paragraph of the quick start guide is says to edit the Crond file and
add the line "username ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/
esxtop". I have done this but after restarting the machine there is
an error in the boot up sequence that say something like "username,
command not found".

Ian Cumbers

unread,
Jul 9, 2008, 5:15:50 AM7/9/08
to vmk...@googlegroups.com, stu_m...@hotmail.com
Stu,

The crond entry should be something like:

*  *  *  *  root /usr/bin/vmktree-esx3-collector <esx-servername> root


Whilst the line you you've got in your email:

unnoc ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop

should be entered into the Sudo conf file, by running 'visudo' as root on each of the ESX servers that you want to manage.

The cron entry runs on the server hosting VMKtree and schedules the regular querying of the remote hosts.  The 'visudo' line, on each ESX server, allows the remote VMKtree server to run those two commands (esxcfg-info and exstop) as 'root'.

Note: The two usernames shown, 'root' for crond and 'unnoc' for the Sudo config, will vary, based on how you've set the system up - you may be using different accounts.  Also, the cron entry shown above runs the collector program every minute - this may be too often for some environments.

Hope this helps.

Regards


Ian

stu_m...@hotmail.com

unread,
Jul 9, 2008, 7:07:46 AM7/9/08
to vmktree
I'm confused now. The line I have added at the top of my Crond file
is
"root ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop"

Is this correct command line as when the system boot's it looks like
it try's run a command which start's with 'root'. Is that correct?

On Jul 9, 10:15 am, "Ian Cumbers" <i...@lennington.co.uk> wrote:
> Stu,
>
> The crond entry should be something like:
>
> *  *  *  *  root /usr/bin/vmktree-esx3-collector       <esx-servername> root    
>
> Whilst the line you you've got in your email:
>
> unnoc ALL  = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop
>
> should be entered into the Sudo conf file, by running 'visudo' as root on each of the ESX servers that you want to manage.
>
> The cron entry runs on the server hosting VMKtree and schedules the regular querying of the remote hosts.  The 'visudo' line, on each ESX server, allows the remote VMKtree server to run those two commands (esxcfg-info and exstop) as 'root'.
>
> Note: The two usernames shown, 'root' for crond and 'unnoc' for the Sudo config, will vary, based on how you've set the system up - you may be using different accounts.  Also, the cron entry shown above runs the collector program every minute - this may be too often for some environments.
>
> Hope this helps.
>
> Regards
>
> Ian
>
>   _____  
>

lar...@colargol.tihlde.org

unread,
Jul 9, 2008, 7:34:58 AM7/9/08
to vmk...@googlegroups.com
On Wed, Jul 09, 2008 at 04:07:46AM -0700, stu_m...@hotmail.com wrote:
>
> I'm confused now. The line I have added at the top of my Crond file
> is
> "root ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop"
>
> Is this correct command line as when the system boot's it looks like
> it try's run a command which start's with 'root'. Is that correct?

Hi,
You shouldn't update the cron file at all on the ESX server. The line
you have is to go into the sudoers file on the esx console, but since
you're allowing the root user (you've modified /etc/ssh/sshd_config?) you
don't really need that one either.

Lars

Ian Cumbers

unread,
Jul 9, 2008, 7:39:10 AM7/9/08
to vmk...@googlegroups.com, stu_m...@hotmail.com
Stu,

As I said in my mail,  the line you are using (eith esxcfg-info and esxtop), is *not* supposed to go into the Crond file.  That line should be entered via Visudo.

You've mis-read the quick start guide.   It says:

If you are running VMware ESX 3.5 you will need to add this line to your sudoers file:
username ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop
You can access the sudoers file using the visudo command.

Note:
As Lars points out,  'username' should be changed to the user who has rights to run those programs, e.g. 'root'.

The quick start guide then says:

# /etc/init.d/crond reload

That's may be a tiny bit confusing - this isn't anything to do with 'visudo' - it just tells Linux to reload the Cron (sheduled task) process so that it picks up changes in the cron file.  Earlier in the quickstart guide,  it told you to run 'vmktree-addesx.....' - that process is the program that, amongst other things, adds entries into the 'cron' file.  Running 'reload' just makes sure those changes are picked up.

My mistake (and appologies for this) - I'm used to editing my cron file manually, so I probably confused things by telling you about that line (*  *  *  *  root /usr/bin/vmktree-esx3-collector       <esx-servername> root).  You *don't* have to edit the cron file manually - just let 'vmktree-addesx' do that for you.  When you want more control over how VMKtree runs, then you get to play around with the files yourself :-)

Regards


Ian



From: stu_m...@hotmail.com
To: vmktree [mailto:vmk...@googlegroups.com]
Sent: Wed, 09 Jul 2008 12:07:46 +0100
Subject: [vmktree] Re: Using vmktree with ESX 3.5



I'm confused now. The line I have added at the top of my Crond file
is
"root ALL = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop"

Is this correct command line as when the system boot's it looks like
it try's run a command which start's with 'root'. Is that correct?

On Jul 9, 10:15 am, "Ian Cumbers" <i...@lennington.co.uk> wrote:
> Stu,
>
> The crond entry should be something like:
>
> *  *  *  *  root /usr/bin/vmktree-esx3-collector       <esx-servername> root    
>
> Whilst the line you you've got in your email:
>
> unnoc ALL  = NOPASSWD: /usr/sbin/esxcfg-info, /usr/bin/esxtop
Reply all
Reply to author
Forward
0 new messages