Help on check_disk using the -p option.

Mukarram Syed muksyed at yahoo.com
Wed Apr 6 21:25:22 CEST 2005


Brian,
Is it possible to have multiple check_command for a
single service_description?
For example:

define service{
     service_description     Disks
     check_command        check_nrpe!check_disk1
     check_command        check_nrpe!check_disk2
    }

This is only an example, I have tried this but it only
takes the check_command for the last disk in the
check_command listing (in this case it is disk2).

I have tried other options like:
define service{
     service_description     Disks
     check_command        check_nrpe!check_disk1 \
                          check_nrpe!check_disk2
    }

But this does not work.

What you suggested is currently working, but I would
prefer to have all the disks in one
service_description.
Any suggestions would be helpful.
thanks for your help indeed.
-Mukarram.

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

> 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
> 
=== message truncated ===


Mukarram Syed
muksyed at yahoo.com


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


-------------------------------------------------------
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





More information about the Users mailing list