Help on check_disk using the -p option.

McCann, Brian bmccann at andmore.com
Wed Apr 6 20:09:57 CEST 2005


Close...but not quite.  You don't need multiple check_disk commands in
your libexec directory.  Those commands are executed when you are
checking stuff on the local host only.  Since you are checking a remote
host via nrpe, you don't need them.  Further, just so you understand
this, the command the OS calls has nothing do to with what it is called
in Nagios.  Here is an example from one of my hosts (some stuff left out
to make it short, important bits are there):

Service definitions on the Nagios server:
define service{
   service_description     /
   check_command        check_nrpe!check_disk1
   }
define service{
   service_description     /tmp
   check_command        check_nrpe!check_disk2
   }

Config lines in nrpe.cfg on the target host
command[check_disk1]=/usr/local/libexec/netsaint/check_disk -w 20 -c 10
-p /
command[check_disk2]=/usr/local/libexec/netsaint/check_disk -w 20 -c 10
-p /tmp

What this equates to, is the Nagios server runs the check_nrpe command,
giving it "check_disk1" as check to run on the remote host.  The remote
host sees that string, goes through it's nrpe.cfg file, sees that
check_disk1 runs a certain command, runs it, then returns the results.

Hope that clears things up a bit.  You were close though....very close.
:)

--Brian


-----Original Message-----
From: Mukarram Syed [mailto:muksyed at yahoo.com] 
Sent: Wednesday, April 06, 2005 12:59
To: McCann, Brian; Nagios-Mailing-List
Subject: RE: [Nagios-users] Help on check_disk using the -p option.

Hmm, interesting...
So in my server: in the $NAGIOSHOME/libexec directory:
cp check_disk check_disk_sda1
cp check_disk check_disk_sda2
cp check_disk check_disk_sda3
....4
....5
cp check_disk check_disk_sda6

then in the servers services.cfg:

# Service definition
define service{
        use                            
generic-service         ; Name of service template to
use
        hostgroup_name                 
computer-distopias
        service_description             Disk1
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  unix-team
        notification_interval           240
        notification_period             24x7
        notification_options            w,c,r
        check_command                  
check_nrpe!check_disk_sda1
        }
same for the rest of the 5 disks
with:
service_description             Disk2
check_command                  
check_nrpe!check_disk_sda2

....
....

service_description             Disk6
check_command                  
check_nrpe!check_disk_sda6

On the clients nrpe.cfg:

# sda
command[check_disk_sda1]=/usr/local/etc/nagios/libexec/check_disk_sda1
-w 10% -c 5% -p /dev/sda1
command[check_disk_sda2]=/usr/local/etc/nagios/libexec/check_disk_sda2
-w 10% -c 5% -p /dev/sda2
command[check_disk_sda3]=/usr/local/etc/nagios/libexec/check_disk_sda3
-w 10% -c 5% -p /dev/sda3
command[check_disk_sda4]=/usr/local/etc/nagios/libexec/check_disk_sda4
-w 10% -c 5% -p /dev/sda4
command[check_disk_sda5]=/usr/local/etc/nagios/libexec/check_disk_sda5
-w 10% -c 5% -p /dev/sda5
command[check_disk_sda6]=/usr/local/etc/nagios/libexec/check_disk_sda6
-w 10% -c 5% -p /dev/sda6

Is this what you mean, in detail?
Will this work.
Thanks for your response.


-Mukarram.


--- "McCann, Brian" <bmccann at andmore.com> wrote:

> In the nrpe config, you need to name each of your commands 
> differently.
> For example, don't use "check_disk" for them all. 
> Use "check_disk1",
> "check_disk2", or whatever convention you want to follow.  On the 
> newer systems I'm building, I use "check_disk_mlxd0s1_a", 
> "check_disk"mlxd0s1_d" for example (I'm running FreeBSD, so if you are

> unfamiliar with it, "mlxd0" is the device, "s1" and "a" is the slice 
> and
> partition.)
> 
> Hope that helps,
> --Brian
> 
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of 
> Mukarram Syed
> Sent: Wednesday, April 06, 2005 12:33
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Help on check_disk using the -p option.
> 
> 
> Hi Nagios gurus.
> 
> Have a problem using check_disk with the -p option.
> When I use the check_disk command in the nrpe.cfg
> file on the client as
> shown below:
> 
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda[1-6]
> 
> and when I run the check_disk command from the
> nagios
> server:
> 
> # /usr/local/etc/nagios/libexec/check_nrpe -H
> pegasus -c check_disk I
> get the output as:
> 
> DISK OK [74748 kB (77%) free on /dev/sda1]
> 
> It does not show the rest of the partitions (2
> through 6).  It only
> takes sda1.
> Anything else I may be missing on this.
> 
> I tried to specify individual disk partitons like
> so:
> # Disk Checking:
> 
> # sda
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda1
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda2
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda3
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda5
>
command[check_disk]=/usr/local/etc/nagios/libexec/check_disk
> -w 10% -c 5% -p /dev/sda6
> 
> but the check_disk only looks at the last partiton
> like so:
> # /usr/local/etc/nagios/libexec/check_nrpe -H
> pegasus -c check_disk I
> get the output as:
> 
> DISK OK [104748 kB (66%) free on /dev/sda6]
> 
> Anything I might be missing on this or is there a
> better way to use the
> -p option in the check_disk.  
> Or should I specify more options in the
> checkcommands.cfg file.  My check_nrpe portion in
> the checkcommands.cfg
> file is shown below:
> # 'check_nrpe' command definition
> define command{
>         command_name    check_nrpe
>         command_line   
> /usr/local/etc/nagios/libexec/check_nrpe -H
> $HOSTADDRESS$ -c $ARG1$
>         }
> 
> If I add more arguments in the check_nrpe portion of
> my
> checkcommands.cfg file, all nrpe checks fail (for
> load and disk).  I
> tried that once a few days ago.
> 
> Or should I do something in the services.cfg file?
> Here is a clipping of the check_disk portion of my
> services.cfg file:
> # Service definition
> define service{
>         use                            
> generic-service         ; Name of service template
> to
> use
>         hostgroup_name                 
> computer-distopias
>         service_description             Disk
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           5
>         retry_check_interval            1
>         contact_groups                  unix-team
>         notification_interval           240
>         notification_period             24x7
>         notification_options            w,c,r
>         check_command                  
> check_nrpe!check_disk
>         }
> 
> Thanks for the help in advance.
> -Mukarram Syed.
> 
> 
> 
> 		
> __________________________________
> Yahoo! Messenger
> Show us what our next emoticon should look like.
> Join the fun. 
> http://www.advision.webevents.yahoo.com/emoticontest
> 
> 
>
-------------------------------------------------------
> SF email is sponsored by - The IT Product Guide Read
> honest & candid
> reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
>
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version
> (-v) and OS when
> reporting any issue. 
> ::: Messages without supporting info will risk being
> sent to /dev/null
> 
> 
> 
> 
>
-------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT
> Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
> http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version
> (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being
> sent to /dev/null
> 



Mukarram Syed
muksyed at yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list