Get Job Service Status from Queue Name - v8.0

Hello Experts

Is it progammatically possible to query the status of a particular service given the name of the queue? 

The JobQueueInfo tool already does this (when selecting "Get Status" or F5), is it possible to do this via the scripting API?

So, for instance I have a queue named "Queue01" hosted on a job service, can I find out if the job service is stopped or running? For my use case it is safe to assume a service has one and only one queue on it

Thanks

Kin

Top Replies

Parents
  • With the name of the queue, you can fetch the necessary information for the heartbeat call from the QBMServer table.

    The same status information as shown in the Jobqueue Info tool can be fetched by a web request against the URL <protocol>://<hostname>:<port>/hb

    If the service is operational, you will get an XML in return. A sample is shown below.

    <hb>
    <hb-host>IAMS01</hb-host>
    <hb-datetime>2020-02-17 20:41:42</hb-datetime>
    <hb-version>8.1.161.5406</hb-version>
    <hb-user>IAM\Administrator</hb-user>
    <hb-revision>344749090</hb-revision>
    </hb>

  • Thanks a lot Marcus

    I wasn't able to find which column to look at for the hearbeat call status in the QBMServer table. I thought it might be the "IsJobServiceDisabled" flag, however when I stopped ther service this was still set to False.

  • The same status information as shown in the Jobqueue Info tool can be fetched by a web request against the URL <protocol>://<hostname>:<port>/hb

    The only stuff you can fetch from the QBMServer table is the hostname and the port (if changed). So you need to make a web request against the listed URL.

  • Hi Markus

    Actually I had a supplementary question on top of this one.

    The reason I need to query a particular queue is to find out if the service is active before sending a job to it. Essentially, before a process is generated, in the pre-script we calculate which service to send all the steps of the process on from a list of available queues, and one of the basic checks we need to do is check if the service is active

    Now I'm not sure if the pre-script will be able to authenticate to the heartbeat URL, do you know which user the pre-script will run under?

    FYI the service configuration has <value name="httpauthentication">VI.JobService.Http.WindowsHttpAuthentication,JobService</value>

  • Thing is, that the process generation will be executed in the context of the user working with the objects. That means if you work with a Manager on client, the credentials of the client running the Manager process will be used. At least this is true if you are working with a native SQL Server connection. If you are using an Application Server connection, the credentials from the Application Server process will be used (At least, this is what I expect).

Reply
  • Thing is, that the process generation will be executed in the context of the user working with the objects. That means if you work with a Manager on client, the credentials of the client running the Manager process will be used. At least this is true if you are working with a native SQL Server connection. If you are using an Application Server connection, the credentials from the Application Server process will be used (At least, this is what I expect).

Children
No Data