Environment
proxmox server
Problem/Question
I have two proxmox servers that I am trying to get megacli monitoring working. I followed the guide:
I did enable the megacli by ./edit-config python.d.conf
What I expected to happen
Would like to see it on the dashboard and I do not see it after I enabled it.
Was there more to the configuration?
1 Like
If you followed the configuration to the letter, then it should be working.
Can you please send us the logs, as shown in the documentation?
To do this, follow the documentation to find the log file and use the following command: less /var/log/netdata/error.log
. Copy the output and send it here.
Don’t worry, we will get to the bottom of this!
Documentation:
ilyam8
January 13, 2021, 12:02pm
3
Hi @willb0t
Would like to see it on the dashboard and I do not see it after I enabled it.
Have you restarted netdata service after?
If yes and the problem exists, i suggest to run megacli
collector in the debug mode:
First, navigate to your plugins directory, usually at /usr/libexec/netdata/plugins.d/
. If that’s not the case on your system, open netdata.conf
and look for the setting plugins directory
. Once you’re in the plugin’s directory, switch to the netdata
user.
cd /usr/libexec/netdata/plugins.d/
sudo -u netdata -s
You can now run the python.d.plugin
to debug the collector:
./python.d.plugin debug nolock megacli
If it works in the debug mode, then the problem is likely systemd unit capabilities, megacli
uses sudo
and netdata.service
unit doesnt have needed permissions.
The fix is Adaptec RAID plugin bug · Issue #10079 · netdata/netdata · GitHub
mkdir /etc/systemd/system/netdata.service.d; echo -e '[Service]\nCapabilityBoundingSet=~' | tee /etc/systemd/system/netdata.service.d/unset-capability-bounding-set.conf
systemctl daemon-reload
systemctl restart netdata.service
fatur
January 23, 2023, 1:20am
4
hi @ilyam8 his my debug trace, but still no chart on dashboard. Can you help me?
$ /usr/libexec/netdata/plugins.d/python.d.plugin debug trace megacli
2023-01-23 08:19:06: python.d INFO: plugin[main] : using python v3
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : looking for '/etc/netdata/python.d.conf'
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : '/etc/netdata/python.d.conf' is loaded
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : looking for '/usr/lib/netdata/conf.d/python.d.conf'
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : '/usr/lib/netdata/conf.d/python.d.conf' is loaded
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : looking for 'pythond-jobs-statuses.json' in /var/lib/netdata
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : loading '/var/lib/netdata/pythond-jobs-statuses.json'
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : '/var/lib/netdata/pythond-jobs-statuses.json' is loaded
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : [megacli] loaded module source : '/usr/libexec/netdata/python.d/megacli.chart.py'
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : [megacli] looking for 'megacli.conf' in ['/etc/netdata/python.d', '/usr/lib/netdata/conf.d/python.d']
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : [megacli] loading '/usr/lib/netdata/conf.d/python.d/megacli.conf'
2023-01-23 08:19:06: python.d DEBUG: plugin[main] : [megacli] '/usr/lib/netdata/conf.d/python.d/megacli.conf' is loaded
2023-01-23 08:19:06: python.d INFO: plugin[main] : [megacli] built 1 job(s) configs
2023-01-23 08:19:06: python.d DEBUG: megacli[megacli] : Executing command '/usr/bin/sudo -n -l'
2023-01-23 08:19:06: python.d DEBUG: megacli[megacli] : Executing command '/usr/bin/sudo -n /usr/bin/megacli -LDPDInfo -aAll -NoLog'
2023-01-23 08:19:06: python.d INFO: plugin[main] : megacli[megacli] : check success
CHART netdata.runtime_megacli '' 'Execution time' 'ms' 'python.d' netdata.pythond_runtime line 145000 5 '' 'python.d.plugin' 'megacli'
CLABEL '_collect_job' 'megacli' '1'
CLABEL_COMMIT
DIMENSION run_time 'run time' absolute 1 1
2023-01-23 08:19:06: python.d DEBUG: megacli[megacli] : started, update frequency: 5
2023-01-23 08:19:09: python.d DEBUG: megacli[megacli] : Executing command '/usr/bin/sudo -n /usr/bin/megacli -LDPDInfo -aAll -NoLog'
CHART megacli.adapter_degraded '' 'Adapter State' 'is degraded' 'adapter' 'megacli.adapter_degraded' line 60000 5 '' 'python.d.plugin' 'megacli'
CLABEL '_collect_job' 'megacli' '0'
CLABEL_COMMIT
DIMENSION 'adapter_0_degraded' 'adapter 0' absolute 1 1 ' '
BEGIN megacli.adapter_degraded 0
SET 'adapter_0_degraded' = 1
END
CHART megacli.pd_media_error '' 'Physical Drives Media Errors' 'errors/s' 'pd' 'megacli.pd_media_error' line 60001 5 '' 'python.d.plugin' 'megacli'
CLABEL '_collect_job' 'megacli' '0'
CLABEL_COMMIT
DIMENSION 'slot_0_media_error' 'slot 0' incremental 1 1 ' '
DIMENSION 'slot_1_media_error' 'slot 1' incremental 1 1 ' '
DIMENSION 'slot_2_media_error' 'slot 2' incremental 1 1 ' '
DIMENSION 'slot_3_media_error' 'slot 3' incremental 1 1 ' '
DIMENSION 'slot_4_media_error' 'slot 4' incremental 1 1 ' '
DIMENSION 'slot_5_media_error' 'slot 5' incremental 1 1 ' '
BEGIN megacli.pd_media_error 0
SET 'slot_0_media_error' = 0
SET 'slot_1_media_error' = 0
SET 'slot_2_media_error' = 0
SET 'slot_3_media_error' = 0
SET 'slot_4_media_error' = 0
SET 'slot_5_media_error' = 0
END
CHART megacli.pd_predictive_failure '' 'Physical Drives Predictive Failures' 'failures/s' 'pd' 'megacli.pd_predictive_failure' line 60002 5 '' 'python.d.plugin' 'megacli'
CLABEL '_collect_job' 'megacli' '0'
CLABEL_COMMIT
DIMENSION 'slot_0_predictive_failure' 'slot 0' incremental 1 1 ' '
DIMENSION 'slot_1_predictive_failure' 'slot 1' incremental 1 1 ' '
DIMENSION 'slot_2_predictive_failure' 'slot 2' incremental 1 1 ' '
DIMENSION 'slot_3_predictive_failure' 'slot 3' incremental 1 1 ' '
DIMENSION 'slot_4_predictive_failure' 'slot 4' incremental 1 1 ' '
DIMENSION 'slot_5_predictive_failure' 'slot 5' incremental 1 1 ' '
BEGIN megacli.pd_predictive_failure 0
SET 'slot_0_predictive_failure' = 0
SET 'slot_1_predictive_failure' = 0
SET 'slot_2_predictive_failure' = 0
SET 'slot_3_predictive_failure' = 0
SET 'slot_4_predictive_failure' = 0
SET 'slot_5_predictive_failure' = 0
END
BEGIN netdata.runtime_megacli 0
SET run_time = 261
END
2023-01-23 08:19:09: python.d DEBUG: megacli[megacli] : update => [OK] (elapsed time: 261, failed retries in a row: 0)
^C2023-01-23 08:19:10: python.d INFO: plugin[main] : exiting from main...
ilyam8
January 23, 2023, 10:29am
5
Hi, @fatur . Check the error.log
grep megacli /var/log/netdata/error.log
The difference between running the plugin in the debug and normal modes - in the latter case netdata runs as a systemd service and that adds additional limitations.
As I mentioned earlier
If it works in the debug mode, then the problem is likely systemd unit capabilities, megacli
uses sudo
and netdata.service
unit doesnt have needed permissions.
fatur
January 24, 2023, 12:48am
6
Hi @ilyam8 ,
I missed adding netdata as sudoer, now the chart can run.
Thanks for the information.