How can I retrieve the status of the agent?

Hello @zainm and welcome to this community. :wave:

You may find a few hints there: Jenkins agent time off - #2 by poddingue .