ajclark / datadog-smartmon Goto Github PK
View Code? Open in Web Editor NEWDataDog plugin to report hard drive metrics
DataDog plugin to report hard drive metrics
I have a centos 8 and v7.29.1 version of the datadog agent. I've done all the mentioned settings, but it seems that the script doesn't collect any metrics. The output of the datadog agent status follows:
smartmon (unversioned)
----------------------
Instance ID: smartmon:d884b5186b651429 [OK]
Configuration Source: file:/etc/datadog-agent/conf.d/smartmon.yaml
Total Runs: 85
Metric Samples: Last Run: 0, Total: 0
Events: Last Run: 0, Total: 0
Service Checks: Last Run: 0, Total: 0
Average Execution Time: 19ms
Last Execution Date : 2021-07-21 14:09:40 UTC (1626876580000)
Last Successful Execution Date : 2021-07-21 14:09:40 UTC (1626876580000)
Feb 12 03:21:19 nasbox dd.collector[19579]: ERROR (init.py:812): Check 'smartmon' instance #0 failed#012Traceback (most recent call last):#1
2 File "/opt/datadog-agent/agent/checks/init.py", line 795, in run#012 self.check(copy.deepcopy(instance))#12 File "/etc/dd-agent/check
s.d/smartmon.py", line 12, in check#012 devlist = DeviceList()#12 File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMART/devi
ce_list.py", line 51, in init#12 self._initialize()#12 File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMART/device_lis
t.py", line 106, in initialize#012 self.devices.append(Device(name))#12 File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMA
RT/device.py", line 140, in init#12 self.update()#12 File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMART/device.py",
line 461, in update#012 ASCQ = line[2][:-1]#012IndexError: list index out of range
when using smartctl, you need to pass in -d megaraid,x to indicate the drive to collect, so say you have two drives, you would do something like
smartctl -A /dev/sda -d megaraid,0
smartctl -A /dev/sda -d megaraid,1
can this be updated to support arrays?
PDT | ERROR | (autoconfig.go:248 in getChecksFromConfigs) | Unable to load the check: unable to load any check from config 'smartmon'
sudo -u dd-agent -- datadog-agent check smartmon
Error: could not load smartmon:
* Core Check Loader: Check smartmon not found in Catalog
* JMX Check Loader: check is not a jmx check, or unable to determine if it's so
* Python Check Loader: ['Traceback (most recent call last):\n', ' File "/etc/datadog-agent/checks.d/smartmon.py", line 1, in <module>\n from pySMART import DeviceList\n', ' File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMART/__init__.py", line 108, in <module>\n from .device import Device, smart_health_assement\n', ' File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/pySMART/device.py", line 768\n', ' *self.smart_options,\n', ' ^\n', 'SyntaxError: invalid syntax\n']
Error: no valid check found
Usage:
agent check <check_name> [flags]
Hi Allan,
Thanks for this project, i got some issue when execute "sudo -u dd-agent -- datadog-agent check smartmon" :
`
smartmon (unversioned)
----------------------
Instance ID: smartmon:d884b5186b651429 [WARNING]
Total Runs: 1
Metric Samples: Last Run: 13, Total: 13
Events: Last Run: 0, Total: 0
Service Checks: Last Run: 0, Total: 0
Average Execution Time : 697ms
Warning: Metric: 'smartmon.Reallocated_Sector_Ct' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Power_On_Hours' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Reallocated_Sector_Ct' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Power_On_Hours' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Reallocated_Sector_Ct' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Power_On_Hours' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Reallocated_Sector_Ct' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Power_On_Hours' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Reallocated_Sector_Ct' has non float value: '-'. Only float values can be submitted as metrics.
Warning: Metric: 'smartmon.Power_On_Hours' has non float value: '-'. Only float values can be submitted as metrics.
Check has run only once, if some metrics are missing you can try again with --check-rate to see any other metric if available.
Can you check it?
Regards,
@ajclark plugin works great. You may just want to update the following so it matches the latest DataDog install paths?
CHANGE FROM:
Copy over the custom check and check config file to the DataDog agent install directory
cp smartmon.yaml /etc/dd-agent/conf.d/
cp smartmon.py /etc/dd-agent/checks.d/
CHANGE TO
Copy over the custom check and check config file to the DataDog agent install directory
cp smartmon.yaml /etc/datadog-agent/conf.d/
cp smartmon.py /etc/datadog-agent/checks.d/
Just a thought
Hass
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.