I have a script that I run every x minutes that does three things:
1. Send an Alert if files received are not being processed
2. Send an Alert if no files received for x amount of time
3. Display statistical data onto a basic website (http://www.itslonline.com/DropStats.html)
I have it all working, but I was wandering if someone could tell me whether there is an easy way to turn my data into a line graph showing the last 24 hours of data history??
Code: Select all
//Count the Files in the drop directory
Label>Start
CountFiles>v:\*.txt,txtcount,1
Wait>3
//Check the result of files that are backlog
Let>A=%txtcount%
Let>B=1000
Let>C=4999
Let>D=20000
GetDate>date
GetTime>time
IF>{%A%>%B%}
IF>{%A%>%D%}
Message>SEVERE BACKLOG!!%CRLF%There are more than %D% files in the NZ/AU drop Directory.%CRLF%Currently %A% files are waiting to be processed.%CRLF%Please check the server ASAP!!!!
Let>SENDMAIL_STATUS=1
Let>subject=ITSWEB is Experiencing a Severe BACKLOG (NZ/AU)!!!
Let>me=ezicom
Let>myname=EziComAutoAlert
Let>recipients=EziComAlerts
Let>body=SEVERE BACKLOG!!%CRLF%%A% Files are in the drop directory.%CRLF%This is above the %D% file threshold.%CRLF%Please check the server ASAP!!!%CRLF%%CRLF%...%CRLF%%CRLF%Notify concerned parties that we are experiencing a backlog.
SMTPSendMail>recipients,serveragent,me,myname,subject,body,
GoTo>END1
ELSE>
Message>There are more than %B% emails in the NZ/AU drop Directory.%CRLF%Currently %A% files are waiting to be processed.%CRLF%Please check the server ASAP!!!!
Let>SENDMAIL_STATUS=1
Let>subject=Experiencing a BACKLOG NZ/AU!!!
Let>me=ezicom
Let>myname=EziComAutoAlert
Let>recipients=EziComAlerts
Let>body SERVER ITS %crlf%There are more than %B% files in the NZ/AU drop Directory.%CRLF%Currently %A% files are waiting to be processed.%CRLF%Please check the server ASAP!!!!%CRLF% %CRLF%This check is done every 8 minutes so please ignore if you have read already.%CRLF% Check message forwarding is ok or allow time for backlog to clear %CRLF%%CRLF%Click here for the history http://www.itslonline.com/DropStats.html %CRLF%This is an automated email, please do not reply.
SMTPSendMail>recipients,agent,me,myname,subject,body,
GoTo>END1
ENDIF>
ELSE>
Message>There are less than %B% files in the NZ/AU drop Directory so things are OK.%CRLF%Currently %A% files are waiting to be processed.
//Mail Drop Directory Inspecter
Let>Looptimes=100
Let>Counter=0
Label>StartLoop
CountFiles>V:\*.txt,txt_count,1
Wait>1
Let>X=%txt_count%
Let>Z=0
IF>{%X%=%Z%}
Add>Counter,1
Message>Scanning NZ/AU Drop Directory%CRLF%There are %txt_count% files in the folder%CRLF%Scan Number:%counter%%CRLF%!!System NOT OK!!%CRLF%There are no Emails %CRLF%coming through to WEB from DPS
ELSE
Message>Scanning NZ/AU Drop Directory%CRLF%There are %txt_count% files in folder%CRLF%Scan Number:%counter%%CRLF%System IS OK!%CRLF%Emails are coming through to WEB
GoTo>END1
EndIF
If>Counter=Looptimes,End
GoTo>StartLoop
Label>End
Message>CHECK WITH DPS - No mail for last 100 seconds
Let>SENDMAIL_STATUS=1
Let>subject=Datacom ITSWEBServer is NOT RECEIVING DATA FROM DPS for NZ/AU!!!
Let>me=ezicom
Let>myname=EziComAutoAlert
Let>recipients=EziComAlerts Let>body=SERVER ITS WEB crlf%NO Data has been forwarded to EziCom for 100 seconds from DIPS%CRLF%Please check for delays and if necessary contact DIPS %CRLF% %CRLF%This is an automated email, please do not reply.
SMTPSendMail>recipients,itsagentserver,me,myname,subject,body,
ENDIF>
Wait>4
Label>END1
[b]WriteLn>S:\WEBStats.html,result,%date%,%time%,Filecount = %A%,[/b]
Wait>2
[b]WriteLn>C:\Documents and Settings\Administrator\My Documents\Macro Scheduler\Logs\WEBStats.txt,result,%date%,%time%,%A%,[/b]
http://www.itslonline.com/DropStats.html