Hi ppl
I need help again of course haha
I got Nagios XI and i need to check a windows 7 host, there is the situation:
One program create a file named "Datos.txt", this file only have to exist 2-3minutes then automatically is deleted, but sometimes (i dont know why) give an error and its not deleted.
Well i need to check if Datos.txt exist more than 5 minutes for example. pls tell me what plugin i need to use and the command to type.
PLUS: If its possible in case that Datos.txt exist more than 10 minutes delete it and report me.
thx a lot
NRDS+Check TXT
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: NRDS+Check TXT
I believe you were referred earlier to NRPE and NSClient. Have you looked at this plugin?
https://exchange.nagios.org/directory/P ... bs/details
https://exchange.nagios.org/ is a collection of community plugins which are provided as-is. If that plugin or one of the others doesn't work for you, you can refer to this:
https://docs.nsclient.org/reference/win ... heck_files
https://support.nagios.com/forum/viewto ... =7&t=33591
Please remember we don't write or maintain NSClient so NSClient questions are best answered by them.
https://exchange.nagios.org/directory/P ... bs/details
https://exchange.nagios.org/ is a collection of community plugins which are provided as-is. If that plugin or one of the others doesn't work for you, you can refer to this:
https://docs.nsclient.org/reference/win ... heck_files
https://support.nagios.com/forum/viewto ... =7&t=33591
Please remember we don't write or maintain NSClient so NSClient questions are best answered by them.
Previous Nagios employee
Re: NRDS+Check TXT
Thx for the answer i checked the links, but i dont use NSClient, i use NRDS client, because of that i need a plugin to load in the NRDS and configure the command in the "Config,ini".
These 2 things i dosent know, what plugin have to use and the command i need to type.
These 2 things i dosent know, what plugin have to use and the command i need to type.
Re: NRDS+Check TXT
To use NRDS, go to this link
https://itefix.net/check_winfile
Download the check_winfile.exe file and put it in this folder in the Windows server.
Add the following command to your C:\Program Files\Nagios\NRDS_Win\config.ini file adjusting the target path and the name of the file (file.txt)
The above example if the file exists and is over 10 minutes old,set a critical alert.
Try that and post if you have any questions.
https://itefix.net/check_winfile
Download the check_winfile.exe file and put it in this folder in the Windows server.
Code: Select all
C:\Program Files\Nagios\NRDS_Win\plugins
Code: Select all
command[File_Age] = $PLUGIN_DIR$\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","name match file.txt" --critical 0Try that and post if you have any questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDS+Check TXT
thx for the answer
i tested it and i have this error

i create a folder in C: named "temp" and datos.txt inside and i paste check_winfile.exe in the nagios plugin folder
then in the config.ini i type this:
command[File_Age] = .\plugins\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","datos.txt" --critical 0
i tested it and i have this error
i create a folder in C: named "temp" and datos.txt inside and i paste check_winfile.exe in the nagios plugin folder
then in the config.ini i type this:
command[File_Age] = .\plugins\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","datos.txt" --critical 0
Re: NRDS+Check TXT
You are missing the "name match" from the filter option.
Edit the config.ini file and chnage the command from
to
And that should work for you.
Edit the config.ini file and chnage the command from
Code: Select all
command[File_Age] = .\plugins\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","datos.txt" --critical 0Code: Select all
command[File_Age] = .\plugins\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","name match datos.txt" --critical 0Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDS+Check TXT
You are a GENIUS!
Thank you very much!
It works perfectly.
Thank you very much!
It works perfectly.
Re: NRDS+Check TXT
Your welcome. I'll close the post as solved but if you have any other questions, feel free to open a new post.
Be sure to check out our Knowledgebase for helpful articles and solutions!