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

How can I get informed if crstal aps ever stopped?

Status
Not open for further replies.

takmaz

Technical User
Jun 5, 2002
4
TR
I'd like to find out is there a way to get informed ( by mail ) if any of the crsytal services stopped?
 
Takmaz,

This is possible, but in my experience, you'll need to check out some third party monitoring solutions like Categoric's X-Alert or Netpresenter's Emergency Alert which you can set up to poll the services, and send you an email or sms when something looks a bit screwy.

Naith
 
If you on a Windows platform, you can use Windows Management Instrumentation (WMI) to get a list of running processes. If you don't find 'CrystalAPS.exe' send out an email via SMTP, MAPI, etc. You would have to build this solution yourself, but it would be no cost other than your time.
 
Nice call, Reply.

Keen to find out a little more and test this approach.

<N>
 
I'm not a programmer, I'mlooking for a tool to reach my goal , maybe a service property?
. but I'll check WMI ( this is the first time I heard it :) ).maybe our programmer can arrange me something.thanx for the idea
 
Here you go. VB6 Code. Watch for line wrap.

Private Sub Command1_Click()

'Microsoft WMI Scripting V1.2 Library
'C:\WINDOWS\System32\wbem\wbemdisp.TLB
Dim wmServices As WbemScripting.SWbemServices
Dim wmObjectSet As WbemScripting.SWbemObjectSet
Dim wmObject As WbemScripting.SWbemObject

'Microsoft CDO For Exchange 2000 Library
'C:\Program Files\Common Files\Microsoft Shared\CDO\CDOEX.DLL
Dim Message As CDO.Message

Const SMTP_TO As String = &quot;you@yourcompany.com&quot;
Const SMTP_CC As String = &quot;&quot;
Const SMTP_BCC As String = &quot;&quot;
Const SMTP_SENDER_NAME As String = &quot;Joe Employee&quot;
Const SMTP_SENDER_EMAIL As String = &quot;joe.employee@yourcompany.com&quot;
Const SMTP_FROM_NAME As String = &quot;Joe Employee&quot;
Const SMTP_FROM_EMAIL As String = &quot;joe.employee@yourcompany.com&quot;

Const SMTP_SERVER As String = &quot;smtpserver.yourcompany.com&quot;
Const SMTP_MODE As Long = 2 'CDO.CdoSendUsing.cdoSendUsingPort
Const SMTP_PORT As Long = 25
Const SMTP_AUTHENTICATE As Long = 0 'CDO.CdoProtocolsAuthentication.cdoAnonymous

Dim APSFound As Boolean

Set Message = New CDO.Message
With Message
.To = SMTP_TO
.CC = SMTP_CC
.BCC = SMTP_BCC
.Sender = Chr(34) & SMTP_SENDER_NAME & Chr(34) & &quot; <&quot; & SMTP_SENDER_EMAIL & &quot;>&quot;
.From = Chr(34) & SMTP_FROM_NAME & Chr(34) & &quot; <&quot; & SMTP_FROM_EMAIL & &quot;>&quot;
End With

With Message.Configuration.Fields
.Item(&quot; = SMTP_MODE
.Item(&quot; = SMTP_SERVER
.Item(&quot; = SMTP_PORT
.Item(&quot; = SMTP_AUTHENTICATE
.Update
End With

Set wmServices = GetObject(&quot;winmgmts:{impersonationLevel=impersonate,(Debug)}&quot;)
Set wmObjectSet = wmServices.InstancesOf(&quot;Win32_process&quot;)

For Each wmObject In wmObjectSet
If wmObject.Name = &quot;CrystalAPS.exe&quot; Then
APSFound = True
Exit For
End If
Next

Message.Subject = &quot;Automated Crystal Enterprise Alert Notification&quot;
If APSFound = True Then
Message.TextBody = &quot;CrystalAPS.exe was found to be running at &quot; & Now
Else
Message.TextBody = &quot;CrystalAPS.exe was not found to be running at &quot; & Now
End If
Message.Send

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top