Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Self-hosted event hooks or ways to monitor job status? #4994

Closed
1 of 4 tasks
frittsy opened this issue Sep 16, 2024 · 2 comments
Closed
1 of 4 tasks

[Question]: Self-hosted event hooks or ways to monitor job status? #4994

frittsy opened this issue Sep 16, 2024 · 2 comments

Comments

@frittsy
Copy link

frittsy commented Sep 16, 2024

Describe your question

Hi there,

I'm looking for a way to know if a self-hosted agent is actively running a job or not, locally on the machine and not via polling the Azure DevOps API.

Is there any sort of event-based hook that I can utilize from the agent that will execute something when a job starts/ends? Or is there anything I can monitor on the filesystem that would indicate whether the agent is actively running a job or not?

Thank you in advance

Versions

Azure DevOps version 3.242.1 - Windows Server 2022
Azure DevOps version 3.240.1 - Ubuntu 22.04

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Operation system

Windows Server 2022, Ubuntu 22.04

Version controll system

Git

Azure DevOps Server Version (if applicable)

No response

@max-zaytsev
Copy link

@frittsy I'm not sure I understood your question correctly.

You can probably just check if the Agent.Worker process is running on your machine.

PS C:\Users\v-mazayt> Get-Process -Name Agent.Worker*

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    723      70    69924      99308       7.89  37600   2 Agent.Worker

@frittsy
Copy link
Author

frittsy commented Sep 19, 2024

I just wanted to make sure there wasn't some built-in feature of the agent itself that I could leverage, that would run a custom script when a job starts for example.

But what you suggested will work for me, I can monitor for that process. Thank you for the idea!

@frittsy frittsy closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants