0

I am trying to figure out one problem, but I am struggling to find a viable solution. The issue is probably more about theory then about implementation. I simply need some other points of view.

The problem is:

We are using Navision Application Servers (NAS) which run some sort of business logic, replications, XML handling and stuff via Reports and Codeunits. At times some of these jobs get stuck in a loop or on deadlock etc.

The ideal solution would be to fix issues in the Codeunits and Reports so they can handle their own problems; But this is not an option. I don't really have access to the code of these jobs.

I am trying to find a way how at least partially automate detection of these problems. Only way I can think of is to store some resource consumption statistics (CPU, SQL CPU and I/O, perhaps an idle time) for each job and compare it during the next run. If there will be some major differences it would trigger an alarm.

If job which takes 4 hours to complete, get stuck at start of the process, I would like to know that in reasonable time, not after 6 hours when is it obvious.

I have full access to SQL server, NAS server and it's process. I am using C# with .NET 4

Thank you.

  • I can only imagine that you can use your access to SQL Server to check if a specific Table has new records? – pungggi Nov 15 '13 at 19:35
  • That is one option. But not all of the Jobs are changing some table data. Some of them are just reading. – Ondřej Fitzek Nov 18 '13 at 08:11
  • I think you must go with your solution of store some resource consumption statistics (CPU, SQL CPU and I/O, perhaps an idle time) – pungggi Nov 20 '13 at 18:14
  • Sadly without access to the C/AL code being executed I fear your mentioned solution is about all you can do. If you could even edit the codeunit that the NAS runs you'd have many more options, but otherwise you're kind of stuck. – WiredWiz Dec 12 '13 at 20:41
  • Well, I have access to codeunits which are part of Job Queue processing (1,448,449). If you mean those, what options you was talking about? – Ondřej Fitzek Dec 25 '13 at 17:29

1 Answers1

0

Given that you have access to some of the codeunits, you would also need a free table to use in your Navision installation for this solution. You could create a log table that has a primary key of type int, set as an autonumber and throughout your process insert a record into the table with a timestamp. After that you would want to call FINDFIRST on that log table to force your inserted record to write to the SQL transaction log. You could then monitor that table with an outside process and if the last record timestamp is longer than a certain threshold (probably something like 30 minutes) you could send an email or however you wish to alert yourself. You would probably want to empty this table before each run to avoid bloating your database with unneeded records. Alternatively, instead of using a table you could simply write a file to disk and repeatedly touch the file through your process code, thus updating the last modified date of the file. Then your monitoring tool could check the last modified date of the file in the same fashion and send an alert if it goes untouched for too long while the process is still running.

WiredWiz
  • 646
  • 8
  • 18