Skip to content

Comments

Add command to list currently subscribed clients#49

Closed
franzflasch wants to merge 1 commit intotroglobit:masterfrom
franzflasch:list-supervisor-clients
Closed

Add command to list currently subscribed clients#49
franzflasch wants to merge 1 commit intotroglobit:masterfrom
franzflasch:list-supervisor-clients

Conversation

@franzflasch
Copy link
Contributor

I thought it would be useful to have a list of subscribed clients and get some status information about them. So I added a new supervisor cmd to log that information on request.

@franzflasch
Copy link
Contributor Author

franzflasch commented Aug 2, 2024

FYI: the output looks like this:

watchdogd[732]: Subscribed clients:
watchdogd[732]: process: 1, id: 1, pid: 733, label: watchdogd-client-example, timeout: 3000ms, time-left: 2483ms

And in case timerfd_gettime returns an error (e.g. when watchdogd is disabled):

watchdogd[732]: Subscribed clients:
watchdogd[732]: process: 1, id: 1, pid: 733, label: watchdogd-client-example, timeout: 3000ms, time-left: 0ms

It just returns 0ms instead of an invalid value.

@franzflasch franzflasch force-pushed the list-supervisor-clients branch from 259b6a2 to 65a9edc Compare August 2, 2024 05:48
@franzflasch
Copy link
Contributor Author

Any chance that this gets merged?

@troglobit
Copy link
Owner

Sorry for the late reply, I've been swamped with other duties, yet I have been thinking about this one long and hard in the background, unsure how to reply ...

... because I really don't want to discourage you, but I would like to get the client list displayed by watchdogctl, on stdout, and not sent to syslog. If a user wants to send it to syslog, they can pipe it to the logger command, or similar.

This means extra work on the IPC between the daemon and the client (I've done this in other projects of mine already, e.g., finit, mrouted, and a few others).

@franzflasch
Copy link
Contributor Author

Thanks for your reply. Having it as stdout by watchdogctl would also be my preferred solution. However I wanted to make this change as minimal as possible. If you plan to do it as stdout, you can just decline it, fine for me.

@troglobit
Copy link
Owner

That's just it, I have no current plans to work on watchdogd, so if you'd like to have a go at it I'm happy to review.

@troglobit troglobit closed this in 565d687 Nov 23, 2025
@troglobit
Copy link
Owner

Thank you for this contribution! I've adopted it and added JSON output support as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants