Check file age
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check file age
The line specified above by Box293 would be in your service definition (the check_command directive) on your Nagios server.
Re: Check file age
Sorry for my noob questions
but should i set it in nrpe.cfg, command.cfg? I tried that but nagios -v gave me an error.
but should i set it in nrpe.cfg, command.cfg? I tried that but nagios -v gave me an error.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check file age
Service definition
It can be in any of the .cfg files, but typically it will be named after the host for which the service belongs.
You might have a file called windowshost.cfg that looks something like this:
It can be in any of the .cfg files, but typically it will be named after the host for which the service belongs.
You might have a file called windowshost.cfg that looks something like this:
Code: Select all
define host {
host_name windowsbox
address 192.168.1.100
...
}
define service {
host_name windowsbox
service_description monitor_logfile
check_command check_nrpe!CheckFiles!-a path='D:\\Important Stuff\\Important File.txt' 'filter=written < -2h' 'master-syntax={%total% Files Found}' MaxCrit=1
...
}
Re: Check file age
Thank you jdalrymple,
ok, I got it running withou an error, it shows up in the Nagios webinterface, but I get an "Missing argument(s)."
any idea what arguments are missing?
ok, I got it running withou an error, it shows up in the Nagios webinterface, but I get an "Missing argument(s)."
any idea what arguments are missing?
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check file age
Let's browse out to the command expansion in the web UI:
System --> Configuration
Choose Services under Object Type --> Continue
Locate your service and click on the hyperlink under the 'Check Command' column
Screenshot that page and shoot it our way, I've attached an example that it should look somewhat similar to.
System --> Configuration
Choose Services under Object Type --> Continue
Locate your service and click on the hyperlink under the 'Check Command' column
Screenshot that page and shoot it our way, I've attached an example that it should look somewhat similar to.