How to check if hub and nodes are running by bash

62 views
Skip to first unread message

Čamo

unread,
Feb 24, 2021, 4:32:26 AM2/24/21
to Selenium Users
I need to make a script which will check if selenium hub and nodes are running as bash file. I can check the result of 

ps -x | grep "selenium-server" | grep -v grep 

but I am not sure if it is enough. Can somebody tell me how to check it hub and two nodes are running? Thanks a lot.

Krishnan Mahadevan

unread,
Feb 27, 2021, 2:25:30 AM2/27/21
to seleniu...@googlegroups.com

Are you running on Grid 3 ?

 

If yes, then you can have your shell script trigger a curl command to this endpoint:

 

http://localhost:4444/wd/hub/status

 

(or)

 

http://localhost:4444/status

 

Now for checking if the nodes are up and running, you can do the following:

 

http://localhost:4444/grid/api/hub

 

This should give you total slots count and total free count. You can just check if the total slot count is greater than zero. The Hub internally does a status check on all the nodes to see if they are all running.

 

Assuming that you know the IP addresses of all the nodes (I am going to assume again that you have the nodes all running on the same standardized port)

 

For each of your nodes you could do a curl command on http://localhost:5555/status

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3ff58f30-cdbc-403c-b1d0-b4c8d84fe9b8n%40googlegroups.com.

Čamo

unread,
Mar 4, 2021, 5:37:33 AM3/4/21
to Selenium Users
Thanks a lot for help. I lost this answer so my reaction comes little late. Sorry for that. 

Dátum: sobota 27. februára 2021, čas: 8:25:30 UTC+1, odosielateľ: Krishnan Mahadevan
Reply all
Reply to author
Forward
0 new messages