Testing Predictive Failure Alerts and Actions

Top  Previous  Next

In the event of a disk-related predictive failure, the program initiates the following actions in this order:

 

1.It sends a message in your host operating systems's standard event log.  If you invoked the program with the -L option, the message is appended to a flat text file instead.
2.If you invoked the program with the -M option, the software will send the event information to the appropriate email address that was supplied with the -M command. Windows users will also need to pre-configure the SMTP settings by using the -Mail command, and also supply the -N flag on the command-line which specifies the IP name of the mail server you wish to use. UNIX//LINUX users need not worry about specifying the SMTP server on the command-line. This is because the software invokes the standard mail or mailx program on your host O/S, which uses the default SMTP server that was configured by your system administrator.
3.If the -LB option was added to the command-line, the final step is that the software launches the program or script or batch (.BAT) file that was supplied with the -LB command. It passes that file information about the physical device name, make/model information, and the event log data. Your application can either use or ignore that information.  It is important to note that smartmon-ux will SUSPEND itself until the program completes. For testing purposes, you should use a simple program that returns quickly and makes it quite obvious that it worked.

       

You may concurrently test email, event logging, and auto launch programs by appending the -T command with any combination of -M, -L, and -LB flags.

 

Testing E-MAIL Configuration (Windows Users Only)

If you are running a Windows-family operating system, you must first configure the SMTP E-Mail settings by using the -Mail command. This function is an interactive one that will allow you to add/change/unconfigure email accounts on your system.

 

Once you have configured the settings, send a test message by entering something like:

smartmon-ux -T somebody@somewhere.com -N smtp.yourcompany.com

 

somebody@somewhere.com is who you want to send the message to, and smtp.yourcompany.com is the IP name of the mail server that your system administrator has set up to use.

If there is an error, an appropriate message will usually be returned which can assist with resolving the problem.

 

Here are some sample error messages. Note, if you add a physical device path to a disk drive, this will prevent your host from scanning and reporting all physical devices on your system before testing mail.

 

C:\Program Files\SANTOOLS>smartmon-ux -T bogusaddress@mycompany.com -N invalidipname.mycompany.com

SMARTMon-ux [Release 1.29, Build  4-AUG-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Fatal error from smartmon-ux recorded at 8/4/2005 19:15:23 PM

Program Halted.

You have supplied a SMTP server but have not configured the settings. Enter smartmon-ux -Mail to configure it.

 

 

C:\Program Files\SANTOOLS>smartmon-ux -T myemailaddress@mycompany.com -N smtp.mycompany.com \\.\PHYSICALDRIVE0

SMARTMon-ux [Release 1.29, Build 4-AUG-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered HITACHI_DK23EA-60 S/N "JP7348" on \\.\PhysicalDrive0 (SMART Enabled)

\\.\PhysicalDrive0 polled at Thu Aug 04 19:20:52 2005 Status:FAILED - Failure imminent (THIS IS A TEST)

No response from SMTP server smtp.mycompany.com

 

 

C:\Program Files\SANTOOLS>smartmon-ux -T david@santools.com -N smtp.sanmanager.local \\.\PHYSICALDRIVE0

SMARTMon-ux [Release 1.29, Build  6-AUG-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered HITACHI_DK23EA-60 S/N "JP7348" on \\.\PhysicalDrive0 (SMART Enabled)

\\.\PhysicalDrive0 polled at Sat Aug 06 23:22:13 2005 Status:FAILED - Failure imminent (THIS IS A TEST)

SMTP Error "SMTP server error response" 535 5.7.3 Authentication unsuccessful.

 

Some problems may never get back to you like if you sent a message to a non-existent email address. This is because many system administrators no longer send bounce-back messages due to the abuses of spammers. It may also take up to 60 seconds for an error message to come back, depending on the type of problem you have and mail server settings.

 

Testing E-MAIL Configuration (UNIX/LINUX and non-Windows Operating Systems)

SMARTMON-UX sends messages by passing them to a native mailer which does all of the work. This mail program is called mailx on Solaris, HP/UX, IRIX, TRU64 and FreeBSD.  Solaris, AIX, LINUX, UNIXWARE, and OS X use the program mail. Your operating system must first be configured to work with these programs.

 

Consult your operating system's documentation for the proper use of mail and mailx, and send a test message using this program. If the test message is successfully received, you can try to send a message from within SMARTMon-UX .

 

Enter:

/etc/smartmon-ux -T somebody@somewhere.com  (substitute the email address with your own) and you should receive the message. Note that only windows users have to use the -N flag to specify a mail server.

 

Testing Auto-Launch Program

In order to test the program's ability to spawn a program in the event of a predictive failure, invoke the program with the -T option, and add -LB ProgramName where you substitute ProgramName for your application. As SMARTMon-UX passes the auto-launch program parameters, you should test to see that they are being interpreted correctly.

 

Auto launch Test Batch File (Windows)

1. Create the file c:\Program Files\Scratch Directory\MyApplicationTest.bat with the following content:

@echo off

echo Successfully launched %0

echo Parameter#1 = %1

echo Parameter#2 = %2

echo Parameter#3 = %3

echo Parameter#4 = %4

echo Returning with exit code 1234

exit 1234

 

2. CD to where the program was installed.

 

3. (Optional) Enter smartmon-ux -T -LB C:\Program Files\Scratch Directory\MyApplicationTest

You will get an error message that tells you to use the short filename for the auto launch program because of the imbedded space you have in "Program Files". The message will also tell you to use the DIR /X command to learn the short file name.

 

4. Enter smartmon-ux -T -LB C:\Progra~1\Scratch Directory\MyApplicationTest.bat

The output should be similar to:

C:\Program Files\SMARTMon>smartmon-ux -T -LB C:\Progra~1\Scratch Directory\MyApplicationTest.bat

SMARTMon-ux [Release 1.29, Build  6-AUG-2005] - Copyright 2001-2005 SANtools, Inc. http://www.SANtools.com

Discovered HITACHI_DK23EA-60 S/N "JP7348" on \\.\PhysicalDrive0 (SMART Enabled)

\\.\PhysicalDrive0 polled at Sat Aug 06 13:59:07 2005 Status:FAILED - Failure imminent (THIS IS A TEST)

Successfully launched D:\Progra~1\Scratch Directory\MyApplicationTest.BAT

Parameter#1 = "\\.\PhysicalDrive0"

Parameter#2 = "HITACHI_DK23EA-60"

Parameter#3 = "JP73338"

Parameter#4 = "\\.\PhysicalDrive0 polled at Sat Aug 06 13:59:07 2005 Status:FAILED - Failure imminent (THIS IS A TEST)"

Returning with exit code 1234

 

Launched batch file "C:\Progra~1\Scratch Directory\MyApplicationTest.BAT" which returned user-defined value 1234

C:\Program Files\SMARTMon>

 

You will note that the path, make/model of the "defective" disk, serial number, and full text message is passed to the MyApplicationTest batch file, along with the return code. SMARTMon-UX currently ignores he return code, except in cases where the program failed to launch.

 

Auto launch Test Batch File (UNIX Family)

The process test is similar to windows.

1. Create a test file called /tmp/MyApplicationTest.sh The contents can be:

#!/bin/sh

echo "Parameter#1 =" "$1"

echo "Parameter#1 =" "$2"

echo "Parameter#1 =" "$3"

echo "Parameter#1 =" "$4"

exit 1234

 

2. Enter chmod 744 /tmp/MyApplicationTest.sh

3. Enter /etc/smartmon-ux -T -LB /tmp/MyApplicationTest.sh

 

The MyApplicationTest.sh script will execute in the same manner as the windows batch file, and return similar output.

 

Testing Event Log Entries

If you invoke the program with both the -T and the -L flag, a sample alert message will be logged to the smartmon-ux flat log file. Otherwise, the software will log a test message in the standard Application Event Log on Windows machines or via the standard syslog mechanism.