I tested this on a 2008R2 DC and it worked.jdalrymple wrote:What was wrong with my command?
jdalrymple wrote:./check_nrpe -H <host> -c check_files -a 'file=C:\\windows\\system32\\dns\\cache.dns' 'critical=written>-600s'
Check file modification date timestamp
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Check file modification date timestamp
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Check file modification date timestamp
Here is what the nsclient.log file shows.
I don't have any such directory on D: and everything was installed under C:\Program Files (x86)\NSClient++ any thoughts on how I could change that pathing or how it even got D:\source?
Code: Select all
2015-10-13 07:30:13: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns\\cache.dns
2015-10-13 07:30:13: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!
2015-10-13 07:32:25: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns
2015-10-13 07:32:25: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!
2015-10-13 07:33:29: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns
2015-10-13 07:33:29: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!
2015-10-13 07:33:35: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns
2015-10-13 07:33:35: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!
2015-10-13 07:33:38: error:D:\source\nscp\include\socket/connection.hpp:149: Failed to send data: The file handle supplied is not valid
2015-10-13 07:34:35: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns
2015-10-13 07:34:35: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check file modification date timestamp
Not a clue. This wouldn't be the first time I've had to uninstall and reinstall NSCP to make it behave. Any possibility of doing that on this machine?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Check file modification date timestamp
NSClient++ does some funky internal stuff, the D: is normal in the logs.
Just out of curiosity, can you:
Stop NSClient++
Delete the log file
Start NSClient++
Execute the ./check_nrpe command
Show us the exact command executed and the output
Show us the contents of the log file please.
Just out of curiosity, can you:
Stop NSClient++
Delete the log file
Start NSClient++
Execute the ./check_nrpe command
Show us the exact command executed and the output
Show us the contents of the log file please.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Check file modification date timestamp
Code: Select all
./check_nrpe -H <host> -c check_files -a 'file=C:\\windows\\system32\\dns\\cache.dns' 'critical=written>-600s'
No files found
Code: Select all
2015-10-16 06:58:42: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: Invalid file specified: C:\\windows\\system32\\dns\\cache.dns
2015-10-16 06:58:42: error:D:\source\nscp\modules\CheckDisk\file_finder.cpp:95: File was NOT found!Re: Check file modification date timestamp
jkinning, did you forget to upload the log file after running the commands as suggested by Box293?Show us the contents of the log file please.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Check file modification date timestamp
I can upload the log file but it was exactly copied in the thread above.
Ran this command
Ran this command
Code: Select all
./check_nrpe -H <host> -c check_files -a 'file=C:\\windows\\system32\\dns\\cache.dns' 'critical=written>-600s'
No files found
./check_nrpe -H <host> -c check_files -a 'file=C:\\windows\\system32\\dns\\cache.dns' 'critical=written>-600s'
No files found
You do not have the required permissions to view the files attached to this post.
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Check file modification date timestamp
So I was stumped on page 2, it's just getting worse.
I want to try to lab it mimicking your environment as closely as I can. I know your NSCP version, I don't think I know your version of Windows.
Additionally have you posted this on the developer's forum? He might be interested. He fixes things when they break
https://forums.nsclient.org/
I want to try to lab it mimicking your environment as closely as I can. I know your NSCP version, I don't think I know your version of Windows.
Additionally have you posted this on the developer's forum? He might be interested. He fixes things when they break
https://forums.nsclient.org/
Re: Check file modification date timestamp
I have posted on that forum
I am running Windows 2008R2.
I ran these commands on different directories
Code: Select all
https://forums.nsclient.org/t/check-file-modification-time-on-windows-server/3874I ran these commands on different directories
Code: Select all
check_nrpe -H <host> -c check_files -a 'file=C:\\gpo.txt' 'critical=written>-600s'
OK: All 1 files are ok|'gpo.txt_written'=1310932869;0;1445257099
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\bootstat.dat' 'critical=written>-600s'
OK: All 1 files are ok|'bootstat.dat_written'=1442758207;0;1445257128
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\System32\\adprop.dll' 'critical=written>-600s'
OK: All 1 files are ok|'adprop.dll_written'=1290241084;0;1445257159
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\System32\\dns\\CACHE.DNS' 'critical=written>-600s'
No files found
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\System32\\dns\\ws.txt' 'critical=written>-600s'
No files found
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\System32\\drivers\\acpi.sys' 'critical=written>-600s'
No files found
check_nrpe -H <host> -c check_files -a 'file=C:\\Windows\\System32\\drivers\\etc\hosts' 'critical=written>-600s'
OK: All 1 files are ok|'hosts_written'=1244667626;0;1445257329- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Check file modification date timestamp
When you look at the C:\Windows\System32\dns directory file permissions, does the SYSTEM account have full control?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.