I am trying to integrate MegaCLI into my dashboard. I have it installed on my Linux (Debian) host. I am following this guide: MegaRAID controller monitoring with Netdata | Learn Netdata. I attempt to run * sudo -n megacli -LDPDInfo -aAll
as the root user, but I get this: sudo: megacli: command not found. Running megacli -LDPDInfo -aAll returns all of the info properly. Running that same command logged in as the netdata user returns the following: “Exit Code: 0x00”. But running ‘megacli’, it does recognize the command, and returns “Fatal error - Command Tool invoked with wrong parameters Exit Code: 0x0”.
On my web dashboard, it does not show any megacli data. How do I get it to populate on my dashboard? I am running netdata v1.12.0.
Hi @droidus
Lets try to debug the problem.
I am running netdata v1.12.0
That is quite old version, current stable version is v1.28.0. How did you install Netdata?
Via the bash script, but it looks like it has updated since then:
v1.28.0-222-nightly
Perfect! Let’s see the debug output.
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 megacli
2021-01-30 07:41:57: python.d INFO: plugin[main] : using python v2
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : looking for ‘python.d.conf’ in [‘/etc/netdata’, ‘/usr/lib/netdata/conf.d’]
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : loading ‘/usr/lib/netdata/conf.d/python.d.conf’
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : ‘/usr/lib/netdata/conf.d/python.d.conf’ is loaded
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : looking for ‘pythond-jobs-statuses.json’ in /var/lib/netdata
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : loading ‘/var/lib/netdata/pythond-jobs-statuses.json’
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : ‘/var/lib/netdata/pythond-jobs-statuses.json’ is loaded
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : [megacli] looking for ‘megacli.conf’ in [‘/etc/netdata/python.d’, ‘/usr/lib/netdata/conf.d/python.d’]
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : [megacli] loading ‘/usr/lib/netdata/conf.d/python.d/megacli.conf’
2021-01-30 07:41:57: python.d DEBUG: plugin[main] : [megacli] ‘/usr/lib/netdata/conf.d/python.d/megacli.conf’ is loaded
2021-01-30 07:41:57: python.d INFO: plugin[main] : [megacli] built 1 job(s) configs
2021-01-30 07:41:57: python.d ERROR: megacli[megacli] : can’t locate “sudo” or “megacli” binary
2021-01-30 07:41:57: python.d INFO: plugin[main] : megacli[megacli] : check failed
2021-01-30 07:41:57: python.d INFO: plugin[main] : no jobs to serve
2021-01-30 07:41:57: python.d INFO: plugin[main] : exiting from main…
I think sudo
is not installed, which is the requirement.
No, it is:
sudo/stable,now 1.8.27-1+deb10u3 amd64 [installed]
ok, do as netdata
user
which sudo
which megacli
/usr/bin/sudo
Nothing is returned for the second one. Which is weird, because in my .bashrc file for the user, I have this: alias megacli=‘/opt/MegaRAID/MegaCli/MegaCli64’
Ok, i see megacli
collector doesn’t allow to set a path to the binary, lets create a soft link so it is able to find it
sudo ln -s /opt/MegaRAID/MegaCli/MegaCli64 /usr/local/bin/megacli
(which megacli
should work after that)
The data is still not populating on the dashboard.
Yeah, we are trying to make debug working, see my 2nd post
try it again
2021-02-01 08:37:27: python.d DEBUG: megacli[megacli] : update => [OK] (elapsed time: 30, failed retries in a row: 0)
2021-02-01 08:37:32: python.d DEBUG: megacli[megacli] : Executing command ‘/usr/bin/sudo -n /usr/local/bin/megacli -LDPDInfo -aAll -NoLog’
BEGIN megacli.adapter_degraded 5000134
SET ‘adapter_0_degraded’ = 0
END
BEGIN megacli.pd_media_error 5000134
SET ‘slot_0_media_error’ = 0
SET ‘slot_1_media_error’ = 0
SET ‘slot_2_media_error’ = 0
SET ‘slot_3_media_error’ = 0
END
BEGIN megacli.pd_predictive_failure 5000134
SET ‘slot_0_predictive_failure’ = 0
SET ‘slot_1_predictive_failure’ = 0
SET ‘slot_2_predictive_failure’ = 0
SET ‘slot_3_predictive_failure’ = 0
END
BEGIN netdata.runtime_megacli 5000134
SET run_time = 29
END
2021-02-01 08:37:32: python.d DEBUG: megacli[megacli] : update => [OK] (elapsed time: 29, failed retries in a row: 0)
Ok, looks good, it works in the debug mode.
- restart netdata.service
- check the dashboard
- if there is no megacli section - likely systemd unit capabilities issue, try Adaptec RAID plugin bug · Issue #10079 · netdata/netdata · GitHub
It still does not appear, even after running those commands. And should netdata be running as the root user?
No, it shouldnt.
Let’s see logs
- restart netdata service
- grep megacli /var/log/netdata/error.log
2021-02-02 10:29:29: netdata LOG FLOOD PROTECTION resuming logging from process ‘netdata’ (prevented 56 logs in the last 1200 seconds).
2021-02-02 10:29:29: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:29:29: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
2021-02-02 10:29:39: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:29:39: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
2021-02-02 10:29:49: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:29:49: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
2021-02-02 10:29:59: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:29:59: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
2021-02-02 10:30:09: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:30:09: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
2021-02-02 10:30:19: netdata ERROR : MAIN : EXPORTING: No suitable servers found (serverSelectionTryOnce
set): [connection refused calling ismaster on ‘192.168.0.76:27017’] (errno 107, Transport endpoint is not connected)
2021-02-02 10:30:19: netdata ERROR : MAIN : EXPORTING: failed to write data to the database ‘mongodb://192.168.0.76’. Willing to write 1416857 bytes, wrote 0 bytes.
that are not megacli related logs
lets clear the error log, restart netdata service and grep for lines that contain megacli work
cd /var/log/netdata/
cp /dev/null error.log
systemctl restart netdata.service
# wait a bit
grep megacli error.log
2021-02-02 17:46:16: python.d INFO: plugin[main] : [megacli] is disabled by default, skipping it
I am not sure why it’s disabled, as I thought I had enabled it somewhere…
Yeah, suspected that. Can be enabled in the python.d.conf
# megacli: yes
=>
megacli: yes