How can I detect when a machine is in troubleshooting mode?

There have been a few instances where a developer has forgotten to take a machine out of trouble shooting mode resulting in triggers failing to fire.

I’d like to automate a way to check for machines in maintenance mode for an extended period of time. Is there a way through the API or the database to query the maintenance and troubleshooting status of a particular machine with the datetime of the last state change?

@jketchas,

With API we have an End Point to check machine/robot status but this will give you current status and not till what time it’s in the same status.

For keeping the track of the status of bot’s on your Orchestrator, you can build a background process which will use API to get status of bots and store it in an excel file or some database.

You can use this data to check how long the bot is in the Maintenance Mode.

@jketchas

Looks at this endpoint…this might give you the time stamp…which can be leveraged

Cheers

That is for putting Orchesrtator in maintenance mode: Orchestrator - Maintenance Mode

Thanks though :slight_smile:

I’m looking for something to monitor machines pulled out of production from Tenant → Monitor → Unattended Sessions. Below you see one machine has troubleshooting Enabled and is in Maintenance Mode. I’m looking for a way to check this without using the frontend.

@jketchas

Try using the get host admin logs…in logs you would have the machine suspended details…get the time from it…that can be used for your condition

First and last are to put and remove from maintenance mode…that is a different one

You can check when is the last trigger skipped or last job stopped for a machien and then find how much time the maintenance mode is present

You dont have any direct api for all details…this is more like a combination that you can use

Cheers

Hi @jketchas,

Per my understanding, troubleshooting mode doesn’t prevent any processes from running.

It happens only when that machine is in maintenance mode.

However, please help me understand why are you looking to automate this?

Because, even if you find a way to automate that, you won’t be able to run that process from orchestrator to check the status of that machine until you lift up the maintenance mode.

Hence, I am not really sure how are you planning to use it, but below is also one way(Using Audit logs endpoint to fetch below info) to find if maintainence mode is enabled or not.

Hope this helps.

Regards
Sonali

Hello,

Based on my testing, when creating a new process that targets a machine with Maintenance mode enabled and/or Troubleshooting enabled the new job will go into pending until both Maintenance and Troubleshooting are disabled.

To help clarify, here is a pic of where in Orchestrator I am referring to:

I am looking for a way to detect whether these switches are enabled (along with the timestamp of last state change if possible). And I am looking to do it outside of any UiPath Studio workflow. This is so we can build an inhouse tool to watch machine states. The purpose for the support ticket is to gain knowledge of how to poll the machine state (for Maintenance & Troubleshooting) either through the API (which I don’t think you can), or through some SQL query in the database.

I first looked through the Swagger API thinking something from the Machines endpoint would have this information, but I did not see anything I am looking for. I don’t think the API provides the information I am looking for, but leave that for you to confirm.

I then took a cursory look at the Orchestrator DB but again did not find anything referencing these machine state for Troubleshooting and Maintenance. I am assuming that these details are in the Orchestrator DB and hopeful that a SQL querying this information could be shared with me.

Hi @jketchas,

Jobs will go in pending only because of maintainence mode Irrespective of the status of troubleshooting mode.

Maintainence mode → relates to Orchestrator jobs running and is used by admins to login to the machine for any maintainence stuff and to ensure no job starts running while admin is in the machine.

Troubleshooting mode → relates to studio, it decides whether or not studio can be used for development/troubleshooting purposes. If it is disabled, developers can’t use studio to run any developments(in an attended way) but it doesn’t stop any unattended job from running from orchestrator.

Did you try using Audit logs API, were you able to fetch the record and its details?
I think you can try below:

  1. Enable maintainence mode for a machine
  2. Navigate to the Audit section in Orchestrator and see the latest entry - it will be session update
  3. Then try to fetch the last entry using Audit api and see

And yes, my understanding is also that Orchestrator DB would contain all of this information, so you should be able to fetch the same from there too.

Regards
Sonali