check_nt FILEAGE giving unexpected results

Hello,

I’m newly registered but have used this forum as a resource in the past, and now I’m having an issue that has me very confused, so I am looking for any input.

We have run Nagios 1.2 for quite awhile, and are finally upgrading, and I have been converting everything over to Nagios 3.1.2

Most things are working fine, though I have been translating everything from the full command line in the services.cfg file to setting up command definitions, and something seems to be going wrong with the check_nt for fileage:

I created this command:
define command {
command_name check_nt_fileage
command_line $USER1$/check_nt -H $ARG1$ -p $ARG2$ -v FILEAGE -d SHOWALL -l $ARG3$ -w $ARG4$ -c $ARG5$
}

And here is a typical entry in the services.cfg file:
check_command check_nt_fileage!episql0!1248!“c:\InkBlending\BUData_M_Material.txt”!15!60

I have tried different combinations of quotes and single quotes around the filename, but always get back “error: file not found”

I can run this at the command line and it works fine:

/usr/local/nagios/libexec/check_nt -H episql0 -p 1248 -v FILEAGE -d SHOWALL -l “c:\InkBlending\BUData_M_Material.txt” -w 15 -c 60

Returns:
Date: 11/25/2009 3:20:06 PM

But in some instances, it works (sort of), if there is a date variable in the filename, like below, as long as I double-quote each end:
check_command check_nt_fileage!epiceridian0!1248!"“c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\srctime_data\srctime_data_db_date '+%Y%m%d'*.BAK”"!2880!3600

And in this case I get back a green “OK” status, but the status information still says “error: file not found” where I would have expected to see the last update time of the file:
Current Status: OK (for 0d 3h 25m 45s)
Status Information: Error: file not found

I just today updated the plug-ins to 1.4.14 and it makes no difference. Any ideas on what the issue is with passing back the filename to the command would be appreciated.

Allison Andrews
Portland, Oregon, USA

We have the following which works for me

Nagios running on Linux and Windows 2003R2 64bit nsclient

define service{
        use                     generic-service
        hostgroup               all-win-apps,all-win-gw
        service_description     Raw File
        check_command           check_nrpe_file_last_written!d:/data/files/raw/`date +%Y`/`date +%m`\\/`date +%Y%m%d`.fav!10m
        }

define service{
        use                     generic-service
        hostgroup               all-win-apps,all-win-gw
        service_description     Raw I File
        check_command           check_nrpe_file_last_written!d:/data/files/raw/`date +%Y`/`date +%m`\\/`date +%Y%m%d`.I.raw!10m
        }

define service{
        use                     generic-service
        hostgroup               all-win-apps,all-win-gw
        service_description    newstest File
        check_command           check_nrpe_file_last_written!d:/data/files/raw/`date +%Y`/`date +%m`\\/`date +%Y%m%d`.I.newstext!10m

and command has


define command{
        command_name    check_nrpe_file_last_written
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -n -p 5666 -c CheckFile -a file="$ARG1$" filter-written=\>"$ARG2$" syntax="%filename% last updated %write% and size is %size%" MaxWarn=2 MaxCrit=3
        }