Problem with swap service configuration


#1

Hello all,

I have worked on the command service definition for checking the swap partition for a while, and I am not able to figure out to correctly configure it with a percentage value. It is alway comming up with and unkown error saying “warning threshold must be an interger or procentage value”. Here is what my current configuration looks like:

Define command{
               command name        check_swap
               command_line          $USER1$/check_swap -w $70%$ -c $80%$
               }

I want nagios to send out emails according to the given percentages when the server hits these values. I have tried several different ways of placing the % in different places without success. Where do I need to place the % in order to get the correct configuration, or how should I configure this correctly?


#2

Try

define command{
        command_name    check_swap
        command_line    $USER1$/check_swap -w $ARG1$% -c $ARG2$%
        }

and in your service definition, use:

        check_command                   check_swap!20!10

Where 20 is your warning threshold percentage of 20% and 10 your critical threshold of 10%
HTH

/S


#3

That worked, thanks a lot for you help.

Gxr