Jump to content
Sign in to follow this  
rudi

howto determine, if TCP/IP (Win7) is ready, to start two services?

Recommended Posts

rudi

Hi.

OS=Win7-64 Enterprise.

Today we got the new version 4.01.000.000 of Avaya One-X, a PBX software.

This $%&$% thing fails at startup, as the two services OSPCDatabase and ospc_jonas are up and running, but not working properly, as they start prior the Win7 network is *REALLY* ready.

The Avaya Tech phoned somenone explaining, that these services require, that the TCP/IP services of windows are up and running, before they are started. Setting dependencies to LANMANSERVER, LANMANWORKSTATION, DHCP, and others didn't help so far [1]. So I'm wondering, what would be the appropriate method to determine with an Autoit Script, if the Win7 Network is *REALLY* up already. That script would be installed as a service [2], to start the two other services, as soon as the network ist up and running.

I don't want to provide a "service restart autoit applet" for manual service restart, as the user shall not be logged on with elevated privileges [3].

Setting the startup type to "automatic (delayed)" causes the services not to start at all (waited 15 mins).

Any suggestions appreciated, Regards, Rudi.

[1] http://support.microsoft.com/kb/193888

[2] http://support.microsoft.com/kb/137890

[3] using runaswait() with local admin credentials within the script (either autorun folder or desktop icon for restart) is the last option, I'd like to (ab)use.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
careca

You can always try to create an autoit script like this, then

In group policy "gpedit.msc" somewhere you have an option to start a file with windows.

RunWait("SC START TCPIPSERVICES")
RunWait("SC CONFIG TCPIPSERVICES START= AUTO")
RunWait("SC START TCPIPSERVICES")
RunWait("SC CONFIG TCPIPSERVICES START= AUTO")

Sleep (for the necessary time for them to be up and running)

RunWait("SC START OSPCDatabase")
RunWait("SC CONFIG OSPCDatabase START= AUTO")
RunWait("SC START ospc_jonas")
RunWait("SC CONFIG ospc_jonas START= AUTO")

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
careca

Online check function

Local $Ping

Do
$Ping = Ping ("www.google.com", 1500)
If $Ping >= 1 Then
ToolTip('Online!', 300, 0)
Sleep(1000)
ToolTip('')
Online()
Else
ToolTip('Offline, pinging...', 300, 0)
EndIf
Until $Ping >= 1

Func Online()
MsgBox(0, "Status", "Online")
EndFunc

With JohnOne's idea included:

;Start the network services, change to the ones required/add more
RunWait("SC START TCPIPSERVICES")
RunWait("SC CONFIG TCPIPSERVICES START= AUTO")
RunWait("SC START TCPIPSERVICES")
RunWait("SC CONFIG TCPIPSERVICES START= AUTO")

Local $Ping
Do
$Ping = Ping ("www.google.com", 1000)
If $Ping >= 1 Then
ToolTip('Online!', 300, 0)
Sleep(1000)
ToolTip('')
Online()
Else
ToolTip('Offline, pinging...', 300, 0)
EndIf
Until $Ping >= 1

Func Online()
MsgBox(0, "Status", "Online")
RunWait("SC START OSPCDatabase")
RunWait("SC CONFIG OSPCDatabase START= AUTO")
RunWait("SC START ospc_jonas")
RunWait("SC CONFIG ospc_jonas START= AUTO")
EndFunc
Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
JLogan3o13

Can't you just set the services to delayed start in the services console?

The OP mentions that doing this causes them not to start at all.

Personally, I would push this back on your Avaya support person. They have to have a best practice for setting this up to ensure things start in the correct order. That is why you work with a vendor, so you're not beating your head against a brick wall trying to figure out someone else's product.

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
rudi

@Logan:

Yes, that's exactly what I will do, as it's even worse, see below.

@all:

thanks for your replies. Just waiting for the point of time, PINGs will work, seems not to be sufficent. (/$("§$&/()"§$ !!!)

My temporary workaround is 1.) local Admin for the user (ugly, ugly) 2.) a script in folder "autoruns", that waits after logon for two minutes, starts the services, then waits for another (!) full minute, as the Avaya Phonebook Service will need this time to be really up, after the service was started, then start the OSPC.EXE

a real "quality" product, this version 4.01.000.000 ;)

Have a nice weekend.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
caleb41610

The OP mentions that doing this causes them not to start at all.

Personally, I would push this back on your Avaya support person. They have to have a best practice for setting this up to ensure things start in the correct order. That is why you work with a vendor, so you're not beating your head against a brick wall trying to figure out someone else's product.

ah, missed that part. maybe having autoit start them late, and turning off the service startup at boot?

edit: i can't read today!

Edited by caleb41610

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • ripdad
      By ripdad
      I have had several people ask for this, so I decided to work the algorithm for it and this is the result.
      What is it?
      A Gateway Proxy Sends and Receives Data Unmodified.
      https://en.wikipedia.org/wiki/Proxy_server
      What is it used for?
      You can use it as a gateway, relay or router between two known static IP addresses.
      More information is in the header of the script.
      Download: LocalGatewayProxy.au3
      You will need WSA_NBTCP.au3 from here:
      https://www.autoitscript.com/forum/topic/191954-wsa_nbtcp-v100-udf/
      If you have any questions or problems, let me know.
       
    • ripdad
      By ripdad

      This script is based on algorithm code from EnrMa.
      Updated: January 22, 2018
      Made improvements. Changes are in the script header.
      Known Issues: AutoIt x64 does not work properly with this script.
      Download: LocalProxyServer_v1.00.zip
       
    • ripdad
      By ripdad
      WSA_NBTCP.au3  (Windows Sockets API - Non-Blocking Transmission Control Protocol)
      Version: 1.00
      Type: UDF
      This is an accumulation of WSA code from many sources and modified to suit myself.
      These functions have been thoroughly tested using a Local Proxy Server, which
      is about the most strenuous test you can use.
      Includes my rendition of how a TCPRecv Timeout should work. Also includes a
      timewait/timeout using Select for TCP Send, which works great for that function.
      You will need a loop to use _WSA_TCPRecv(). An example will be forthcoming in a second post.
      Functions:
      #CURRENT_USER_FUNCTIONS
      _WSA_Cleanup
      _WSA_FormatMessage
      _WSA_GetLastError
      _WSA_TCPAccept
      _WSA_TCPCloseSocket
      _WSA_TCPConnect
      _WSA_TCPListen
      _WSA_TCPRecv
      _WSA_TCPSend

      #INTERNAL_FUNCTIONS
      __TimeoutManager
      __TimeoutReset

      #EXTRA_FUNCTIONS
      _WSA_GetAddrInfo
      _WSA_GetHostByAddr
      _WSAAsyncGetHostByName
      _WSAAsyncGetHostByName_Callback
      _WSA_GetNameInfo
       
      Requirements:
      - AutoIt Versions: 3.3.8.1 thru 3.3.15.0 (32Bit only).
      - TCPStartup() at beginning of script on startup.
      - TCPShutDown() and _WSA_Cleanup() on exit.
      Download UDF: WSA_NBTCP.au3
       
    • tarretarretarre
      By tarretarretarre
      AutoIt-SocketIo
      Yep yep, this is pretty much an attempt to port the existing project's concept https://socket.io/ to AutoIt's Codebase. So i will not go in to so much detail.
      This is how the communication is done http://i.imgur.com/0mMfsBD.png Each client is isolated to the server http://i.imgur.com/rVO2LFb.png Features
      Easy API VarType Translation (Example: If the server sends an int, the client will receive an int and vice versa) Fully featured examples Data encryption (Using Autoit's UDF Crypt.au3) Limitations / Drawbacks
      It is not possible to Broadcast/Emit objects Only 1D-arrays are allowed to be Broadcasted/Emitted (2D arrays will probably never be supported) Changelog
      Version 1.5.0 (This update DOES NOT break scripts)
      Added AutoIt like docs under Docs\. The docs are generated so its a 1 to 1 reflection of the UDF headers. Print of documentation Added a production ready server example. Added a new method: _Io_DevDebug which will display useful information when debugging. Added a new method: _Io_SetMaxRecvPackageSize which defaults to whatever _Io_setRecvPackageSize is set to. Added a new method: _Io_setOnPrefix which defaults to _On_ Added a new default client & server event called flood. Flood occurs when exceeding the $__g_io_nMaxPacketSize. $__g_io_nMaxPacketSize is set by _Io_SetMaxRecvPackageSize Fixed the 16 parameter limit when sending data with _Io_Emit, _Io_Broadcast, _Io_BroadcastToAll and _Io_BroadcastToRoom. This works on the same premise that AutoIt's Call Does Fixed a TRUNCATION problem when receiving packages which could cause crashes! Fixed a programming error which caused $__g_ionPacketSize to reset to default 4096 if _Io_Connect or _Io_listenwere called after _Io_setRecvPackageSize Fixed _Io_setEventPreScript and _Io_setEventPostScript They didnt work. Lol. Changed how events are fired so the client cannot crash the server by sending the wrong number of parameters (This also allows for optional parameters on callbacks) Changed _Io_On. The second parameter $fCallback can now be set to null. Doing this, the function assumes that the callback is: _On_<eventName>.  
      Changelog History
      Api methods
      Please see the docs provided
      Default events
      Server events
      connection Client events
      banned Server and Client events
      disconnect flood View source on github
       
      Autoit-Socket-IO-1.0.0.zip (OLD!)
      Autoit-Socket-IO-1.1.0.zip (OLD)
      Autoit-Socket-IO-1.3.0.zip (OLD)
      Autoit-Socket-IO-1.4.0.zip (OLD)
      Autoit-Socket-IO-1.5.0.zip (NEWEST 2017-12-20)
    • timmalos
      By timmalos
      Hello all.
      In case this is interesting few of you, I share my AMCP 2.1 protocol UDF in AutoIT. This protocol is used by CasparCG server, which is a Windows and Linux software used to play out professional graphics, audio and video to multiple outputs as a layerbased real-time compositor. It has been in 24/7 broadcast production since 2006. It's free and opensource.
      The UDF I share allows communication between an AutoIt based client and the CasparCG, based on following documentation : http://casparcg.com/wiki/CasparCG_2.1_AMCP_Protocol
      If you want more details on CasparCG :  official WebSite or have a look to this video
      I'm currently building a full Client based on AutoIt, with many features like drag-and-drop layers, but sadly I can't share it right now, might come later. Don't hesitate to ask questions if you have any or need a basic example.
      The only requirement for this UDF is the other Event-driven TCP UDF by Kip
       
       

      AMCP_shared.au3
      TCP.au3
×