NetXMS Support Forum

English Support => General Support => Topic started by: redro on July 14, 2010, 06:22:18 PM

Title: Stuck file Agent
Post by: redro on July 14, 2010, 06:22:18 PM
Hi All,

I am very new to NetXMS. Here is my requirement : I want to monitor for a .txt file should not stuck more than 15 min in c:/tmp folder.
For that which Agent Parameter i have to choose
Please suggest me.
Thanks.
JP
Title: Re: Stuck file Agent
Post by: Victor Kirhenshtein on July 15, 2010, 02:18:47 AM
Hi!

Yo can use File.Count parameter. Full syntax is following:

File.Count(path, pattern, recursive, size, age)

where


pathpath to directory or file to check
patternpattern for file name matching
recursiverecursion flag; if set to 1 or true, agent will scan subdirectories
sizesize filter (bytes); if < 0, only files with size less than abs(value) will match; if > 0, only files with size greater than value will match; if 0, all files will match
ageage filter (seconds); if < 0, only files created after now - abs(value) will match; if > 0, only files created before now - value will match; if 0, all files will match

path argument is mandatory, all other are optional.

So, to count number of .txt files older than 15 minutes in c:\tmp, you can use

File.Count('C:\tmp', '*.txt', 0, 0, 900)

And after that you just need to set threshold for this parameter to >0, generate appropriate event, and process it as usual.

Best regards,
Victor
Title: Re: Stuck file Agent
Post by: redro on July 15, 2010, 03:27:33 PM
Victor,

Great help, how ever i am looking for Error in Tomcat log file. basically tomcat will write the log on console. I have tried with several agents but no luck. Could you please don't hesitate to assist me.

And i am not able to understand threshold theory, i have gone through the user manual and google search too. If you have any information on the same please help me.

Thanks,
JP.
Title: Re: Stuck file Agent
Post by: redro on July 28, 2010, 05:04:19 PM
Hi Victor,

As per your suggestions i have created txt file monitoring by parameter as 'Temp\','SAS*.txt',true,>0,90 And threshold screen shot is attached. Today what i have observed is there is one file sit from 2 days but i didn't get alarm and i have created totally 5 DCIs all are connected to SYS_THRESHOLD_REACHED. But When ever the process down i am getting only Java process Alarm Remaining are not. Please advise me and confirm me like we have to choose different Threshold for every DCI.

Thanks,
JP
Title: Re: Stuck file Agent
Post by: Victor Kirhenshtein on July 28, 2010, 07:24:03 PM
First of all, you have to specify full path, not just Temp. Second, you have syntax errors in recursion and size parameters - you should use only digits here. So, parameter should looks like

File.Count('C:\Temp', 'SAS*.txt', 1, 0, 90)

to count number of files older than 90 seconds.

Then, threshold by itself looks correct, but did you create appropriate rule in event processing policy?

Also, take a look at this step-by-step configuration example: https://www.netxms.org/documentation/confexample/ (https://www.netxms.org/documentation/confexample/). It's quite old, and screens  will look a bit different, but you should get an idea.

Best regards,
Victor