Monitoring disk usage

Guy Waugh guidosh at gmail.com
Wed Jul 15 11:42:15 CEST 2009


Hi Juki,

On Wed, Jul 15, 2009 at 10:24 AM, Juki <juki.emma at gmail.com> wrote:

> Hi Guy,
>
> Many thanks for your post.
>
> I decided to go with Option (1) as per your description and did the
> following in the nrpe.cfg file on the monitored host:
>
> command[check_disk]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /
> command[check_var]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p
> /var
> command[check_server1]=/usr/local/nagios/libexec/check_disk -w 30% -c 20%
> -p /var/opt/BGw/Server1
> command[check_ora]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p
> /var/opt/mediation/ora


Looks good, except the first one... call it 'check_root' like this:

command[check_root]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /


>
>
>
> And then on the nagios monitoring server I have this:
>
> define service{
>         use                             generic-service         ; Name of
> service template to use
>         host_name                       emm4
>         service_description             Root Partition
>         check_command                   check_nrpe!check_disk!15%!10%!
>         }
>
> define service{
>         use                             generic-service         ; Name of
> service template to use
>         host_name                       emm4
>         service_description             var Partition
>         check_command                   check_nrpe!check_var!30%!20%!
>         }
>
> define service{
>         use                             generic-service         ; Name of
> service template to use
>         host_name                       emm4
>         service_description             server1 Partition
>         check_command                   check_nrpe!check_server1!30%!20%!
>         }
>
> define service{
>         use                             generic-service         ; Name of
> service template to use
>         host_name                       emm4
>         service_description             ora Partition
>         check_command                   check_nrpe!check_ora!30%!20%!
>         }


You're still half way between the two approaches with your service
definitions, because you're passing arguments :-)

Try this instead:

define service{
        use                             generic-service         ; Name of
service template to use
        host_name                       emm4
        service_description             Root Partition
        check_command                   check_nrpe!check_root
        }

define service{
        use                             generic-service         ; Name of
service template to use
        host_name                       emm4
        service_description             var Partition
        check_command                   check_nrpe!check_var
        }

define service{
        use                             generic-service         ; Name of
service template to use
        host_name                       emm4
        service_description             server1 Partition
        check_command                   check_nrpe!check_server1
        }

define service{
        use                             generic-service         ; Name of
service template to use
        host_name                       emm4
        service_description             ora Partition
        check_command                   check_nrpe!check_ora
        }

>
>
>
> When I log into the nagios Web GUI, the services for the ora, server1 and
> var partition have been successfully created. However, looking at the
> "status information" column, I have the following errors:
>
> "NRPE: Command 'check_ora' not defined"
> "NRPE: Command 'check_server1' not defined"
> "NRPE: Command 'check_var' not defined"


Try my changes suggested above and see if these errors persist. They might
be happening because you're passing arguments to the remote NRPE daemon, I'm
not sure...

Regards,
Guy.


>
>
> This indicates that I need to explicitly define 'check_ora',
> 'check_server1' and 'check_var' elsewhere. So, where else must I define
> these services so as to clear out the errors above?
>
> Thanks in advance!
>
>
>
>
>
>
> 2009/7/15 Guy Waugh <guidosh at gmail.com>
>
>> Hi Juki,
>>
>> As I understand it, you can either (1) 'hard-code' your NRPE checks in the
>> nrpe.cfg file on the monitored host (so that the checks are explicitly
>> defined), or (2) set up NRPE on the monitored host in such a way that you
>> can pass arguments in your NRPE checks. It looks like you're landing
>> somewhere between the two with your configuration.
>>
>> I would either go the Option (1) way, having something like this in your
>> nrpe.cfg file on the monitored host:
>> *command[check_root]=/usr/local/nagios/libexec/check_disk -w 30% -c 15%
>> -p /
>> **command[check_var]=/usr/local/nagios/libexec/check_disk -w 30% -c 15%**-p /var
>> **command[check_server1]=/usr/local/nagios/libexec/check_disk -w 30% -c
>> 15%** -p /var/opt/BGw/Server1
>> **command[check_ora]=/usr/local/nagios/libexec/check_disk -w 30% -c 15%**-p /var/opt/mediation/ora
>> *
>>
>> , and then having services on the nagios host like this:
>>
>> *define service{
>>         use                             generic-service         ; Name of
>> service template to use
>>         host_name                       emm4
>>         service_description             Root Partition
>>         check_command                   check_nrpe!check_root
>>         }*
>>
>> Alternatively, for the Option (2) method, on the monitored host, in
>> nrpe.cfg:
>>
>> *command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c
>> $ARG2$ -p $ARG3$*
>>
>> , and a service example on the nagios host:
>>
>> *define service{
>>         use                             generic-service         ; Name of
>> service template to use
>>         host_name                       emm4
>>         service_description             Root Partition
>>         check_command                   check_nrpe!check_disk!30!15!/
>>         }*
>>
>> I may not have the syntax in the 'check_command' of that last service
>> exactly right, but that's the general idea.
>>
>> To go down the Option 2 road, you have to have configured the NRPE daemon
>> on the monitored host with '--enable-command-args', and have to have a line
>> in your nrpe.cfg file that says 'dont_blame_nrpe=1'. This is because
>> allowing command arguments in this fashion can be a security risk. The
>> default nrpe.cfg file has some comments that refer to this.
>>
>> HTH,
>> Guy.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090715/ab68c67c/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
-------------- next part --------------
_______________________________________________
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