update con vari test ping in avvio x check server e CNC in start
This commit is contained in:
+10
-2
@@ -216,8 +216,16 @@ namespace IOB_WIN
|
||||
|
||||
try
|
||||
{
|
||||
// segnalo reboot (programma)...
|
||||
iobObj.callUrl(iobObj.urlReboot);
|
||||
// verifico server online...
|
||||
if (iobObj.checkServerAlive)
|
||||
{
|
||||
// segnalo reboot (programma)...
|
||||
iobObj.callUrl(iobObj.urlReboot);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayTaskAndLog("Server OFFLINE");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
+46
-20
@@ -1312,40 +1312,66 @@ namespace IOB_WIN
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// test ping all'indirizzo impostato nei parametri
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IPStatus testPingServer()
|
||||
{
|
||||
IPStatus answ = IPStatus.Unknown; ;
|
||||
IPAddress address;
|
||||
PingReply reply;
|
||||
Ping pingSender = new Ping();
|
||||
address = IPAddress.Loopback;
|
||||
string ipAdrr = currIobConf.serverData.MPIP.Replace("http://", "").Replace("https://", "");
|
||||
IPAddress.TryParse(ipAdrr, out address);
|
||||
reply = pingSender.Send(address, 100);
|
||||
answ = reply.Status;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se il server sia ALIVE
|
||||
/// </summary>
|
||||
private bool checkServerAlive
|
||||
public bool checkServerAlive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (DemoOut)
|
||||
{
|
||||
answ = true;
|
||||
answ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
IPStatus pingStatus = testPingServer();
|
||||
// se passa il ping faccio il resto...
|
||||
if (pingStatus == IPStatus.Success)
|
||||
{
|
||||
// chiamo URL, se restituisce "OK" è alive!
|
||||
answ = (callUrl(urlAlive) == "OK");
|
||||
try
|
||||
{
|
||||
// chiamo URL, se restituisce "OK" è alive!
|
||||
answ = (callUrl(urlAlive) == "OK");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// verifico SE è variato stato online/offline...
|
||||
if (MPOnline != answ)
|
||||
{
|
||||
// se ORA sono online riporto...
|
||||
if (answ)
|
||||
{
|
||||
lgInfo("SERVER ONLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
lgInfo("SERVER OFFLINE");
|
||||
}
|
||||
// salvo nuovo status...
|
||||
MPOnline = answ;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// verifico SE è variato stato online/offline...
|
||||
if (MPOnline != answ)
|
||||
else
|
||||
{
|
||||
// se ORA sono online riporto...
|
||||
if (answ)
|
||||
{
|
||||
lgInfo("SERVER ONLINE");
|
||||
}
|
||||
else
|
||||
{
|
||||
lgInfo("SERVER OFFLINE");
|
||||
}
|
||||
// salvo nuovo status...
|
||||
MPOnline = answ;
|
||||
lgInfo("SERVER NOT RESPONDING (PING)");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
|
||||
+30
-4
@@ -14,6 +14,7 @@ using NLog.Targets;
|
||||
using NLog.Config;
|
||||
using System.Configuration;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace IOB_WIN
|
||||
{
|
||||
@@ -274,8 +275,17 @@ namespace IOB_WIN
|
||||
}
|
||||
try
|
||||
{
|
||||
// segnalo reboot (programma)...
|
||||
utils.callUrl(urlReboot);
|
||||
IPStatus pingStatus = testPingServer();
|
||||
// se passa il ping faccio il resto...
|
||||
if (pingStatus == IPStatus.Success)
|
||||
{
|
||||
// segnalo reboot (programma)...
|
||||
utils.callUrl(urlReboot);
|
||||
}
|
||||
else
|
||||
{
|
||||
displayTaskAndLog("Server unreachable, cannot send urlReboot for MAIN FORM");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -284,6 +294,23 @@ namespace IOB_WIN
|
||||
displayTaskAndLog("Main Form OK");
|
||||
}
|
||||
/// <summary>
|
||||
/// test ping all'indirizzo impostato nei parametri
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private IPStatus testPingServer()
|
||||
{
|
||||
IPStatus answ = IPStatus.Unknown; ;
|
||||
IPAddress address;
|
||||
PingReply reply;
|
||||
Ping pingSender = new Ping();
|
||||
address = IPAddress.Loopback;
|
||||
string ipAdrr = MPIP;
|
||||
IPAddress.TryParse(ipAdrr, out address);
|
||||
reply = pingSender.Send(address, 100);
|
||||
answ = reply.Status;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Avvio gli adapters richeisti
|
||||
/// </summary>
|
||||
private void startAdapters()
|
||||
@@ -409,8 +436,7 @@ namespace IOB_WIN
|
||||
/// Apre la finestra child con conf
|
||||
/// </summary>
|
||||
protected void openChild(string IOB)
|
||||
{
|
||||
// !!!FARE!!! x ora è finto... vanno aperti veri adapters
|
||||
{
|
||||
if (IOB == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(IOB));
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=270']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=271']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO-IOB-WIN'
|
||||
|
||||
Reference in New Issue
Block a user