Services available for checking with Nagios

Demetri Mouratis dmourati at cm.math.uiuc.edu
Thu Oct 21 20:24:53 CEST 2004


On Thu, 21 Oct 2004, Jason Williams wrote:

> I have about a dozen servers here at work, all running a variety of services:
>
> -mysql
> -apache
> -imap
> -pop
> -smtp
>
> and a few others.
>
> My question is specifically related to the check_command portion of the
> service. I tried a few of the examples i found in the configs that came
> with nagios: ping, http for instance.
>
> But what im trying to do is find out how to setup the check_command for
> other services, such as mysql, pqsql etc.
> So my question is, where can I find out how to setup the check_command for
> specific services? Is there a file that has more information for each
> plugin? I haven't been able to find any readme for each plugin so I thought
> i'd start here.
>
> Also, one last thing. I have a couple servers that I wanted to check for
> multiple services. Does that mean if I want to monitor lets say apache and
> mysql on one box, I need to add it twice to the services.cfg file, one for
> each service?

You need to craft the check_command lines that are appropriate for the
services you wish to check.  Then, you need to make entires in
checkcommands.cfg to reflect the full arguments for the new checks.
Here's an example on how to check a remote disk by ssh.

services.cfg:
# DISK
# arg1 warning percentage free
# arg2 critical percentage free
# service depends on SSH
define service{
        use                             se-service
        service_description             DISK
        hostgroup_name                  se-nonlocal
        check_command                   check-remote-disk!20%!10%
        }

checkcommands.cfg
#
# check-remote-disk
define command{
        command_name    check-remote-disk
        command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
"$USER1$/check_disk -w $ARG1$ -c $ARG2$ -m"
        }

So, the the check_command in services.cfg looks for an entry in
checkcommands.cfg named check-remote-disk.  The $ARG1$ and $ARG2$ are
passed as 20% and 10% which form the warning and critical disk percentages
free.

To come up with the syntax for the checks you named above, first locate
the relevant plugin then invoke that plugin with --help to see what
arguments it expects.

As for your last question, yes you would need two entries in services.cfg,
one for mysql and one for apache.

Hope that helps.
---------------------------------------------------------------------
Demetri Mouratis
dmourati at linfactory.com



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
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