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

Meinberg Syncbox Agent #558

Merged
merged 16 commits into from
Apr 26, 2024
Merged

Meinberg Syncbox Agent #558

merged 16 commits into from
Apr 26, 2024

Conversation

davidvng
Copy link
Contributor

Description

Adds new agent to receive data from the Meinberg syncbox via SNMP.

Motivation and Context

Resolves #518 .

How Has This Been Tested?

Tested on daq-dev with syncboxes available on site.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@davidvng davidvng added the new agent New OCS agent needs to be created label Oct 28, 2023
@davidvng
Copy link
Contributor Author

@mhasself putting this on your radar as it seems relevant again. this had worked last year and I'm wondering if it'd be useful to update this and push for review?

Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should probably have this running.

Find a couple of comments inline from reading the code quickly.

It would be good to demonstrate that these variables do tell us something ... e.g. if we disconnect the PTP grandmaster, does the value of mbgSyncboxN2XPtpPortState change in a way that we would detect with this?

With the SNMP stuff it always bothers me that most of the fields will, like, never change. While for others you might want to sample them a little more often than every ~60s, but only report the value if it has changed (or if a long time has elapsed). Let's consider that a little more.

docs/agents/meinberg_syncbox_agent.rst Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
@davidvng davidvng requested a review from mhasself April 23, 2024 14:47
Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fixes -- still some issues with error handling I think.

I think the only way forward here is to make a list of expected fields (you have done that); then to query those on each iteration, and if any fields are missing, don't publish them and mark self as degraded.

If the "outputs" list is actually dynamic (depends on syncbox config), then you can have each output assigned to a different ocs feed -- that way it won't be an error for those to go in and out depending on syncbox configuration.

A better way, given that we want our syncbox to be in a particular configuration, would be to have command line args that specify which outputs should be configured. Then the syncbox can only monitor those, and become degraded if the status is not available.

socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
socs/agents/meinberg_syncbox/agent.py Outdated Show resolved Hide resolved
@davidvng
Copy link
Contributor Author

davidvng commented Apr 24, 2024

I think the only way forward here is to make a list of expected fields (you have done that); then to query those on each iteration, and if any fields are missing, don't publish them and mark self as degraded.

@mhasself Should I not update session.data as well as not publish to feed when this happens? And if so, do I need to do something like session.set_status('degraded')?

@BrianJKoopman BrianJKoopman mentioned this pull request Apr 24, 2024
6 tasks
Copy link
Member

@mhasself mhasself left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest version looks good.

To mark the session as degraded, just set session.degraded = True; then clear that when connection is re-established.

@BrianJKoopman
Copy link
Member

Latest version looks good.

This seems good to merge, yeah? @davidvng any other changes incoming?

@davidvng
Copy link
Contributor Author

Latest version looks good.

This seems good to merge, yeah? @davidvng any other changes incoming?

@BrianJKoopman no other changes from me, I think it's good to merge

@BrianJKoopman BrianJKoopman dismissed mhasself’s stale review April 26, 2024 17:28

Clearing request for changes, approval provided in comment above.

@BrianJKoopman BrianJKoopman merged commit 0a9894d into main Apr 26, 2024
7 checks passed
@BrianJKoopman BrianJKoopman deleted the syncbox branch April 26, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new agent New OCS agent needs to be created
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meinberg Syncbox N2X Agent
3 participants