Negate-Problem

Hello!
I have a problem with the command-definition of “negate”.
When I execute negate on localhost, then it works:

[code]/usr/local/nagios/libexec # ./check_file_age -C 3000000 -f /var/log/messages
FILE_AGE OK: /var/log/messages is 15 seconds old and 3558401 bytes
/usr/local/nagios/libexec

echo $?

0
usr/local/nagios/libexec# ./negate /usr/local/nagios/libexec/check_file_age -C 3000000 -f /var/log/messages
FILE_AGE OK: /var/log/messages is 20 seconds old and 3558401 bytes
/usr/local/nagios/libexec # echo $?
2
[/code]

I want to check the messageslog on the nagios-server. check_file_age gives a OK-return, when the size of a file is less than the Critical-size of 3000000 Byte.
But I want to reverse that, so that I get a OK-return ,when thi file-size is under 3000000Byte limit.

My service- and command- definition:

define service{
        use                       grundstruktur-service        
        host_name                 localhost
        service_description      Check messages-log
        check_command             check_messages-log
        }

define command{
        command_name    check_messages-log
        command_line    $USER1$/nagate $USER1$/check_file_age -C 3000000 -f /var/log/messages
        }

But when I use nagate in my command definition, then I get a warning like:

Do you have a solution for me?

I have the solution:
It is dependent on the permissions of the plugins.
So, I have to change the permissions of “negate” and "check_file_age ".

chown root.nagios nagate check_file_age

… and everything runs…