Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.CVSAUTO Script Help

Status
Not open for further replies.

skimble78

Technical User
Apr 18, 2014
4
US
I need some help.

I have created .cvsauto scripts to run the reports I need daily and dump the data into a .txt file on our SharePoint site. I then created a .bat file to run multiple reports with an appropriate pause (timeout /t 40) between scripts so as not to overwhelm CMS.

I then scheduled these scripts to be run (using Task Scheduler)at a certain time of day when my computer is logged in but not under heavy use.

Each piece of this process has worked independently and as part of the whole process chain.

Here is my issue: The process is very inconsistent. One day the scripts will dump the data and create the .txt files, the next it will not. I have made no changes to anything in this process but each time I run it, I get a different result.

Does anyone have any idea why this would work so inconsistently?
 
On a day that it doesn't run, check the Task Scheduler log and see what it records for the failure to run. Or is the task scheduler claiming it ran?

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
The Tasks are running daily. There are no errors reported. I actually see the command prompt box pop up and run the .bat file. The problem is consistency of the .txt data dump.

The scripts are running but not creating the .txt file. If that makes any sense.
 

Are you running other CMS reports and exceeding the number of open windows?

Can you post one of the .bat and CMS scripts that are failing?

- Stinney
"Scire ubi aliquid invenire possis, ea demum maxima pars eruditionis est"

"To know where to find anything is, after all, the greatest part of education"

 
I built a delay into the .bat file so that there is a 40 second pause between each script. These scripts each take between 10-30 seconds to run, so 40 seconds should be more than enough to prevent me from having too many reports running at once.

Here is the .bat file:(User name has been XXXXed out.)

start C:\Users\XXXXX\Desktop\Test\Monthly\AM.Group.Monthly.Stats.acsauto
timeout /t 40
Start C:\Users\XXXXX\Desktop\Test\Monthly\PM.Group.Monthly.Stats.acsauto
timeout /t 40
Start C:\Users\XXXXX\Desktop\Test\Monthly\Monthly.Interval.acsauto
timeout /t 40
Start C:\Users\XXXXX\Desktop\Test\Monthly\Call.Center.Summ.Monthly.acsauto

Here is a sample script for AM Group Monthly with File pathes replaced with "FilePath)

'LANGUAGE=ENU
'SERVERNAME=SERVERNAME
Public Sub Main()

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: DOIT Daily Stats: Export Data"
'## Parameters.Add "Report: Historical: Designer: DOIT Daily Stats: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\DOIT Daily Stats","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "5085","_Top"
'## Parameters.Add "4545","_Left"
'## Parameters.Add "13875","_Width"
'## Parameters.Add "6975","_Height"
'## Parameters.Add "default","_TimeZone"
'## Parameters.Add "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "Deployment AM","Agent Group"
'## Parameters.Add "-1","Date"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "G0,0,0;0,3,3","data"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "\\FilePath\Daily\AM Group Daily Stats.txt","_Output"
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "False","_Labels"
'## Parameters.Add "True","_DurSecs"

On Error Resume Next

cvsSrv.Reports.ACD = 1
Set Info = cvsSrv.Reports.Reports("Historical\Designer\DOIT Daily Stats")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.Window.Top = 5085
Rep.Window.Left = 4545
Rep.Window.Width = 13875
Rep.Window.Height = 6975


Rep.TimeZone = default


Rep.SetProperty "Agent Group","Deployment AM"

Rep.SetProperty "Date","-1"


Rep.ReportView.Add "G0,0,0;0,3,3","data"



b = Rep.ExportData("\\FilePath\Daily\AM Group Daily Stats.txt"," 9, 0, True, False, True)





Rep.Quit



If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

End If
Set Info = Nothing
'## cvs_cmd_end

End Sub
 
I always had better luck using

b = Rep.SaveHTML("c:\cmsreports\AM Group Daily Stats.txt", True, "")

instead of

b = Rep.ExportData("\\FilePath\Daily\AM Group Daily Stats.txt"," 9, 0, True, False, True)


 
I would speculate that the issue is more likely related to the delay involved in logging in for each individual script. On a day that it fails you should look at task mgr and see how many versions of acsSRV or acsApp are running. Multiple copies mean that the scripts are stepping on top of each other.

If you always run the same four scripts, combine them within the same script file and only log in once for all executions. Don't set your variables to NOTHING until after the last script. You can also eliminate all of the '## comments to improve readability.

So it would be like:

Public Sub Main()

On Error Resume Next

cvsSrv.Reports.ACD = 1

Set Info = cvsSrv.Reports.Reports("Historical\Designer\DOIT Daily Stats")

If Info Is Nothing Then

If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.TimeZone = default
Rep.SetProperty "Agent Group","Deployment AM"
Rep.SetProperty "Date","-1"
Rep.ReportView.Add "G0,0,0;0,3,3","data"
b = Rep.ExportData("\\FilePath\Daily\AM Group Daily Stats.txt"," 9, 0, True, False, True)
Rep.Quit

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If


Set Info = cvsSrv.Reports.Reports("Historical\Designer\DOIT Daily Stats")

If Info Is Nothing Then

If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\DOIT Daily Stats was not found on ACD 1."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.TimeZone = default
Rep.SetProperty "Agent Group","Deployment PM"
Rep.SetProperty "Date","-1"
Rep.ReportView.Add "G0,0,0;0,3,3","data"
b = Rep.ExportData("\\FilePath\Daily\PM Group Daily Stats.txt"," 9, 0, True, False, True)
Rep.Quit

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If

<<etc>>
<<etc>>

End If
Set Info = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top