Discussion:
[Nagios-users] monitoring esx vmfs
Matteo Mancini
2006-05-19 11:54:03 UTC
Permalink
Hi *

I'm trying to monitoring my vmfs volume on a esx server, I'd like to
check vmfs by nrpe. But I can not understand how to indicate the correct
volume

# /usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /dev/cciss/c0d0p10
DISK CRITICAL - free space:| [/dev/cciss/c0d0p10 not found]

my vmfs lun is vmhba0:0:0:10

# vdf -h
Filesystem Size Used Avail Use% Mounted on
/dev/cciss/c0d0p2 3.8G 730M 2.9G 20% /
/dev/cciss/c0d0p1 69M 12M 54M 18% /boot
/dev/cciss/c0d0p7 1.9G 36M 1.7G 2% /home
none 133M 0 132M 0% /dev/shm
/dev/cciss/c0d0p8 984M 17M 917M 2% /tmp
/dev/cciss/c0d0p6 3.8G 201M 3.4G 6% /var
/dev/cciss/c0d0p5 11G 33M 10G 1% /vmimages
vmhba0:0:0:10 386G 324G 62G 83% /vmfs/vmhba0:0:0:10


Thanks

Matteo Mancini
Jason Martin
2006-05-19 13:22:05 UTC
Permalink
Post by Matteo Mancini
# /usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /dev/cciss/c0d0p10
DISK CRITICAL - free space:| [/dev/cciss/c0d0p10 not found]
-p is partition, not disk. Try /vmfs/vmhba0:0:0:10.

-Jason Martin
Post by Matteo Mancini
# vdf -h
Filesystem Size Used Avail Use% Mounted on
vmhba0:0:0:10 386G 324G 62G 83% /vmfs/vmhba0:0:0:10
--
He who dies with the most toys... is *still* DEAD!
This message is PGP/MIME signed.
Matteo Mancini
2006-05-19 14:04:13 UTC
Permalink
Hi Jason..

thanks for your response..

test 1:
# ./check_disk -w 20 -c 10 -p /vmfs/vmhba0\:0\:0\:10/
DISK CRITICAL - free space:| [/vmfs/vmhba0:0:0:10/ not found]

test 2:
# ./check_disk -w 20 -c 10 -p /vmfs/vmhba0:0:0:10
DISK CRITICAL - free space:| [/vmfs/vmhba0:0:0:10 not found]

test 3 (this is strange!)
# ./check_disk -w 20 -c 10 -x /dev/cciss/c0d0p10
DISK OK - free space: / 3008 MB (76%); /boot 55 MB (79%); /home 1833 MB
(93%); /dev/shm 133 MB (100%); /tmp 917 MB (93%); /var 3536 MB (90%);
/vmimages 11180 MB (95%);| /=930MB;3917;3927;0;3937
/boot=15MB;49;59;0;69 /home=135MB;1948;1958;0;1968
/dev/shm=0MB;112;122;0;132 /tmp=67MB;964;974;0;984
/var=401MB;3917;3927;0;3937 /vmimages=632MB;11792;11802;0;11812

So.. it doesn't work corectly


I've found check_vmfs around the web, but if I use this check on local
machine, the check works good
# ./check_vmfs
VMFS OK: 17% free space on vmhba0:0:0:1

If I try to run check_vmfs via nrep it doesn't return all output
# ./check_nrpe -H esx01.errevisystem.local -p 5666 -c check_vmfs
VMFS OK:

Why??...could be a little plugin bug??

Bye

MAtteo
Post by Jason Martin
Post by Matteo Mancini
# /usr/lib/nagios/plugins/check_disk -w 20 -c 10 -p /dev/cciss/c0d0p10
DISK CRITICAL - free space:| [/dev/cciss/c0d0p10 not found]
-p is partition, not disk. Try /vmfs/vmhba0:0:0:10.
-Jason Martin
Post by Matteo Mancini
# vdf -h
Filesystem Size Used Avail Use% Mounted on
vmhba0:0:0:10 386G 324G 62G 83% /vmfs/vmhba0:0:0:10
Jason Martin
2006-05-19 14:12:06 UTC
Permalink
Post by Matteo Mancini
test 3 (this is strange!)
# ./check_disk -w 20 -c 10 -x /dev/cciss/c0d0p10
DISK OK - free space: / 3008 MB (76%); /boot 55 MB (79%); /home 1833 MB
(93%); /dev/shm 133 MB (100%); /tmp 917 MB (93%); /var 3536 MB (90%);
/vmimages 11180 MB (95%);| /=930MB;3917;3927;0;3937
/boot=15MB;49;59;0;69 /home=135MB;1948;1958;0;1968
/dev/shm=0MB;112;122;0;132 /tmp=67MB;964;974;0;984
/var=401MB;3917;3927;0;3937 /vmimages=632MB;11792;11802;0;11812
So.. it doesn't work corectly
Hmm, I wonder if it is related to the : in the partition names.
Post by Matteo Mancini
If I try to run check_vmfs via nrep it doesn't return all output
# ./check_nrpe -H esx01.errevisystem.local -p 5666 -c check_vmfs
Why??...could be a little plugin bug??
Is NRPE running it under the same user as you did manually? That
is often the cause of differing results from NRPE then normal.

-Jason Martin
--
I xeroxed my watch. Now I have time to spare.
This message is PGP/MIME signed.
Matteo Mancini
2006-05-19 14:26:03 UTC
Permalink
Hi Jason..
Post by Jason Martin
Post by Matteo Mancini
If I try to run check_vmfs via nrep it doesn't return all output
# ./check_nrpe -H esx01.errevisystem.local -p 5666 -c check_vmfs
Why??...could be a little plugin bug??
Is NRPE running it under the same user as you did manually? That
is often the cause of differing results from NRPE then normal.
# su nagios -c "/usr/lib/nagios/plugins/check_vmfs"
VMFS OK:


You are right...How can I solve it?? I don't want to run nrpe as root


Bye

Matteo
Marc Powell
2006-05-19 14:37:08 UTC
Permalink
-----Original Message-----
Sent: Friday, May 19, 2006 11:25 AM
To: Jason Martin
Subject: Re: [Nagios-users] monitoring esx vmfs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Jason..
Post by Jason Martin
Post by Matteo Mancini
If I try to run check_vmfs via nrep it doesn't return all output
# ./check_nrpe -H esx01.errevisystem.local -p 5666 -c check_vmfs
Why??...could be a little plugin bug??
Is NRPE running it under the same user as you did manually? That
is often the cause of differing results from NRPE then normal.
# su nagios -c "/usr/lib/nagios/plugins/check_vmfs"
You are right...How can I solve it?? I don't want to run nrpe as root
If I've found the same plugin you did, it's just a perl wrapper for
/usr/sbin/vdf. Can you run /usr/sbin/vdf as the nagios user? If not, it
likely needs root privs to run. You can either allow nagios to call it
via sudo (using visudo to grant permissions and changing the plugin to
call 'sudo /usr/sbin/vdf' _or_ give /usr/sbin/vdf the suid bit to allow
any user to execute it with root permissions (chmod u+s /usr/sbin/vdf).

--
Marc
Derek J. Balling
2006-05-19 14:41:06 UTC
Permalink
Post by Marc Powell
If I've found the same plugin you did, it's just a perl wrapper for
/usr/sbin/vdf. Can you run /usr/sbin/vdf as the nagios user? If not, it
likely needs root privs to run. You can either allow nagios to call it
via sudo (using visudo to grant permissions and changing the plugin to
call 'sudo /usr/sbin/vdf' _or_ give /usr/sbin/vdf the suid bit to allow
any user to execute it with root permissions (chmod u+s /usr/sbin/
vdf).
Do it with sudo or else every time you upgrade your ESX farm, you'll
have to re-set that bit on every server, since the upgrade-packages
will replace that file with a new one.

Cheers,
D

--

Derek J. Balling
Systems Administrator
Vassar College
124 Raymond Ave
Box 13 - Computer Center 217
Poughkeepsie, NY 12604
(845) 437-7231
Matteo Mancini
2006-05-19 14:45:08 UTC
Permalink
Hi *

Ok, now all run corectly


firs I've edited sudouser

# cat /etc/sudoers
root ALL=(ALL) ALL
%hpsmh ALL=NOPASSWD:/etc/init.d/snmpd
%hpsmh ALL=NOPASSWD:/usr/bin/snmptrap

%nagios ALL=NOPASSWD:/usr/lib/nagios/plugins/check_vmfs


then I've modified nrep.cfg, and added sudo command
# grep check_vmfs /etc/nagios/nrpe.cfg
command[check_vmfs]=sudo /usr/lib/nagios/plugins/check_vmfs

now from nagios
# ./check_nrpe -H esx01 -p 5666 -c check_vmfs
VMFS OK: 17% free space on vmhba0:0:0:1

thanks all

Bye

Matteo

-z
Post by Derek J. Balling
Post by Marc Powell
If I've found the same plugin you did, it's just a perl wrapper for
/usr/sbin/vdf. Can you run /usr/sbin/vdf as the nagios user? If not, it
likely needs root privs to run. You can either allow nagios to call it
via sudo (using visudo to grant permissions and changing the plugin to
call 'sudo /usr/sbin/vdf' _or_ give /usr/sbin/vdf the suid bit to allow
any user to execute it with root permissions (chmod u+s /usr/sbin/ vdf).
Do it with sudo or else every time you upgrade your ESX farm, you'll
have to re-set that bit on every server, since the upgrade-packages
will replace that file with a new one.
Cheers,
D
--
Derek J. Balling
Systems Administrator
Vassar College
124 Raymond Ave
Box 13 - Computer Center 217
Poughkeepsie, NY 12604
(845) 437-7231
Steve Shipway
2006-05-19 20:51:23 UTC
Permalink
VMWare is a bit strange with this one. Basically, vdf lists normal
filesystems plus the vmfs, but the NRPE check_disk plugin is not
vmware-aware and so cannot check them.

I'm doing it here via the SNMP which seems to work, but I've needed to write
a special plugin. You might also like to notice that you can run NRPE
plugins via the SNMP daemon on an ESX server, so you don't actually need
NRPE at all.

Steve

Loading...