Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline RJK  
#1 Posted : Friday, September 19, 2014 5:13:06 AM(UTC)
RJK

Rank: No customer

Joined: 8/11/2014(UTC)
Posts: 6
United States
Location: MISSOURI, KANSAS CITY

Thanks: 1 times
Code:
public Server s = null;
private Client c = null;
public void vc_Export()
{
	s = getVC_Connection();
	if (s != null)
	{
		if (s.Connected)
		{
			List<JobClass> allJobs;
			allJobs = s.Jobs.GetAll();
			s.Log.GetAll();
			foreach (JobClass j in allJobs)
			{
				JobLogs = new StringBuilder();
				if (j.Stats.Active == true && ExportLogs == true)
				{
					List<LogJobHistoryClass> Logs = 
						s.Log.GetJobHistory(j.Id.ToString(), logStart, logEnd);
					Logs.ForEach(delegate(LogJobHistoryClass l)
					{
						JobLogs.Append(
							 j.Id.ToString() +
							 "|Job|" +
							 l.ExecutionId.ToString() + "|" +
							 l.Started.ToShortDateString() + "|" +
							 l.Started.ToLongTimeString() + "|" +
							 l.ExitCode.ToString() + "|" +
							 l.ExitCodeResult.ToString() +
							 "|Job|" +
							 l.ExecutionTime.ToString() + "\n");
					});
					logFile.Write(JobLogs.ToString());
				}
				TaskLogs = new StringBuilder();
				foreach (TaskClass t in j.Tasks)
				{
					if (j.Stats.Active == true && ExportLogs == true)
					{
						List<LogTaskHistoryClass> t_Logs = 
							s.Log.GetTaskHistory(t.Id, logStart, logEnd);
						t_Logs.ForEach(delegate(LogTaskHistoryClass tl)
						{
							TaskLogs.Append(
								j.Id.ToString() + "|" + 
								t.Id.ToString() + "|" + 
								tl.ExecutionId.ToString() + "|" + 
								tl.Started.ToShortDateString() + "|" +
								tl.Started.ToLongTimeString() + "|" + 
								tl.ExitCode.ToString() + "|" + 
								tl.ExitCodeResult.ToString() + "|" + 
								(tl.HasStandardError == true ? "ERROR|" : "|") + 
								tl.ExecutionTime.ToString() + "\n");
						});
					}
				} //End Foreach Tasks
				t_logFile.Write(TaskLogs.ToString());
			}//End Foreach Jobs
		}
	}
}


I was able to run the above code yesterday and get data for both jobs and tasks.
Today when I ran this, it only exported job history, not task history.

Is there a bug, or do I need to "load" logs or something for this to work?

We are using ver 7.1.7.

Edited by user Friday, September 19, 2014 5:17:21 AM(UTC)  | Reason: Not specified

Offline Support  
#2 Posted : Friday, September 19, 2014 8:14:06 AM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,431

Thanks: 575 times
Was thanked: 326 time(s) in 314 post(s)
You might have some limitations in Server settings->Log->Database. By default we only store the last 2000 rows and if you have many Jobs and Tasks this is quickly rotated.
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline RJK  
#3 Posted : Friday, September 19, 2014 3:11:00 PM(UTC)
RJK

Rank: No customer

Joined: 8/11/2014(UTC)
Posts: 6
United States
Location: MISSOURI, KANSAS CITY

Thanks: 1 times
Originally Posted by: Support Go to Quoted Post
You might have some limitations in Server settings->Log->Database. By default we only store the last 2000 rows and if you have many Jobs and Tasks this is quickly rotated.


Thank you Henrik.

Can you tell me how the setting works. If i dynamically change the value when I connect and reset it back to 2000 before I disconnect, would that work?

We have 1000+ jobs on this server and we have to reboot it once a month due to memory leak issues. Increasing this value and having to keep it at a high value, may cause even further issues Im afraid.

This is a completely different question about the Server. In the client app under Server->Server Info, does the Clear Memory button flush the entire "Servers" memory and force a reload?

Could this command be used in tandem with the Log Rows to extract logs?

With this many jobs and many using DateTime triggers its tough to get a "view" of the overall performance, and identify areas of improvement.
Offline Support  
#4 Posted : Friday, September 19, 2014 3:25:57 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,431

Thanks: 575 times
Was thanked: 326 time(s) in 314 post(s)
No, this is the value of items to store. So if you reset it back when you disconnect you will not find "old" entries later - next time you connect. But perhaps I misunderstood you.

Regarding memory issues I recommend that you use the latest 7.2.1. version. We flush memory more often and have more debugging. Let me know if you still experience issues with that one.
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline RJK  
#5 Posted : Friday, September 19, 2014 3:34:46 PM(UTC)
RJK

Rank: No customer

Joined: 8/11/2014(UTC)
Posts: 6
United States
Location: MISSOURI, KANSAS CITY

Thanks: 1 times
I checked my Log Settings, They are all set to 20000, with the exception of Audit Log, those are set to 2000.

When it displays range for Tasks it states (09/18-09/19) Total rows 11681. Keep a maximum of 20000 is checked, and delete rows older than 30 days is checked as well.

Based on these settings I should of had Task level data for yesterday 9/17 but was not able to ever pull any, at any point in the day (tried several times in morning and through out the day).

Can I see in a log file somewhere, when this gets purged with stats of how many rows it purged and possibly the date range?

We are installing the update to fix the memory issues this weekend. We will keep you posted on its results.

Thanks for your help and assistance Henrik,
RJK
RJK attached the following image(s):
LogSetting.png
Offline Support  
#6 Posted : Monday, October 6, 2014 12:06:59 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,431

Thanks: 575 times
Was thanked: 326 time(s) in 314 post(s)
Could be something about the time you supply. Do you see the rows in the Client?
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.064 seconds.
Scroll to Top