So It's time to make the scheduler to work!
Let's assume the Resource PC we are using is configured to have the LoginAgent service listening on port 8081, and Resource PC ready to fire listening on port 8082.
When the LoginAgent is up and running, the Resource PC is not ready to start an automation, so we have to schedule this sequence of tasks:
- Login on 8081
- Run on 8082
- Logout on 8082
Da first configuration |
Just the login agent log |
I can see you asking yourself: WTF is named pipe?
Well, I read a lot about it but I don't remember a single word, but the concept is that the named pipe is a method for IPC (Inter Process Comunication), so i can assume is used when to resume LoginAgent.
Indeed, referring to the schedule above, if you observe the control room is that, when you see the resource PC connected on port 8081, the port 8082 results to be disconnected and vice versa, this means that LoginAgent is listening for login request while 8081 is connected and, until 8082 is in use (so until the logout), LoginAgent is not available.
Sometimes it happens that, even if LoginAgent service is available on port 8081, but the login failed because of the unregistered named pipe, so the solution is... surprise surprise...reboot the machine.
You can find all registered named pipes just with this PowerShell command
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
And the output will be something like this
So the next action is to translate this code in a VBO action, so you can discover if the BP named pipe is registered or not, you can simply use this code to get all the named pipe and then just filter the output collectin
Dim listOfPipes As String() = System.IO.Directory.GetFiles("\\.\pipe\") dt.Columns.Add("C1") For Each s As String In listOfPipes dt.Rows.Add(s) Next
Use VBO... use the force |
Just the BP log after the cure |
The next step is to integrate this new logic in the login task, so if the robot finds out that named pipe is not registered, it reboots the Resource PC.
And now login like this |
.The final step is just to add a new task 2.Wait, this task will be:
- Called if login failed
- Calls login both in success and failure condition
A new day, a new design |
The pitfall of this technique is that you can generate a infinite loop, so take care.
So my friends, that's it, and thanks to my friend Antonio Durante for his time which helped us to work this out.
0 commenti:
Post a Comment
Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).