[Nagiosplug-help] Regarding check_disk

Pak, Dmitry (dmpa) dmpa at tengizchevroil.com
Mon Dec 1 07:53:59 CET 2008


Guys,
I'm totally greatful to all of you who helped me with this issue.

The occasion in my case was the following - I have an old .mnttab.lock
file in /etc directory (dated out of 2003), which was owned (600) by
root and did restrict Nagios user to inquire.
Actually I found this one out through running truss cmd, so my special
thanks goes to Thomas Guyot-Sionnest!

Yours faithfully,
>Dmitry Pak
/usr/bin/ - *NIX+Backup Team

-----Original Message-----
From: Thomas Guyot-Sionnest [mailto:dermoth at aei.ca] 
Sent: Saturday, November 29, 2008 10:36 PM
To: Nagios Plugin Help List
Subject: Re: [Nagiosplug-help] Regarding check_disk

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29/11/08 02:59 AM, Pak, Dmitry (dmpa) wrote:
> Actually I did ran commands under root, until you've advised to su to 
> Nagios user (completely forgot about it!).
>  
> Now I did all the checks logged as Nagios users, and I have same 
> results
> - where it's working - it's working, others still don't.
>  
> Could it be somehow related to ssh or probably NIS configuration 
> (since I do have Nagios user created in NIS)?

I guess your solaris has some fine-grained access control and normal
users can't get the mount list (if "df" works, is it setuid?).

Since check_disk is a C plugin you can setuid it instead of using sudo,
(and for extra-security, chgrp it to the nagios group and don't allow
normal users to run it), although I'm pretty sure solaris allow a way to
give the proper right to your Nagios suer too..

> How does check_disk plugin work? Does it use "df" cmd or somewhat
else?

Getting the mounts and fs usage is different on every operating system.
Check_disk use functions in Gnulib that implement it in in a portable
way, so we don't have to care about each specific operating system.

You can see more details about check_disk by using the -v (verbose)
flag; repeat it up to three times (-vvv) for extra verbosity. You can
also see which syscall are being run, including return values and
failures if you run it with truss, i.e.
$ truss ./check_disk <arguments>

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJMX2I6dZ+Kt5BchYRAvfqAJ4rB2P8+AnfdFlmna+0CCgIIUoFQACg7Ojj
+W5Tu6DKEaLVsQX/hn6E8/I=
=8Xqm
-----END PGP SIGNATURE-----

------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK &
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue.

::: Messages without supporting info will risk being sent to /dev/null




More information about the Help mailing list