ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Tools / Monitoring robot / Types of checks
  • Overview
  • SMART overview
  • SMART attributes
  • Specific parameters for checking SMART attributes
  • Check via Simple Network Management Protocol (SNMP)
  • Check via Secure Shell (SSH)
  • Configuring servers to return SMART information
  • Configuring a Windows server to return SMART information via SSH
  • Configuring a Linux server to return SMART information via SSH
  • Configuring a Linux server to return SMART information via SNMP
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Check: SMART status of storage drives
Overview
The monitoring robot will measure the SMART attributes of a server's hard drives.
The check will be:
  • successful if no problems are detected.
  • unsuccessful otherwise.

SMART overview

SMART stands for "Self-Monitoring Analysis and Reporting Technology".
All major drive manufacturers support SMART. This technology allows you to monitor the status of a drive over time and thus to anticipate a possible imminent failure.
Drives compatible with this technology feature multiple counters. The number and type of counters can vary according to the manufacturer.
These counters can be read programmatically. This makes it possible to detect premature degradation of drives and even to be warned before a drive fails.
Caution: SMART does not detect all possible cases of drive failure. It does not replace a backup system.

SMART attributes

SMART defines a series of indicators called attributes. Each of these attributes measures a parameter of the drive:
  • internal temperature,
  • number of attempts to read given data,
  • error rate,
  • power-on hours, etc.By monitoring changes in the values of these attributes, it is possible to predict a failure. For example, a rapid and significant increase in temperature
is usually a clear sign of an imminent failure.
To help users interpret these attributes, operating systems generally include tools or APIs that present an overview of the drive status. This makes it possible to determine if the drive is healthy or if it shows signs of weakness.
Specific parameters for checking SMART attributes
Since the SMART status of a drive is checked remotely, it is necessary to:
  • specify how the monitoring robot accesses the server. Two protocols are available: SNMP and SSH. Available options vary according to the specified protocol.
  • ask the monitoring robot to:
    • check all the drives,
    • check only a given list of drives.

Check via Simple Network Management Protocol (SNMP)

If SNMP is used, the following check parameters must be specified:
  • server address (name or IP address),
  • SNMP service port (port 161 by default),
  • the name of the SNMP community to query,
  • the list of OIDs corresponding to the SMART states to be checked. The configuration of the OIDs to be queried is detailed below.
Caution: SNMP is not a secure protocol. It is not recommended for servers exposed to a public network or to the Internet. It is preferable to reserve the use of SNMP to internal servers or servers accessible through a private network (VPN, for example).

Check via Secure Shell (SSH)

If SSH is used, the following information is required:
  • server address (name or IP address),
  • SSH service port (port 22 by default),
  • the username,
  • the password or a private key (and password) to log in with that username.
Several options are available, depending on the operating system of the server (Windows or Linux):
  • Linux servers must be queried using "Smartmontools".
    In this case, you can use the "Use 'sudo'" option to specify if commands must be prefixed with "sudo". The "sudo" command allows unprivileged users to execute commands reserved for root users.
  • Windows servers can be queried either using Windows Management Instrumentation (WMI) or Powershell. Both options are equivalent in terms of functionalities.
Configuring servers to return SMART information

Configuring a Windows server to return SMART information via SSH

WMI or Powershell must be installed on the Windows server.
  • To make sure that WMI is correctly installed on the server, simply open Command Prompt and type:
    wmic diskdrive get PNPDeviceID,Status
  • To make sure that Powershell is correctly installed on the server, simply open Command Prompt as Administrator and type:
    powershell -Command "& {Get-WmiObject -Namespace root/wmi -Class
    MSStorageDriver_FailurePredictStatus Property PredictFailure,InstanceName}"

Configuring a Linux server to return SMART information via SSH

For the robot to properly check a Linux server, the following commands must be available: blkid and smartctl.
On a server of the Debian family (Ubuntu, etc.), these commands are installed with the following command line:
apt install util-linux smartmontools
Additionally, if the user cannot (or should not) log in as root, it will be necessary to:
  • install sudo,
  • configure it to allow the user to run the blkid and smartctl commands without entering their password in the console.

Configuring a Linux server to return SMART information via SNMP

You must:
  • install the same packages as for the checks via SSH.
  • install an SNMP server.
On a server of the Debian family (Ubuntu, etc.), the SNMP is installed with the following command:
apt install snmpd
Then, you must configure the SNMP service. This page does not present the configuration of SNMP. Please refer to its respective documentation.
To read the SMART status of a drive via SNMP, the following directive must be added to the configuration file (generally /etc/snmp/snmpd.conf):
extend smart_test /bin/sh /etc/snmp/
smart_test.sh /dev/sda1
where:
  • smart_test is an arbitrary string,
  • /etc/snmp/smart_test.sh is the path of the reading script (see below),
  • /dev/sda1 is the drive to be analyzed.
This directive must be added for each drive to be analyzed.
Each directive will create a new custom OID that will be read by the robot.
Tip: To get the exact OID created by the "extend" command, simply run the following command on the server:
snmpwalk -c public -v 2c localhost
1.3.6.1.4.1.8072.1.3.2.4.1.2
The smart_test.sh script contains the following command:
sudo smartctl -H $1 | grep "SMART
overall-health self-assessment test result"
| cut -d: -f 2
It must be adapted according to the system (to use or not use the "sudo" command, for example).
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/15/2023

Send a report | Local help