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

Minor edits to "improved systemd integration" #643

Closed
mamoep opened this issue Nov 5, 2021 · 1 comment
Closed

Minor edits to "improved systemd integration" #643

mamoep opened this issue Nov 5, 2021 · 1 comment
Labels
feature New feature or request status/done

Comments

@mamoep
Copy link

mamoep commented Nov 5, 2021

Is your feature request related to a problem? Please describe.
Monitoring poller instance health via systemd units. The provided solution can be improved further.

Describe the solution you'd like

  • The description of the improved systemd integration should be linked into the README (https://github.com/NetApp/harvest/tree/main/service/contrib)
  • Poller service Unit file should be modified
    1. improve description
    2. change path to default
    3. add user/group to avoid unix poller /proc issue and improve security
    4. add "WantedBy" to correctly stop when harvest.target is stopped
      Suggestion:
[Unit]
Description="Netapp Harvest Poller instance %I"
PartOf=harvest.target

[Service]
User=harvest
Group=harvest
Type=simple
Restart=on-failure
WorkingDirectory=/opt/harvest
ExecStart=/opt/harvest/bin/harvest --config /opt/harvest/harvest.yml start -f %i

[Install]
WantedBy=harvest.target

-harvest generate systemd output should be modified to allow piping directly to unit file

  • harvest.target unit file should use Requires instead of Wants. That way the target will fail if any poller fails to start.
  • harvest.target unit file should reference unix poller as last unit to avoid instance discovery error messages. (skip instance [ontap], process: process not found)
    Suggestion
[Unit]
Description="NetApp Harvest Meta Service"
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

[Install]
WantedBy=multi-user.target' | sudo tee /etc/systemd/system/harvest.target

Describe alternatives you've considered
None

Additional context
None

@mamoep mamoep added the feature New feature or request label Nov 5, 2021
@cgrinds cgrinds self-assigned this Nov 5, 2021
cgrinds added a commit that referenced this issue Nov 5, 2021
cgrinds added a commit that referenced this issue Nov 5, 2021
and docs
Fixes #643
Verified with config that contains:
- no pollers that have a Unix collector
- single poller that has a Unix collector
- multiple pollers with a Unix collector
- multiple pollers with a multiple collectors, one of which is a Unix collector
@cgrinds cgrinds closed this as completed in ca3f42d Nov 8, 2021
@cgrinds cgrinds assigned cgrinds and unassigned cgrinds Feb 10, 2022
@cgrinds
Copy link
Collaborator

cgrinds commented Feb 11, 2022

Verified on release/22.02.0 727e0b5 :

  • documentation was updated
  • description was improved
  • default path printed to console is standard service location
  • harvest user and group are included in service file
  • service file includes WantedBy clause. Pollers are stopped when harvest.target is stopped
  • unix poller is added last in the service list

@cgrinds cgrinds removed their assignment May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request status/done
Projects
None yet
Development

No branches or pull requests

2 participants