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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Completing the impossible:) 2

Status
Not open for further replies.

VNS1000

Technical User
Mar 20, 2002
95
GB
So can any of you telecom gurus help some poor chap with his a what seems a herculean task. I need to begin sending a manager text messages to his cell phone in Europe and in the U.S. he needs me to send him our Service Levels each hour of the day and she would like to receive it via text message on his phones. Any ideas?
 
yes we do. I know we can export via scripts on an hourly basis but from there I'd be stuck on how to automate an sms routine to pick the output file.
 
Can you export as a txt file? Can you automate ftp?

Otherwise you will need to automate the reporting (sql statements in shell scripts) on the cms box, schedule it with cron, write a script that will ftp the buggers to an sms service, and then your boss will get his sms's and be happy...and its not that expensive, trust me.

I can help you with that if you need...

...but its quite a workaround

You might also consider paying an enormous amount of money for a package that can do the exact same for you, if you so desire.
 
You may also run into the problem of getting the reports to format properly on their cell phone!

What operating system are you using?

Do you currently send your emails through Outlook?


Let me know, I may be able to help you out as well.


Barry
 
BIS..yes we can export to a text file. FTP isn't my forte but we have guys on my site who could help if I could explain what is to be done. I'm curious about the ftp to sms service so you could explain a little more than would be great.

Mclellan..We are using Windows NT and MS Outlook



Thanks

 
Well...
You basically have the reports run on the cms box. mclellan is right though, you may need to spend some time on the formatting depending on whats needed. Once you have the proper info ion a txt file, you can simply ftp the thing, alongside other information (like to what mobile number). I use a service called clickatell which has been working perfectly - but I am sure there are others out there...
 
Here is a sample .vbs script you can run. I haven't debugged it on other systems, but it works on XP Pro.

Basically you need to save one of your scripts '.cvsauto' from there copy this script and save it as a .vbs file and put it in your windows scheduler to run every hour.

Edit the .vbs file and follow the 'Update This |' message to change the values, i.e. your report name, .cvsauto file you created, your SMTP server, your distribution list etc.

What this script will do is run your .cvsauto file and wait until your output file is created. Once it finds the output file, it will read it into a string variable and send it in an email.

If you want something more refined you could probably try a consulting company out there that could help you. I know offers consulting, as well as a few others.

If this doesn't paste right, give me your email address and I will send you the script file.

Good luck!
Barry

ScriptFile = "test.cvsauto" 'Update this |
ExpectingFile = "d:\temp\skill status.HTML" 'Update this |

Set filesys = CreateObject("Scripting.FileSystemObject")

set oWSHShell = WScript.CreateObject("WScript.Shell")
oWSHShell.Run(ScriptFile) 'CMS Scripting File
If filesys.FileExists(ExpectingFile) Then
'
else
do while 1
if PauseScript() = -1 then
WScript.Quit
else
if filesys.FileExists(ExpectingFile) then
exit do
end if
end if
loop
end if

'Open your html file to be emailed
Dim objFSO, objTS
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTS = objFSO.OpenTextFile("d:\temp\skill status.HTML") 'update here|

'Now, read the contents of the file into a string
Dim FileContents
FileContents = objTS.ReadAll

' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPort = 2

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
.Item(" = cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item(" = "smtp.test.net" 'update here|
.Item(" = 10
.Update
End With

' Build HTML for message body.
' Move the file contents into your message body
strHTML = FileContents

' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = "you@home.com"
.From = "me@home.com"
.Subject = "Statistics Reports"
.HTMLBody = strHTML
'Set iBP = iMsg.AddAttachment("d:\temp\skill status.HTML") 'if you want to send attachments |
.Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

filesys.DeleteFile ExpectingFile,true 'Remove the file after sending it


Function PauseScript

Dim WshShell, BtnCode
Set WshShell = CreateObject("WScript.Shell")
BtnCode = WshShell.Popup("Waiting for 10 seconds", 10, "Press OK to Run Now", 1 + 48)
Select Case BtnCode
case 2 PauseScript = -1
End Select

End Function
 
Oops, change this line

Set objTS = objFSO.OpenTextFile("d:\temp\skill status.HTML") 'update here|

To

Set objTS = objFSO.OpenTextFile(ExpectingFile)


We don't want any hard coded values in there!

Barry

 
BIS & mclellan... thanks for all your help on this. I will have certainly try this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top