KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/share/doc/smartmontools-5.42/examplescripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/share/doc/smartmontools-5.42/examplescripts/Example1
#!/bin/bash 
#
# This is a script from the smartmontools examplescripts/ directory.
# It can be used as an argument to the -M exec Directive in
# /etc/smartd.conf, in a line like 
# -m root@localhost -M exec /path/to/this/file
#
# Please see man 8 smartd or man 5 smartd.conf for further
# information.
#
# $Id: Example1,v 1.7 2004/08/29 02:33:17 ballen4705 Exp $

# Save standard input into a temp file
cat > /root/tempfile

# Echo command line arguments into temp file
echo "Command line argument 1:" >> /root/tempfile
echo $1 >> /root/tempfile
echo "Command line argument 2:" >> /root/tempfile
echo $2 >> /root/tempfile
echo "Command line argument 3:" >> /root/tempfile
echo $3 >> /root/tempfile

# Echo environment variables into a temp file
echo "Variables are":       >> /root/tempfile
echo "$SMARTD_DEVICE"       >> /root/tempfile
echo "$SMARTD_DEVICESTRING" >> /root/tempfile
echo "$SMARTD_DEVICETYPE"   >> /root/tempfile
echo "$SMARTD_MESSAGE"      >> /root/tempfile
echo "$SMARTD_FULLMESSAGE"  >> /root/tempfile
echo "$SMARTD_ADDRESS"      >> /root/tempfile
echo "$SMARTD_SUBJECT"      >> /root/tempfile
echo "$SMARTD_TFIRST"       >> /root/tempfile
echo "$SMARTD_TFIRSTEPOCH"  >> /root/tempfile

# Run smartctl -a and save output in temp file
/usr/sbin/smartctl -a -d $SMARTD_DEVICETYPE $SMARTD_DEVICE >> /root/tempfile

# Email the contents of the temp file. Solaris and other OSes
# may need to use /bin/mailx not /bin/mail.
/bin/mail -s "SMART errors detected on host: `hostname`" $SMARTD_ADDRESS < /root/tempfile

# And exit
exit 0

Anon7 - 2021