Problem using check_file_age
Problem using check_file_age
Hi,
I'm trying to monitor some log files on a windows server and to test it I simply created a service entry with the path c:\test.txt to monitor the age of the text file but regardless of how I try to write the path it doesn't register the \ and I get this error : FILE_AGE CRITICAL: File not found - c:test.txt
I tried every way I could think of. I tried c:\\test.txt "c:\test.txt" etc.
I'm running nagios core 3.5
This the Service entry I created :
define service{
use generic-service
host_name (matchinename)
service_description File Age
check_command check_file_age! -w 1 -f c:\test.txt
servicegroups file_age
}
I'm trying to monitor some log files on a windows server and to test it I simply created a service entry with the path c:\test.txt to monitor the age of the text file but regardless of how I try to write the path it doesn't register the \ and I get this error : FILE_AGE CRITICAL: File not found - c:test.txt
I tried every way I could think of. I tried c:\\test.txt "c:\test.txt" etc.
I'm running nagios core 3.5
This the Service entry I created :
define service{
use generic-service
host_name (matchinename)
service_description File Age
check_command check_file_age! -w 1 -f c:\test.txt
servicegroups file_age
}
Re: Problem using check_file_age
Can you post the command definition for check_file_age? Are you checking this with nrpe or nsclient?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Problem using check_file_age
Thank you for replying
I use nsclient
define command{
command_name check_file_age
command_line $USER1$/check_file_age -W $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$ -f $ARG5$
}
I use nsclient
define command{
command_name check_file_age
command_line $USER1$/check_file_age -W $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$ -f $ARG5$
}
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Problem using check_file_age
It sounds like you are trying to check a windows system, but you forgot to add a (-H $HOSTADDRESS$) definition, make the following change:
As for the doubled up warning and critical definitions and one being capital the other being lowercase, is this intentional? I'm not sure if the plugin will take that.
Code: Select all
command_line $USER1$/check_file_age -H $HOSTADDRESS$ -W $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$ -f $ARG5$Re: Problem using check_file_age
I added the -H $HOSTADDRESS$ in the command definition and I still get the file not found the problem seems to be that nagios don't register the backslashes even if I but 2 to the path is c:test.txt instead of c:\test.txt
The lower and upper case w and c is intentional, the lower and upper case make the difference between sending an alert for a file older than X or a file younger than X.
The lower and upper case w and c is intentional, the lower and upper case make the difference between sending an alert for a file older than X or a file younger than X.
Last edited by Dj_Fusion on Fri Mar 07, 2014 10:49 am, edited 2 times in total.
Re: Problem using check_file_age
If you use nsclient, you will need to use a check_nt command, or more likely you will have to configure nsclient for nrpe connections and check through nrpe. check_file_age will have to be configured in your nsclient config as an external script.
Is check_file_age a windows binary?
Is check_file_age a windows binary?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Problem using check_file_age
It worked by use check_nt! FILEAGE but the problem is that I receive a notification when the file is older then the parameter. Do someone know how to make it so it send a notification when the file younger than the parameter ??
Thanks
Thanks
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Problem using check_file_age
How did you define your warning and critical thresholds? Are they in line with what the plugin's help output has as an example? Also, did you set up your alert settings on the service properly? It would probably help to see that service definition again.
Re: Problem using check_file_age
define service{
use generic-service
host_name servername
service_description test.txt
check_command check_nt! FILEAGE -l "c:\\test.txt"! -w 300 -c 600
servicegroups file_age
}
It work fine but instead of sending alerts when the file is younger it send alerts is older. Do someone familiar with check_nt know how to reverse it ?
use generic-service
host_name servername
service_description test.txt
check_command check_nt! FILEAGE -l "c:\\test.txt"! -w 300 -c 600
servicegroups file_age
}
It work fine but instead of sending alerts when the file is younger it send alerts is older. Do someone familiar with check_nt know how to reverse it ?
Re: Problem using check_file_age
Found it ! I had to reverse the critical and warning value !
Thank you all for your help !
Thank you all for your help !