Notification of severe failures like ZFS degraded pools?

hotzen

Limp Gawd
Joined
Jan 29, 2011
Messages
349
How do you check whether your zpools are still fine?
SSHing every other day is not an option for me, I want at least an email and better yet: I want to get killed by that tiny but loud piezo-speaker of the mainboard ;)

How do you accomplish notifications of zfs-failures, or more general of any severe server-failures? Im particulary interested in solaris-solutions but FreeBSD-specific solutions are just fine as a general advice.

Thanks
 
I know of this solution but I hate perl-code and I want to extend it if needed, which forbids Perl as well as any other seemingly RSA-encrypted source...
 
I know of this solution but I hate perl-code and I want to extend it if needed, which forbids Perl as well as any other seemingly RSA-encrypted source...

Not all perl is unreadable. You might take a look at the source before writing it off.
 
As I have tested napp-it, I actually had a look into the source.
ZFSGuru's PHP-Code is pretty straight forward but I dont feel like digging through napp-it.

So, if there is no nice solution yet, I will periodically check zpool status with a cronjob'd python-script..
 
I use a python and a sh script. I could probaby integrate them together, but I'm too lazy :p
#!/bin/sh

send=0

# Check zpool status
status=$( /sbin/zpool status -x )

if [ "${status}" != "all pools are healthy" ]; then
zpoolmsg="Problems with ZFS: ${status}"
send=1
fi

# Send status e-mail if needed
if [ "${send}" -eq 1 ]; then
/usr/local/bin/python ~/scripts/zfsmail.py
else
echo "0" > /home/olav/log/mailstatus
fi
exit 0

# Import smtplib for the actual sending function
import os
import sys
import smtplib
import mimetypes
from email.Encoders import encode_base64
from email.MIMEAudio import MIMEAudio
from email.MIMEBase import MIMEBase
from email.MIMEImage import MIMEImage
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

file = open("/home/olav/log/mailstatus", "r")
filetext = file.read()
file.close()
if filetext != "1":

FROM = '[email protected]'
TO = '[email protected]'
SUBJECT = 'degraded pool'
MSGBODY = 'Check zpool health'
MAILSERVER = 'smtp.xxxxx.net'
port = 25

zpoolStatus = os.popen("/sbin/zpool status")
MSGBODY = MSGBODY + "\r\n" + zpoolStatus.read()
# trim the strings of any leading or trailing spaces
FROM = FROM.strip()
TO = TO.strip()
SUBJECT = SUBJECT.strip()
MSGBODY = MSGBODY.strip()
MAILSERVER = MAILSERVER.strip()

#Connect to server
print 'Connecting to mail server ', MAILSERVER
try:
s = smtplib.SMTP(MAILSERVER,port)
#s.set_debuglevel(1)
except:
print 'ERROR: Unable to connect to mail server', MAILSERVER
sys.exit(1)

# get list of email addresses to send to
ToList = TO.split(';')
print 'Sending email to ', ToList

# set up email parameters
msg = MIMEMultipart()
msg['From'] = FROM
msg['To'] = TO
msg['Subject'] = SUBJECT
msg.attach(MIMEText(MSGBODY))

# send email
s.sendmail(FROM, ToList, msg.as_string())
s.quit()
s.close()

file = open("/home/olav/log/mailstatus","w")
file.write("1")
 
Awesome, that is what I am looking for. Thanks!

BTW, is there any easy way to *BEEP* the onboard piezo-speakers of the mainboard?
 
Sharing back an improved version of olavgg's script. It integrates both scripts into a single .py, also does disk SMART health checking (assuming you've compiled smartmontools) and sends email over SSL + authentication.

Code:
# Import smtplib for the actual sending function
import os
import sys
import smtplib
import mimetypes
from email.Encoders import encode_base64
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

def sendAlertMail(subj, body):
	#print("sending mail...")
	FROM = '[email protected]'
	TO = '[email protected]'
	MAILSERVER = 'smtp.mail.com'
	PORT = 465
	MLOGIN = 'mylogin'
	MPASSWORD = 'mypassword'
	
	try:
		s = smtplib.SMTP_SSL(MAILSERVER, PORT)
		#s.set_debuglevel(1)
		s.login(MLOGIN, MPASSWORD)
		
		msg = MIMEMultipart()
		msg['From'] = FROM
		msg['To'] = TO
		msg['Subject'] = subj
		msg.attach(MIMEText(body))
		
		#send it
		s.sendmail(FROM, TO.split(";"), msg.as_string())
		#print("sending successful")
		s.quit()
		s.close()
	except Exception, e:
		print e
		sys.exit(1)
	
	sys.exit(0)

# uncomment the line below to test emailing
#sendAlertMail('ZFS NAS test', os.popen("/sbin/zpool status").read().strip())

# zpool checking
if os.popen("/sbin/zpool status -x").read().strip() != "all pools are healthy":
        sendAlertMail("ZFS NAS alert: zpool error", os.popen("/sbin/zpool status").read().strip())

# SMART checking
# include disks to be checked in the list
disks = ['/dev/rdsk/c3t2d0', '/dev/rdsk/c3t3d0', '/dev/rdsk/c3t4d0']
for disk in disks:
        s = os.popen('/usr/local/sbin/smartctl -a -d scsi ' + disk + ' | grep "SMART Health Status"').read().strip()
        if s != "SMART Health Status: OK":
                sendAlertMail("ZFS NAS alert: SMART error", os.popen('/usr/local/sbin/smartctl -a -d scsi ' + disk).read().strip())

sys.exit(0)

The script has to be run as root because of smartctl. I run it on an hourly cronjob. Edit as required :)
 
Thank you very much, I modularized it a bit and added detailed information to the error-messages:

Code:
# [H]ardForum
# http://hardforum.com/showthread.php?t=1595773

import os
import sys
import smtplib
import mimetypes
from email.Encoders import encode_base64
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText


# =====================================
# CONFIG

TEST = True

FROM       = '[email protected]'
TO         = '[email protected]'
MAILSERVER = 'smtp.host.tld'
PORT       = 25
MLOGIN     = 'user'
MPASSWORD  = 'xxx'


# =====================================
# LIB

# open a connection to the SMTP-Server
def initSMTP():
  try:
    # USE SSL/LS INSTEAD
    #s = smtplib.SMTP_SSL(MAILSERVER, PORT)

    s = smtplib.SMTP(MAILSERVER, PORT)

    # DETAILED TRACE
    # s.set_debuglevel(1)

    s.login(MLOGIN, MPASSWORD)
    return s
  except Exception, e:
    print e
    sys.exit(1)


# close the SMTP-connection
def closeSMTP(s):
  s.quit()
  s.close()


# send an E-Mail using specified SMTP-Connection
def sendMail(s, subj, body):
  try:
    msg = MIMEMultipart()
    msg['From']    = FROM
    msg['To']      = TO
    msg['Subject'] = subj
    msg.attach(MIMEText(body))

    s.sendmail(FROM, TO.split(";"), msg.as_string())
  except Exception, e:
    print e
    sys.exit(1)


# execute a command and return its output
def cmd(c):
  try:
    proc = os.popen(c)
    out  = proc.read().strip()
    return out
  except Exception, e:
    print e
    sys.exit(1)


# create a summary-text of failed-command's output and additional details
def summary(failed, details):
  s  = failed
  s += "\n----------\n\n"
  s += details
  return s


# =====================================
# START

# connect to SMTP
s = initSMTP( )

# ZPool checking
zpoolStatusX =  cmd("/sbin/zpool status -x")

if TEST or zpoolStatusX.find("all pools are healthy") == -1:
  zpoolStatus = cmd("/sbin/zpool status")
  txt = summary(zpoolStatusX, zpoolStatus)
  sendMail(s, "[NAS] ZPool Status", txt)


# SMART checking
disks = [
    '/dev/rdsk/c8t1d0'
  , '/dev/rdsk/c8t2d0'
  , '/dev/rdsk/c8t3d0'
]

for disk in disks:
  smartHealth = cmd('/opt/smartmon/sbin/smartctl --health -d scsi ' + disk)
  if TEST or smartHealth.find("SMART Health Status: OK") == -1:
    smart = cmd('/opt/smartmon/sbin/smartctl --all -d sat,12 ' + disk)
    txt   = summary(smartHealth, smart)
    sendMail(s, "[NAS] S.M.A.R.T. " + disk, txt)

closeSMTP(s)
sys.exit(0)
 
No, just as a cronjob like the original author.
Since this script is no service/daemon, I dont know whether it suits the SMF...
 
Added Service-checking via "svcs -x"
Added "Everything is OK"-option
Cleaned Config
Missing: *BEEP* :(

Code:
# [H]ardForum
# http://hardforum.com/showthread.php?t=1595773

import os
import sys
import smtplib
import mimetypes
from email.Encoders import encode_base64
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText


# =====================================
# CONFIG

TEST = False

MAIL_FROM = '[email protected]'
MAIL_TO   = '[email protected]'
MAIL_HOST = 'smtp.host.tld'
MAIL_PORT = 25 # 465 SSL/TLS
MAIL_USER = 'foo'
MAIL_PASS = '42'

MAIL_ALL_OK = True # Even send an EMail if everything is OK

CMD_SVCS     = '/usr/bin/svcs'
CMD_ZPOOL    = '/sbin/zpool'
CMD_SMARTCTL = '/opt/smartmon/sbin/smartctl'

DISKS = [
    '/dev/rdsk/c8t1d0'
  , '/dev/rdsk/c8t2d0'
  , '/dev/rdsk/c8t3d0'
]


# =====================================
# LIB

# open a connection to the SMTP-Server
def initSMTP():
  try:
    # USE SSL/TLS INSTEAD
    #s = smtplib.SMTP_SSL(MAIL_HOST, MAIL_PORT)
    s = smtplib.SMTP(MAIL_HOST, MAIL_PORT)

    # DETAILED TRACE
    # s.set_debuglevel(1)

    s.login(MAIL_USER, MAIL_PASS)
    return s
  except Exception, e:
    print e
    sys.exit(1)

# close the SMTP-connection
def closeSMTP(s):
  s.quit()
  s.close()

# send an E-Mail using specified SMTP-Connection
def sendMail(s, subj, body):
  try:
    msg = MIMEMultipart()
    msg['From']    = MAIL_FROM
    msg['To']      = MAIL_TO
    msg['Subject'] = subj
    msg.attach(MIMEText(body))
	
    s.sendmail(MAIL_FROM, MAIL_TO.split(";"), msg.as_string())
  except Exception, e:
    print e
    sys.exit(1)

# execute a command and return its output
def cmd(c):
  try:
    proc = os.popen(c)
    out  = proc.read().strip()
    return out
  except Exception, e:
    print e
    sys.exit(1)

# create a summary-text of failed-command's output and additional details
def summary(failed, details):
  s  = failed
  s += "\n----------\n\n"
  s += details
  return s


# =====================================
# START
alert = False

# connect to SMTP
s = initSMTP()

# Services
svcsX = cmd(CMD_SVCS + ' -x')
if TEST or len(svcsX) > 0:
  alert = True
  svcsXV = cmd(CMD_SVCS + ' -x -v')
  txt = summary(svcsX, svcsXV)
  sendMail(s, "[NAS] Services failed", txt)

# ZFS Pool checking
zpoolStatusX = cmd(CMD_ZPOOL + ' status -x')
if TEST or zpoolStatusX.find("all pools are healthy") == -1:
  alert = True
  zpoolStatus = cmd(CMD_ZPOOL + ' status')
  txt = summary(zpoolStatusX, zpoolStatus)
  sendMail(s, "[NAS] ZFS Pool Status", txt)

# SMART checking
for disk in DISKS:
  smartHealth = cmd(CMD_SMARTCTL + ' --health -d scsi ' + disk)
  if TEST or smartHealth.find("SMART Health Status: OK") == -1:
    alert = True
    smart = cmd(CMD_SMARTCTL + ' --all -d sat,12 ' + disk)
    txt   = summary(smartHealth, smart)
    sendMail(s, "[NAS] S.M.A.R.T. " + disk, txt)

# OK
if alert == False and MAIL_ALL_OK == True:
  sendMail(s, "[NAS] O.K.", "Everything is fine")

closeSMTP(s)
sys.exit(0)
 
Seems a bit overkill, isn't it?
Will look into nagios as soon as I can virtualize it, thank you.
 
Seems a bit overkill, isn't it?
Will look into nagios as soon as I can virtualize it, thank you.

That script can be run independently of Nagios.

It would also be a good script to look at and see their approach, how they checked for X.

Just came into my head so I thought I would throw it out there.
 
Hi All,

I have installed multiple server with OmniOS and use the same python script as what is recommended here.

Now on a new server, when I run the python script, I got the following error:
[Errno 8] node name or service name not known

I run the python script with -d -v and this is the output:
Code:
root@sgsan10:~/scripts# python -d -v sgsan10_zfs_check_disk_n_pool_status.py

# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.6/site.pyc matches /usr/lib/python2.6/site.py
import site # precompiled from /usr/lib/python2.6/site.pyc
# /usr/lib/python2.6/os.pyc matches /usr/lib/python2.6/os.py
import os # precompiled from /usr/lib/python2.6/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.6/posixpath.pyc matches /usr/lib/python2.6/posixpath.py
import posixpath # precompiled from /usr/lib/python2.6/posixpath.pyc
# /usr/lib/python2.6/stat.pyc matches /usr/lib/python2.6/stat.py
import stat # precompiled from /usr/lib/python2.6/stat.pyc
# /usr/lib/python2.6/genericpath.pyc matches /usr/lib/python2.6/genericpath.py
import genericpath # precompiled from /usr/lib/python2.6/genericpath.pyc
# /usr/lib/python2.6/warnings.pyc matches /usr/lib/python2.6/warnings.py
import warnings # precompiled from /usr/lib/python2.6/warnings.pyc
# /usr/lib/python2.6/linecache.pyc matches /usr/lib/python2.6/linecache.py
import linecache # precompiled from /usr/lib/python2.6/linecache.pyc
# /usr/lib/python2.6/types.pyc matches /usr/lib/python2.6/types.py
import types # precompiled from /usr/lib/python2.6/types.pyc
# /usr/lib/python2.6/UserDict.pyc matches /usr/lib/python2.6/UserDict.py
import UserDict # precompiled from /usr/lib/python2.6/UserDict.pyc
# /usr/lib/python2.6/_abcoll.pyc matches /usr/lib/python2.6/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.6/_abcoll.pyc
# /usr/lib/python2.6/abc.pyc matches /usr/lib/python2.6/abc.py
import abc # precompiled from /usr/lib/python2.6/abc.pyc
# /usr/lib/python2.6/copy_reg.pyc matches /usr/lib/python2.6/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.6/copy_reg.pyc
# zipimport: found 78 names in /usr/lib/python2.6/vendor-packages/setuptools-0.6c11-py2.6.egg
import encodings # directory /usr/lib/python2.6/encodings
# /usr/lib/python2.6/encodings/__init__.pyc matches /usr/lib/python2.6/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.6/encodings/__init__.pyc
# /usr/lib/python2.6/codecs.pyc matches /usr/lib/python2.6/codecs.py
import codecs # precompiled from /usr/lib/python2.6/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.6/encodings/aliases.pyc matches /usr/lib/python2.6/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.6/encodings/aliases.pyc
# /usr/lib/python2.6/encodings/ascii.pyc matches /usr/lib/python2.6/encodings/ascii.py
import encodings.ascii # precompiled from /usr/lib/python2.6/encodings/ascii.pyc
Python 2.6.8 (unknown, Apr 28 2014, 04:29:50)
[GCC 4.8.1] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
# /usr/lib/python2.6/smtplib.pyc matches /usr/lib/python2.6/smtplib.py
import smtplib # precompiled from /usr/lib/python2.6/smtplib.pyc
# /usr/lib/python2.6/socket.pyc matches /usr/lib/python2.6/socket.py
import socket # precompiled from /usr/lib/python2.6/socket.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/_socket.so", 2);
import _socket # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/_socket.so
dlopen("/usr/lib/python2.6/lib-dynload/64/_ssl.so", 2);
import _ssl # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/_ssl.so
dlopen("/usr/lib/python2.6/lib-dynload/64/cStringIO.so", 2);
import cStringIO # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/cStringIO.so
# /usr/lib/python2.6/re.pyc matches /usr/lib/python2.6/re.py
import re # precompiled from /usr/lib/python2.6/re.pyc
# /usr/lib/python2.6/sre_compile.pyc matches /usr/lib/python2.6/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.6/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.6/sre_parse.pyc matches /usr/lib/python2.6/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.6/sre_parse.pyc
# /usr/lib/python2.6/sre_constants.pyc matches /usr/lib/python2.6/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.6/sre_constants.pyc
import email # directory /usr/lib/python2.6/email
# /usr/lib/python2.6/email/__init__.pyc matches /usr/lib/python2.6/email/__init__.py
import email # precompiled from /usr/lib/python2.6/email/__init__.pyc
import email.mime # directory /usr/lib/python2.6/email/mime
# /usr/lib/python2.6/email/mime/__init__.pyc matches /usr/lib/python2.6/email/mime/__init__.py
import email.mime # precompiled from /usr/lib/python2.6/email/mime/__init__.pyc
# /usr/lib/python2.6/email/utils.pyc matches /usr/lib/python2.6/email/utils.py
import email.utils # precompiled from /usr/lib/python2.6/email/utils.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/time.so", 2);
import time # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/time.so
# /usr/lib/python2.6/base64.pyc matches /usr/lib/python2.6/base64.py
import base64 # precompiled from /usr/lib/python2.6/base64.pyc
# /usr/lib/python2.6/struct.pyc matches /usr/lib/python2.6/struct.py
import struct # precompiled from /usr/lib/python2.6/struct.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/_struct.so", 2);
import _struct # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/_struct.so
dlopen("/usr/lib/python2.6/lib-dynload/64/binascii.so", 2);
import binascii # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/binascii.so
# /usr/lib/python2.6/random.pyc matches /usr/lib/python2.6/random.py
import random # precompiled from /usr/lib/python2.6/random.pyc
# /usr/lib/python2.6/__future__.pyc matches /usr/lib/python2.6/__future__.py
import __future__ # precompiled from /usr/lib/python2.6/__future__.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/math.so", 2);
import math # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/math.so
dlopen("/usr/lib/python2.6/lib-dynload/64/_random.so", 2);
import _random # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/_random.so
# /usr/lib/python2.6/urllib.pyc matches /usr/lib/python2.6/urllib.py
import urllib # precompiled from /usr/lib/python2.6/urllib.pyc
# /usr/lib/python2.6/string.pyc matches /usr/lib/python2.6/string.py
import string # precompiled from /usr/lib/python2.6/string.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/strop.so", 2);
import strop # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/strop.so
# /usr/lib/python2.6/urlparse.pyc matches /usr/lib/python2.6/urlparse.py
import urlparse # precompiled from /usr/lib/python2.6/urlparse.pyc
# /usr/lib/python2.6/collections.pyc matches /usr/lib/python2.6/collections.py
import collections # precompiled from /usr/lib/python2.6/collections.pyc
dlopen("/usr/lib/python2.6/lib-dynload/64/_collections.so", 2);
import _collections # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/_collections.so
dlopen("/usr/lib/python2.6/lib-dynload/64/operator.so", 2);
import operator # dynamically loaded from /usr/lib/python2.6/lib-dynload/64/operator.so
# /usr/lib/python2.6/keyword.pyc matches /usr/lib/python2.6/keyword.py
import keyword # precompiled from /usr/lib/python2.6/keyword.pyc
# /usr/lib/python2.6/ssl.pyc matches /usr/lib/python2.6/ssl.py
import ssl # precompiled from /usr/lib/python2.6/ssl.pyc
# /usr/lib/python2.6/textwrap.pyc matches /usr/lib/python2.6/textwrap.py
import textwrap # precompiled from /usr/lib/python2.6/textwrap.pyc
# /usr/lib/python2.6/email/_parseaddr.pyc matches /usr/lib/python2.6/email/_parseaddr.py
import email._parseaddr # precompiled from /usr/lib/python2.6/email/_parseaddr.pyc
# /usr/lib/python2.6/quopri.pyc matches /usr/lib/python2.6/quopri.py
import quopri # precompiled from /usr/lib/python2.6/quopri.pyc
# /usr/lib/python2.6/email/encoders.pyc matches /usr/lib/python2.6/email/encoders.py
import email.encoders # precompiled from /usr/lib/python2.6/email/encoders.pyc
# /usr/lib/python2.6/hmac.pyc matches /usr/lib/python2.6/hmac.py
import hmac # precompiled from /usr/lib/python2.6/hmac.pyc
# /usr/lib/python2.6/email/base64mime.pyc matches /usr/lib/python2.6/email/base64mime.py
import email.base64mime # precompiled from /usr/lib/python2.6/email/base64mime.pyc
# /usr/lib/python2.6/mimetypes.pyc matches /usr/lib/python2.6/mimetypes.py
import mimetypes # precompiled from /usr/lib/python2.6/mimetypes.pyc
# /usr/lib/python2.6/email/mime/base.pyc matches /usr/lib/python2.6/email/mime/base.py
import email.mime.base # precompiled from /usr/lib/python2.6/email/mime/base.pyc
# /usr/lib/python2.6/email/message.pyc matches /usr/lib/python2.6/email/message.py
import email.message # precompiled from /usr/lib/python2.6/email/message.pyc
# /usr/lib/python2.6/uu.pyc matches /usr/lib/python2.6/uu.py
import uu # precompiled from /usr/lib/python2.6/uu.pyc
# /usr/lib/python2.6/email/charset.pyc matches /usr/lib/python2.6/email/charset.py
import email.charset # precompiled from /usr/lib/python2.6/email/charset.pyc
# /usr/lib/python2.6/email/quoprimime.pyc matches /usr/lib/python2.6/email/quoprimime.py
import email.quoprimime # precompiled from /usr/lib/python2.6/email/quoprimime.pyc
# /usr/lib/python2.6/email/errors.pyc matches /usr/lib/python2.6/email/errors.py
import email.errors # precompiled from /usr/lib/python2.6/email/errors.pyc
# /usr/lib/python2.6/email/iterators.pyc matches /usr/lib/python2.6/email/iterators.py
import email.iterators # precompiled from /usr/lib/python2.6/email/iterators.pyc
# /usr/lib/python2.6/email/mime/multipart.pyc matches /usr/lib/python2.6/email/mime/multipart.py
import email.mime.multipart # precompiled from /usr/lib/python2.6/email/mime/multipart.pyc
# /usr/lib/python2.6/email/mime/text.pyc matches /usr/lib/python2.6/email/mime/text.py
import email.mime.text # precompiled from /usr/lib/python2.6/email/mime/text.pyc
# /usr/lib/python2.6/email/mime/nonmultipart.pyc matches /usr/lib/python2.6/email/mime/nonmultipart.py
import email.mime.nonmultipart # precompiled from /usr/lib/python2.6/email/mime/nonmultipart.pyc
[Errno 8] node name or service name not known
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# clear sys.path_hooks
# clear sys.path_importer_cache
# clear sys.meta_path
# clear sys.flags
# clear sys.float_info
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] collections
# cleanup[1] smtplib
# cleanup[1] zipimport
# cleanup[1] signal
# cleanup[1] quopri
# cleanup[1] cStringIO
# cleanup[1] mimetypes
# cleanup[1] encodings
# cleanup[1] abc
# cleanup[1] math
# cleanup[1] _struct
# cleanup[1] __future__
# cleanup[1] _collections
# cleanup[1] operator
# cleanup[1] sre_constants
# cleanup[1] _warnings
# cleanup[1] _codecs
# cleanup[1] keyword
# cleanup[1] posix
# cleanup[1] encodings.aliases
# cleanup[1] exceptions
# cleanup[1] site
# cleanup[1] strop
# cleanup[1] encodings.ascii
# cleanup[1] urlparse
# cleanup[1] hmac
# cleanup[1] codecs
# cleanup[2] email.iterators
# cleanup[2] random
# cleanup[2] email.mime.text
# cleanup[2] email.mime
# cleanup[2] struct
# cleanup[2] base64
# cleanup[2] string
# cleanup[2] textwrap
# cleanup[2] ssl
# cleanup[2] email.quoprimime
# cleanup[2] email.encoders
# cleanup[2] urllib
# cleanup[2] re
# cleanup[2] email.mime.base
# cleanup[2] email.errors
# cleanup[2] email
# cleanup[2] UserDict
# cleanup[2] os
# cleanup[2] _sre
# cleanup[2] email.charset
# cleanup[2] posixpath
# cleanup[2] errno
# cleanup[2] _socket
# cleanup[2] binascii
# cleanup[2] email._parseaddr
# cleanup[2] os.path
# cleanup[2] email.utils
# cleanup[2] uu
# cleanup[2] socket
# cleanup[2] sre_parse
# cleanup[2] copy_reg
# cleanup[2] sre_compile
# cleanup[2] _random
# cleanup[2] email.message
# cleanup[2] email.mime.nonmultipart
# cleanup[2] _abcoll
# cleanup[2] genericpath
# cleanup[2] stat
# cleanup[2] _ssl
# cleanup[2] warnings
# cleanup[2] types
# cleanup[2] email.base64mime
# cleanup[2] email.mime.multipart
# cleanup[2] linecache
# cleanup[2] time
# cleanup sys
# cleanup __builtin__
# cleanup ints: 505 unfreed ints
# cleanup floats: 31 unfreed floats
[CODE]

I do not know what went wrong. Can someone advise me?

Thanks and Regards.
 
If so, cant you just use svccfg ?

svccfg setnotify problem-diagnosed mailto:[email protected]

No need for PERL or such, it will send you a fancy report with the problem details and any corrective action it attempted.
 
A mini-script that calls a zpool status for a non online state is not the problem -
but hard to find mailers nowadays that accept non TLS emails.

That is the real problem - not Perl or any scripting language
(while I prefer Perl as it is there, always)
 
Back
Top