NRDS+Check TXT

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

NRDS+Check TXT

Post by sarpione »

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
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NRDS+Check TXT

Post by avandemore »

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.
Previous Nagios employee
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: NRDS+Check TXT

Post by sarpione »

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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDS+Check TXT

Post by tgriep »

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.

Code: Select all

C:\Program Files\Nagios\NRDS_Win\plugins
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)

Code: Select all

command[File_Age] = $PLUGIN_DIR$\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","name match file.txt" --critical 0
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: NRDS+Check TXT

Post by sarpione »

thx for the answer
i tested it and i have this error
Image

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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDS+Check TXT

Post by tgriep »

You are missing the "name match" from the filter option.
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 0
to

Code: Select all

command[File_Age] = .\plugins\check_winfile.exe --target="c:\temp" --filter "age lt -10 minutes","name match datos.txt" --critical 0
And that should work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarpione
Posts: 49
Joined: Fri Oct 14, 2016 10:02 am

Re: NRDS+Check TXT

Post by sarpione »

You are a GENIUS!
Thank you very much!
It works perfectly.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDS+Check TXT

Post by tgriep »

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!
Locked