<div>
<p>Thanks Scott.
I’m grateful for sharing.
The one thing I don’t follow is the references to “PartService3â€.
I haven’t coded a project to reference Epicor Web Services before and I didn’t see the reference defined anywhere in your code.
Are you adding a reference to your project for this? If yes, what are you adding to the project?
Joe Rojas | Director of Information Technology | Mats Inc
dir:
781-573-0291 | cell:
781-408-9278 | fax:
781-232-5191
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... |
www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring
[cid:427aa2.png@99a1b691.47a65ede]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
From:
vantage@yahoogroups.com [mailto:
vantage@yahoogroups.com]
Sent: Friday, October 24, 2014 9:18 AM
To:
vantage@yahoogroups.com
Subject: Re: [Vantage] RE: Monitor if E9 is running
Sure thing. See below. Scott
/////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Threading;
namespace EpicorPinger
{
public partial class EpicorPingerSvc : ServiceBase
{
private System.Timers.Timer timer;
public EpicorPingerSvc()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
this.timer = new System.Timers.Timer(60000D);
this.timer.AutoReset = true;
this.timer.Elapsed += new System.Timers.ElapsedEventHandler(this.timer_Elapsed);
this.timer.Start();
}
protected override void OnStop()
{
this.timer.Stop();
this.timer = null;
}
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
CallWebService();
}
private void CallWebService()
{
string xCompany = "WiTronix";
string xPart = "1000XXXXX";
string sSource = "EpicorPinger";
string sLog = "Application";
string badEvent = "Webservice call responded false - FAIL";
string noEvent = "Webservice call timeout - FAIL - ";
string goodEvent = "Webservice call responded true - Success";
try
{
this.timer.Stop();
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
//Trust all certificates
System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
PartService3.PartServiceClient _parts = new PartService3.PartServiceClient();
PartService3.CallContextDataSetType _partsCallContext = new PartService3.CallContextDataSetType();
PartService3.CallContextDataSetType _partsCallContextout = new PartService3.CallContextDataSetType();
_parts.ClientCredentials.UserName.UserName = "EpicorSync";
_parts.ClientCredentials.UserName.Password = "************";
if (_parts.PartExists(xCompany, xPart, _partsCallContext, out _partsCallContextout) == false)
{
EventLog.WriteEntry(sSource, badEvent, EventLogEntryType.Warning, 44444);
}
else
{
EventLog.WriteEntry(sSource, goodEvent);
}
}
catch (Exception e)
{
noEvent = noEvent + e;
EventLog.WriteEntry(sSource, noEvent, EventLogEntryType.Warning, 44444);
}
finally
{
this.timer.Start();
}
}
}
}
On Fri, Oct 24, 2014 at 7:54 AM, Joe Rojas
jrojas@...<mailto:
jrojas@...> [vantage] <
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>> wrote:
Hi Scott,
Would you be able to share the code for the windows service you created?
I was thinking of something similar.
Joe Rojas | Director of Information Technology | Mats Inc
dir:
781-573-0291<tel:
781-573-0291> | cell:
781-408-9278<tel:
781-408-9278> | fax:
781-232-5191<tel:
781-232-5191>
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@...<mailto:
jrojas@...> |
www.matsinc.com<
http://www.matsinc.com>
Ask us about our clean, green and beautiful matting and flooring
[cid:fa6fda.png@57625b51.46aa6adf]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
From:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com> [mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>]
Sent: Thursday, October 23, 2014 8:20 PM
To:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>
Subject: Re: [Vantage] RE: Monitor if E9 is running
We use WhatsUpGold to monitor everything. It was a little tricky to setup for Epicor. I had to create a simple windows service that calls an Epicor web service and write the status to the event log.
Scott
On Thu, Oct 23, 2014 at 4:04 PM, Joe Rojas
jrojas@...<mailto:
jrojas@...><mailto:
jrojas@...<mailto:
jrojas@...>> [vantage] <
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>>> wrote:
We have that.
The physical server came back up without issue but Epicor 9 did not start up properly.
Joe Rojas | Director of Information Technology | Mats Inc
dir:
781-573-0291<tel:
781-573-0291><tel:
781-573-0291<tel:781-573-0291>> | cell: 781-408-9278<tel:781-408-9278><tel:781-408-9278<tel:781-408-9278>> | fax: 781-232-5191<tel:781-232-5191><tel:781-232-5191<tel:781-232-5191>>
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@...<mailto:
jrojas@...><mailto:
jrojas@...<mailto:
jrojas@...>> |
www.matsinc.com<
http://www.matsinc.com><
http://www.matsinc.com>
Ask us about our clean, green and beautiful matting and flooring
[cid:aef3f3.png@ce2bf47c.419f1f2c]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
From:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>> [mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>>]
Sent: Thursday, October 23, 2014 5:02 PM
To:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>>
Subject: [Vantage] RE: Monitor if E9 is running
Don’t think anything exists in the Epicor world… You should look into a battery backup that powers down your server when you have an outage…
From:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>> [mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>>]
Sent: Thursday, October 23, 2014 4:53 PM
To:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com><mailto:
vantage@yahoogroups.com<mailto:
vantage@yahoogroups.com>>
Subject: [Vantage] Monitor if E9 is running
Hi All,
So we had a power outage last night and all the servers came up without issue but for some reason Epicor 9 did not start properly and no one could connect.
The Admin Service started but the DB and Appservers did not.
In the end, a quick reboot fixed the problem but I’m wondering if there is a way to monitor if Epicor is up and running and can accept client connections.
A monitoring app would be great and one that would send an email alert if it is down.
Worst case scenario, I can create one but I want to check if anything already exists first.
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291<tel:781-573-0291><tel:781-573-0291<tel:781-573-0291>> | cell: 781-408-9278<tel:781-408-9278><tel:781-408-9278> | fax: 781-232-5191<tel:781-232-5191>
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@...<mailto:
jrojas@...><mailto:
jrojas@...<mailto:
jrojas@...>><mailto:
jrojas@...<mailto:
jrojas@...><mailto:
jrojas@...<mailto:
jrojas@...>>> |
www.matsinc.com<
http://www.matsinc.com><
http://www.matsinc.com><
http://www.matsinc.com>
Ask us about our clean, green and beautiful matting and flooring
[cid:d12e10.png@b060cffe.468d4adb]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
</div>
<div style="color:#fff;min-height:0;"></div>