#Native Harvest: How to change log file location?
1 messages · Page 1 of 1 (latest)
Harvest is running on a User which don't have access to /var/log
Can I set another log-file location ?
Native Harvest: How to enable log file for non-root user?
Native Harvest: How to change log file location?
Can you try setting an environment variable HARVEST_LOGS to a directory where the harvest user has access? Restart Harvest after that and see if it resolves the issue.
in my harvest.yml ?
set, but no logs are going in
hmm ok let me check in code
Can you also add an argument for harvest start command --logtofile
You can also add HARVEST_LOGS with custom dir path i like below in service file like below
Environment="HARVEST_LOGS=/opt/harvest/logs"
ExecStart=${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64/bin/harvest --config ${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64/harvest.yml start --logtofile -f %i
Thank you, I will try it and let you now.
Other question, is there also a way to monitor the harvest service itself?
Do you mean via systemd? or via some other means?
Added these steps via PR
https://github.com/NetApp/harvest/pull/3993/files
Hi, i'm working with @dull escarp and responsible for Harvest. We tried your approach with HARVEST_LOGS env variable but it does not work. [Unit]
Description="NetApp Harvest Poller instance %I"
PartOf=harvest.target
After=network-online.target
Wants=network-online.target
[Service]
User=rh18
Group=scripts
Type=simple
Restart=on-failure
Environment="HARVEST_LOGS=/services/netapp/harvest/logs"
WorkingDirectory=/services/netapp/harvest/harvest
Environment="HARVEST_LOGS=/services/netapp/harvest/harvest/log"
ExecStart=/services/netapp/harvest/harvest/bin/harvest --config /services/netapp/harvest/harvest/harvest.yml start --logtofile -f %i
[Install]
WantedBy=harvest.target
root@mcosrv2253:/services/netapp/harvest# ll /services/netapp/harvest/logs
total 0
Could you share permissions for dir /services/netapp/harvest/logs
SORRY, i'm a idiot, it runs, just watched in the wrong directory. Thanks for the help
I see there are 2 env variables in file
Environment="HARVEST_LOGS=/services/netapp/harvest/logs"
cool. Pls remove duplicate dir from service file.
to have any log in case of harvest systemd crash
You can keep a watch on poller status via systemctl status "poller@*"
We have the strange situation that everything runs fine for a couple of days and suddenly ALL pollers are gone (we have 19 actually, Ontap and StorageGRID, all REST based), and we don't know why all pollers are gone.
What is your Harvest version?
I suspect in one case it was the upgrade of a StorageGRID Admin Node. But why are then all pollers exiting and not only the one targeting to these admin node?
The newest 25.08.1
All pollers of harvest are independent. Issue in 1 poller should not impact others. Could you check if there are any OOM erros?
dmesg | grep -i "killed process"
How much memory do you have available? free -h
also disk space?
root@mcosrv2253:/services/netapp/harvest# free -h
total used free shared buff/cache available
Mem: 62Gi 39Gi 3.2Gi 16Mi 20Gi 22Gi
Swap: 4.0Gi 2.0Mi 4.0Gi
Diskspace and memory are not the problem, and there is nothing in dmesg output regarding "killed process".
Ok. We'll need to check logs then. See if logs are captured in journal?
journalctl -u "poller*" --no-pager -f
root@mcosrv2253:/services/netapp/harvest# journalctl -u "poller*" --no-pager -f
-- Logs begin at Mon 2025-07-28 17:02:24 CEST. --
Nov 03 10:21:35 mcosrv2253 harvest[3950105]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950090]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950115]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950100]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950119]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950190]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950116]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950217]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950203]: starting in foreground, enter CTRL+C or close terminal to stop poller
Nov 03 10:21:35 mcosrv2253 harvest[3950207]: starting in foreground, enter CTRL+C or close terminal to stop poller
yep, lets wait until i crashes again, then i can check the logs. Thanks so far.
sure
You can see all journalctl logs via command if that gives any pointers on this.
journalctl -u "poller*"
Poller crashed again, which Log-files you need to take a look on it ?
Let's check poller logs and journalctl logs journalctl -u "poller*"
Could you upload them @ https://upload.nabox.org/dece-cafa-fyxa
Also check output of
systemctl status "poller*"
thank you, files are uploaded
Thanks. Could you share Harvest poller logs as well
As per logs, poller process received SIGTERM . It's something outiside pollers which is causing it to shutdown
time=2025-11-03T22:22:31.812+01:00 level=INFO source=poller.go:680 msg="caught signal" Poller=mcistr0100 signal=terminated
network timeouts possible?
Doesn't seem like it.
ok that`s good. Do you see any chance to figure out what our issue is?
Checking. It is possible that systemd only is stopping all pollers. It could be that 1 poller process is not able to run so systemd tries to restart all.
Thank you very much for your time!
looks like poller mspstr0116 is failing. Is it something new which you have added?
And since adding that you are noticing crashes?
we added all our clusters at same time
If you check poller_mspstr0116.log
It cann't run due to permission issues. Could you fix its permissions?
I see its logs only starting from time=2025-11-03T10:21:35.688+01:00
which kind of permissions do you mean?
time=2025-11-03T10:22:04.241+01:00 level=WARN source=poller.go:861 msg="init collector-object" Poller=mspstr0116 error="StatusCode: 401, Error: auth failed, Message: 401 Unauthorized, API: /api/cluster?fields=%2A&return_records=true" collector=RestPerf object=WorkloadVolume
so issue with User in ONTAP ?
Yes
ok, I check it
Let me check if we can also fix something in systemd behaviour so that it doesn't restart all pollers when 1 crashes
once permissions issues are fixed. That should solve the problem.
You can also change harvest.target file at location /etc/systemd/system/harvest.target
and change Requires to Wants
After making this change. Execute below commands
systemctl daemon-reload
systemctl restart harvest.target
systemctl status harvest.target
Thank you @main axle in fact the harvest user was missing on our mspstr0116 cluster!
Makes sense. Let's see how system behaves after above fixes.
Thank you, I keep my eyes on it and let you know
sure
FYI. This fix will be added to next Harvest release.
https://github.com/NetApp/harvest/pull/4002/files
@main axle is runs stable now. Thank you for your help!
@dull escarp We will do next Harvest release 25.11 probably today/tomorrow. You can wait for that.